});
buttonPanel = new Composite(parent, SWT.NONE);
+
+ buttonPanel.setLayout(new RowLayout());
+ GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel);
+
+ /**
+ * Add description button
+ */
+ Button btnAddDescription = new Button(buttonPanel, SWT.PUSH);
+ btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON));
+ btnAddDescription.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ SpecimenSelectionDialog dialog = new SpecimenSelectionDialog(natTable.getShell(), CharacterMatrix.this);
+ if(dialog.open()==Window.OK){
+ Collection<SpecimenOrObservationBase> specimens = dialog.getSpecimen();
+ boolean hasAdded = false;
+ for (SpecimenOrObservationBase specimen : specimens) {
+ SpecimenDescription description = getDescriptionForWorkingSet(specimen);
+ if(!workingSet.getDescriptions().contains(description)){
+ CharacterMatrix.this.descriptions.add(new RowWrapper(description));
+ workingSet.addDescription(description);
+ hasAdded = true;
+ }
+ }
+ if(hasAdded){
+ setDirty();
+ }
+ }
+ }
+ });
}
private void toggleTreeFlat(boolean isTree) {
btnExpandAll.setEnabled(isTree);
natTable.doCommand(new StructuralRefreshCommand());
natTable.doCommand(new VisualRefreshCommand());
+ parent.layout();
+
}
public void init(UUID workingSetUuid, boolean treeView) {
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);
-
wsLabel.setText(workingSet.getLabel());
wsLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
wsLabel.getParent().layout();
- buttonPanel.setLayout(new RowLayout());
- GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel);
-
- /**
- * Add description button
- */
- Button btnAddDescription = new Button(buttonPanel, SWT.PUSH);
- btnAddDescription.setImage(ImageResources.getImage(ImageResources.ADD_ICON));
- btnAddDescription.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- SpecimenSelectionDialog dialog = new SpecimenSelectionDialog(natTable.getShell(), CharacterMatrix.this);
- if(dialog.open()==Window.OK){
- Collection<SpecimenOrObservationBase> specimens = dialog.getSpecimen();
- boolean hasAdded = false;
- for (SpecimenOrObservationBase specimen : specimens) {
- SpecimenDescription description = getDescriptionForWorkingSet(specimen);
- if(!workingSet.getDescriptions().contains(description)){
- CharacterMatrix.this.descriptions.add(new RowWrapper(description));
- workingSet.addDescription(description);
- hasAdded = true;
- }
- }
- if(hasAdded){
- setDirty();
- }
- }
- }
- });
-
parent.layout();
}