import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.widgets.TableWrapData;
import org.eclipse.ui.forms.widgets.TableWrapLayout;
import eu.etaxonomy.taxeditor.l10n.Messages;
initText(formFactory, null, textHeight, null, false, style, getLayoutComposite());
//exceptionLabel
-// initExceptionLabel(getLayoutComposite(), formFactory, initialObject);
+ initExceptionLabel(getLayoutComposite(), formFactory);
}
protected void initExceptionLabel(Composite parent, CdmFormFactory formFactory) {
}
labelException.setLayoutData(LayoutConstants.FILL_HORIZONTALLY(numColumns, 1));
labelException.setBackground(getPersistentBackground());
+ labelException.setSize(1, 1);
labelException.setData("exceptionLabel");
addControl(labelException);
+ this.getLayoutComposite().layout();
}
public abstract void setParsedText(T object);
public T parseText(){
try {
- removeLabelException();
-// labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
-// labelException.setForeground(getPersistentBackground());
-// labelException.setText(""); //$NON-NLS-1$
+ labelException.setFont(JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT));
+ labelException.setForeground(getPersistentBackground());
+ labelException.setText(""); //$NON-NLS-1$
return getParsedText();
} catch (Exception e) {
- initExceptionLabel(getLayoutComposite(), formFactory);
+ int numColumns = AbstractFormSection.DEFAULT_NUM_COLUMNS;
+ if(getLayoutComposite().getLayout() instanceof TableWrapLayout){
+ numColumns = ((TableWrapLayout)getLayoutComposite().getLayout()).numColumns;
+ }
+ TableWrapData layoutData = LayoutConstants.FILL_HORIZONTALLY(numColumns, 1);
labelException.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));
labelException.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
labelException.setText(Messages.UriWithLabelElement_URL_NOT_SAVED + e.getLocalizedMessage());
+ this.getLayoutComposite().redraw();
return null;
}
}