import org.argeo.cms.Localized;
import org.argeo.cms.ui.CmsTheme;
import org.argeo.cms.ui.util.CmsIcon;
+import org.argeo.cms.ui.util.CmsUiUtils;
import org.argeo.cms.ui.viewers.EditablePart;
import org.argeo.cms.ui.widgets.ContextOverlay;
import org.argeo.cms.ui.widgets.StyledControl;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.ToolItem;
protected final TermsManager termsManager;
protected final Typology typology;
- protected final boolean editable;
+ private final boolean editable;
private CmsIcon deleteIcon;
private CmsIcon addIcon;
private Composite highlight;
protected final CmsTheme theme;
-
+
public AbstractTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
super(parent, style, item);
if (item == null)
highlightColor = parent.getDisplay().getSystemColor(SWT.COLOR_GRAY);
}
+ public boolean isEditable() {
+ return editable;
+ }
+
protected void createHighlight(Composite block) {
highlight = new Composite(block, SWT.NONE);
highlight.setBackground(highlightColor);
}
+ protected void setControlLayoutData(Control control) {
+ control.setLayoutData(CmsUiUtils.fillAll());
+ }
+
+ protected void setContainerLayoutData(Composite composite) {
+ composite.setLayoutData(CmsUiUtils.fillAll());
+ }
+
//
// STYLING
//