Revision e7df9bb1
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/workingSet/WorkingSetComposite.java | ||
---|---|---|
12 | 12 |
import org.eclipse.swt.SWT; |
13 | 13 |
import org.eclipse.swt.layout.GridData; |
14 | 14 |
import org.eclipse.swt.layout.GridLayout; |
15 |
import org.eclipse.swt.widgets.Button; |
|
15 | 16 |
import org.eclipse.swt.widgets.Composite; |
16 | 17 |
import org.eclipse.swt.widgets.Label; |
17 | 18 |
import org.eclipse.swt.widgets.Text; |
... | ... | |
22 | 23 |
import eu.etaxonomy.cdm.model.location.NamedArea; |
23 | 24 |
import eu.etaxonomy.cdm.model.name.Rank; |
24 | 25 |
import eu.etaxonomy.taxeditor.featuretree.e4.FeatureTreeEditorComposite; |
26 |
import eu.etaxonomy.taxeditor.model.ImageResources; |
|
25 | 27 |
import eu.etaxonomy.taxeditor.ui.combo.TermUuidComboViewer; |
26 | 28 |
import eu.etaxonomy.taxeditor.util.TaxonTreeNodeContentProvider; |
27 | 29 |
import eu.etaxonomy.taxeditor.util.TaxonTreeNodeLabelProvider; |
... | ... | |
39 | 41 |
private TreeViewer taxonNodeTree; |
40 | 42 |
private NamedArea area; |
41 | 43 |
private Text textAreaText; |
44 |
private Button btnChooseArea; |
|
45 |
private Button btnRemoveArea; |
|
42 | 46 |
|
43 | 47 |
public WorkingSetComposite(Composite parent, int style) { |
44 | 48 |
super(parent, style); |
... | ... | |
81 | 85 |
lblNewLabel_4.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); |
82 | 86 |
lblNewLabel_4.setText("Area"); |
83 | 87 |
|
84 |
textAreaText = new Text(this, SWT.BORDER); |
|
88 |
Composite composite = new Composite(this, SWT.NONE); |
|
89 |
composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1)); |
|
90 |
GridLayout gl_composite = new GridLayout(3, false); |
|
91 |
gl_composite.horizontalSpacing = 0; |
|
92 |
gl_composite.verticalSpacing = 0; |
|
93 |
gl_composite.marginHeight = 0; |
|
94 |
gl_composite.marginWidth = 0; |
|
95 |
composite.setLayout(gl_composite); |
|
96 |
|
|
97 |
textAreaText = new Text(composite, SWT.BORDER); |
|
85 | 98 |
textAreaText.setEditable(false); |
86 | 99 |
textAreaText.setText("Choose..."); |
87 | 100 |
textAreaText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); |
88 | 101 |
|
102 |
btnChooseArea = new Button(composite, SWT.NONE); |
|
103 |
btnChooseArea.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON)); |
|
104 |
|
|
105 |
btnRemoveArea = new Button(composite, SWT.NONE); |
|
106 |
btnRemoveArea.setImage(ImageResources.getImage(ImageResources.TRASH_ICON)); |
|
107 |
|
|
89 | 108 |
featureTreeEditorComposite = new FeatureTreeEditorComposite(this, SWT.NONE); |
90 |
featureTreeEditorComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1)); |
|
109 |
featureTreeEditorComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2)); |
|
110 |
new Label(this, SWT.NONE); |
|
91 | 111 |
} |
92 | 112 |
|
93 | 113 |
@Override |
... | ... | |
134 | 154 |
this.area = area; |
135 | 155 |
textAreaText.setText(area.getLabel()); |
136 | 156 |
} |
137 |
public Text getTextAreaText() { |
|
138 |
return textAreaText; |
|
157 |
public void removeArea() { |
|
158 |
this.area = null; |
|
159 |
textAreaText.setText(""); |
|
160 |
} |
|
161 |
public Button getBtnChooseArea() { |
|
162 |
return btnChooseArea; |
|
163 |
} |
|
164 |
public Button getBtnRemoveArea() { |
|
165 |
return btnRemoveArea; |
|
139 | 166 |
} |
140 | 167 |
} |
Also available in: Unified diff
ref #7086 Add "browse" and "delete" button to area selection in WSeditor