- colorLabel = new Label(getLayoutComposite(), style);
- colorLabel.addMouseListener(this);
-
- String defaultColor = entity.getDefaultColor();
- if(defaultColor!=null){
- java.awt.Color awtColor = java.awt.Color.decode("#"+defaultColor);
+ TableWrapData left = LayoutConstants.LEFT();
+ left.valign = TableWrapData.MIDDLE;
+ colorTextLabel.setLayoutData(left);
+ addControl(colorTextLabel);
+
+ //composite(color label + button)
+ Composite colorAndButton = formFactory.createComposite(getLayoutComposite(), style);
+ addControl(colorAndButton);
+ GridLayout layout = new GridLayout(2, false);
+ layout.marginWidth = 0;
+ colorAndButton.setLayout(layout);
+
+ colorLabel = new Label(colorAndButton, style|SWT.BORDER);
+ colorLabel.setLayoutData(new GridData(16, 16));
+
+ String defaultColor = entity.getDefaultColor();
+ if(defaultColor!=null){
+ //TODO: Is there any utility method from SWT?
+ java.awt.Color awtColor = java.awt.Color.decode("#"+defaultColor);