Project

General

Profile

Revision cc4535d4

IDcc4535d469af746c6b4c95f84c84c323aaa8351f
Parent 880044bc
Child d455719e

Added by Patrick Plitzner about 3 years ago

ref #6694 Improve UI and feature tree creation

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java
76 76
	private Label label_title;
77 77
	private Button button_add;
78 78
	private Button button_remove;
79
	private Label label_treeInfo;
80 79
	private FeatureTree featureTree;
81 80
	private Text text_title;
82 81
    private Button btnOpenFeatureTree;
83
    private Button btnNewFeatureTree;
84 82

  
85 83
    private ConversationHolder conversation;
86 84
    @Inject
......
107 105
		Composite composite_treeTitle = new Composite(composite, SWT.NULL);
108 106
		composite_treeTitle.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true,
109 107
				false));
110
		composite_treeTitle.setLayout(new GridLayout(4, false));
108
		composite_treeTitle.setLayout(new GridLayout(3, false));
111 109

  
112 110
		label_title = new Label(composite_treeTitle, SWT.NULL);
113 111
		label_title.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
......
117 115
		text_title.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
118 116

  
119 117
		btnOpenFeatureTree = new Button(composite_treeTitle, SWT.NONE);
118
		btnOpenFeatureTree.setToolTipText("Open Tree");
120 119
		btnOpenFeatureTree.setImage(ImageResources.getImage(ImageResources.BROWSE_ICON));
121
		btnOpenFeatureTree.setText("Open Tree");
122

  
123
		btnNewFeatureTree = new Button(composite_treeTitle, SWT.NONE);
124
		btnNewFeatureTree.setText("New Feature Tree");
125 120

  
126 121
		Composite composite_treeContent = new Composite(composite, SWT.NULL);
127 122
		composite_treeContent.setLayoutData(new GridData(SWT.FILL, SWT.FILL,
......
141 136
		composite_buttons.setLayout(new GridLayout());
142 137

  
143 138
		button_add = new Button(composite_buttons, SWT.PUSH);
144
		button_add.setText("Add");
145
		button_add.setToolTipText("Add a feature to this feature treee.");
139
		button_add.setToolTipText("Add a feature to this feature tree.");
140
		button_add.setImage(ImageResources.getImage(ImageResources.ADD_EDIT));
146 141
		button_remove = new Button(composite_buttons, SWT.PUSH);
147
		button_remove.setText("Remove");
148
		button_remove
149
				.setToolTipText("Remove a feature from this feature tree.");
150

  
151
		label_treeInfo = new Label(composite, SWT.NULL);
152
		label_treeInfo
153
				.setText("Order and nesting of feature nodes may be changed through drag and drop.");
142
		button_remove.setToolTipText("Remove a feature from this feature tree.");
143
		button_remove.setImage(ImageResources.getImage(ImageResources.TRASH_ICON));
154 144

  
155 145
		init(shell);
156 146
	}
......
181 171
            @Override
182 172
            public void widgetSelected(SelectionEvent e) {
183 173
                FeatureTree tree = FeatureTreeSelectionDialog.select(shell, conversation, null);
184
                setSelectedTree(tree);
174
                if(tree!=null){
175
                    setSelectedTree(tree);
176
                }
185 177
            }
186 178

  
187 179
            @Override
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/ImageResources.java
52 52
	************************************************************************************** */
53 53
	/** Constant <code>ADD_ICON="add_icon"</code> */
54 54
	public static final String ADD_ICON = "add_icon";
55
	public static final String ADD_EDIT = "add_edit";
55 56
	/** Constant <code>TRASH_ICON="trash_icon"</code> */
56 57
	public static final String TRASH_ICON = "trash_icon";
57 58
	/** Constant <code>BROWSE_ICON="browse_icon"</code> */
......
261 262
	protected void initializeImageRegistry(ImageRegistry registry) {
262 263
		registerImage(registry, ADD_ICON,
263 264
				"add_no_bg.gif");
265
		registerImage(registry, ADD_EDIT,
266
		        "add_edit.gif");
264 267
		registerImage(registry, TRASH_ICON,
265 268
				"trash.gif");
266 269
		registerImage(registry, EDIT_ICON,
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/FeatureTreeSelectionDialog.java
14 14
import java.util.UUID;
15 15

  
16 16
import org.eclipse.core.runtime.IStatus;
17
import org.eclipse.jface.dialogs.InputDialog;
17 18
import org.eclipse.jface.wizard.WizardDialog;
18 19
import org.eclipse.swt.SWT;
19 20
import org.eclipse.swt.widgets.Composite;
......
110 111
			@Override
111 112
            public void handleEvent(Event event) {
112 113

  
113
				FeatureTreeEditorWizard wizard = new FeatureTreeEditorWizard();
114
				WizardDialog dialog = new WizardDialog(getShell(), wizard);
115
				int status = dialog.open();
116

  
114
			    InputDialog input = new InputDialog(getShell(), "New feature tree", "Enter label for new feature tree", null, null);
115
				int status = input.open();
117 116
				if (status == IStatus.OK) {
118
					refresh();
117
				    String label = input.getValue();
118
				    if(label!=null){
119
				        FeatureTree featureTree = FeatureTree.NewInstance();
120
				        featureTree.setTitleCache(label, false);
121
				        CdmStore.getService(IFeatureTreeService.class).save(featureTree);
122
			            UuidAndTitleCache<FeatureTree> uuidAndTitleCache = new UuidAndTitleCache<FeatureTree>(FeatureTree.class, featureTree.getUuid(),featureTree.getId(), featureTree.getTitleCache());
123
			            model.add(uuidAndTitleCache);
124
				    }
119 125
				}
120 126
			}
121 127
		});

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)