Revision 4ae25779
Added by Lutz Suhrbier about 13 years ago
eu.etaxonomy.taxeditor.application/META-INF/MANIFEST.MF | ||
---|---|---|
9 | 9 |
org.eclipse.core.runtime, |
10 | 10 |
eu.etaxonomy.taxeditor.cdmlib;bundle-version="3.0.0", |
11 | 11 |
eu.etaxonomy.taxeditor.store;bundle-version="3.0.0", |
12 |
eu.etaxonomy.taxeditor.navigation;bundle-version="3.0.0" |
|
12 |
eu.etaxonomy.taxeditor.navigation;bundle-version="3.0.0", |
|
13 |
eu.etaxonomy.taxeditor.editor;bundle-version="3.0.0" |
|
13 | 14 |
Bundle-ActivationPolicy: lazy |
14 | 15 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
15 | 16 |
Import-Package: javax.servlet;version="2.4.0", |
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/BulkEditing.java | ||
---|---|---|
4 | 4 |
package eu.etaxonomy.taxeditor.perspective; |
5 | 5 |
|
6 | 6 |
import org.eclipse.ui.IPageLayout; |
7 |
/* RAP Exclude |
|
8 |
import eu.etaxonomy.taxeditor.bulkeditor.referencingobjects.ReferencingObjectsView; |
|
7 |
|
|
9 | 8 |
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart; |
10 | 9 |
import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart; |
11 |
*/ |
|
12 | 10 |
|
13 | 11 |
/** |
14 | 12 |
* @author n.hoffmann |
... | ... | |
22 | 20 |
@Override |
23 | 21 |
public void createInitialLayout(IPageLayout layout) { |
24 | 22 |
|
25 |
/* RAP Exclude |
|
26 | 23 |
layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.5f, layout.getEditorArea()); |
27 | 24 |
|
28 | 25 |
layout.addView(SupplementalDataViewPart.ID, IPageLayout.BOTTOM, 0.3f, DetailsViewPart.ID); |
29 |
|
|
26 |
|
|
27 |
/* RAPExclude BulkEditor not supported |
|
30 | 28 |
layout.addView(ReferencingObjectsView.ID, IPageLayout.BOTTOM, 0.3f, SupplementalDataViewPart.ID); |
31 | 29 |
*/ |
32 |
|
|
33 | 30 |
createAdditionalFolder(layout, layout.getEditorArea()); |
34 | 31 |
} |
35 | 32 |
|
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Default.java | ||
---|---|---|
8 | 8 |
import org.eclipse.ui.IPlaceholderFolderLayout; |
9 | 9 |
import org.eclipse.ui.progress.IProgressConstants; |
10 | 10 |
|
11 |
/* RAP Exclude |
|
12 | 11 |
import eu.etaxonomy.taxeditor.view.datasource.CdmDataSourceViewPart; |
13 |
*/ |
|
14 | 12 |
|
15 | 13 |
/** |
16 | 14 |
* @author n.hoffmann |
... | ... | |
30 | 28 |
public void createAdditionalFolder(IPageLayout layout, String refId) { |
31 | 29 |
folderAdditional = layout.createPlaceholderFolder(ADDITIONAL, IPageLayout.BOTTOM, 0.25f, refId); |
32 | 30 |
|
33 |
/* RAP Exclude |
|
34 | 31 |
folderAdditional.addPlaceholder(CdmDataSourceViewPart.ID); |
35 |
*/ |
|
36 | 32 |
folderAdditional.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID); |
37 | 33 |
} |
38 | 34 |
|
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/PolytomousKey.java | ||
---|---|---|
4 | 4 |
package eu.etaxonomy.taxeditor.perspective; |
5 | 5 |
|
6 | 6 |
import org.eclipse.ui.IPageLayout; |
7 |
/* RAP Exclude |
|
8 | 7 |
import eu.etaxonomy.taxeditor.navigation.key.polytomous.PolytomousKeyViewPart; |
9 | 8 |
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart; |
10 | 9 |
import eu.etaxonomy.taxeditor.view.supplementaldata.SupplementalDataViewPart; |
11 |
*/ |
|
10 |
|
|
12 | 11 |
/** |
13 | 12 |
* @author n.hoffmann |
14 | 13 |
* |
... | ... | |
20 | 19 |
*/ |
21 | 20 |
@Override |
22 | 21 |
public void createInitialLayout(IPageLayout layout) { |
23 |
/* RAP Exclude |
|
24 | 22 |
layout.addView(PolytomousKeyViewPart.ID, IPageLayout.LEFT, 0.25f, layout.getEditorArea()); |
25 | 23 |
|
26 | 24 |
layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.25f, layout.getEditorArea()); |
27 | 25 |
|
28 | 26 |
layout.addView(SupplementalDataViewPart.ID, IPageLayout.BOTTOM, 0.25f, DetailsViewPart.ID); |
29 |
*/ |
|
30 | 27 |
|
31 | 28 |
createAdditionalFolder(layout, layout.getEditorArea()); |
32 | 29 |
} |
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/perspective/Taxonomic.java | ||
---|---|---|
13 | 13 |
import org.eclipse.ui.IFolderLayout; |
14 | 14 |
import org.eclipse.ui.IPageLayout; |
15 | 15 |
|
16 |
import eu.etaxonomy.taxeditor.editor.view.descriptive.DescriptiveViewPart; |
|
17 |
import eu.etaxonomy.taxeditor.editor.view.media.MediaViewPart; |
|
16 | 18 |
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigator; |
17 | 19 |
import eu.etaxonomy.taxeditor.navigation.search.SearchResultView; |
18 | 20 |
import eu.etaxonomy.taxeditor.view.detail.DetailsViewPart; |
... | ... | |
37 | 39 |
|
38 | 40 |
layout.addView(DetailsViewPart.ID, IPageLayout.RIGHT, 0.25f, layout.getEditorArea()); |
39 | 41 |
layout.addView(SupplementalDataViewPart.ID, IPageLayout.BOTTOM, 0.25f, DetailsViewPart.ID); |
40 |
/* RAPExclude |
|
41 | 42 |
layout.addView(DescriptiveViewPart.ID, IPageLayout.BOTTOM, 0.25f, layout.getEditorArea()); |
42 | 43 |
layout.addView(MediaViewPart.ID, IPageLayout.RIGHT, 0.25f, DescriptiveViewPart.ID); |
43 |
*/ |
|
44 | 44 |
|
45 | 45 |
createAdditionalFolder(layout, layout.getEditorArea()); |
46 | 46 |
} |
eu.etaxonomy.taxeditor.cdmlib/META-INF/MANIFEST.MF | ||
---|---|---|
203 | 203 |
org.aspectj.runtime.internal, |
204 | 204 |
eu.etaxonomy.cdm.model.common", |
205 | 205 |
eu.etaxonomy.cdm.common;uses:="org.jdom.output,org.jdom", |
206 |
eu.etaxonomy.cdm.common.mediaMetaData,
|
|
206 |
eu.etaxonomy.cdm.common.media, |
|
207 | 207 |
eu.etaxonomy.cdm.database; |
208 | 208 |
uses:="org.springframework.transaction, |
209 | 209 |
org.apache.log4j, |
eu.etaxonomy.taxeditor.editor/META-INF/MANIFEST.MF | ||
---|---|---|
35 | 35 |
org.eclipse.ui.forms;resolution:=optional, |
36 | 36 |
eu.etaxonomy.taxeditor.cdmlib;bundle-version="3.0.0", |
37 | 37 |
eu.etaxonomy.taxeditor.store, |
38 |
eu.etaxonomy.taxeditor.bulkeditor, |
|
38 |
eu.etaxonomy.taxeditor.bulkeditor;resolution:=optional,
|
|
39 | 39 |
org.eclipse.zest.core, |
40 | 40 |
org.eclipse.zest.layouts, |
41 |
org.eclipse.rap.jface.databinding;bundle-version="1.5.0"
|
|
41 |
org.eclipse.rap.jface.databinding;bundle-version="1.4.0"
|
|
42 | 42 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
43 | 43 |
Bundle-ActivationPolicy: lazy |
44 | 44 |
Import-Package: org.eclipse.core.databinding.beans, |
45 | 45 |
org.eclipse.core.databinding.observable.list, |
46 | 46 |
org.eclipse.core.databinding.observable.map, |
47 |
org.eclipse.core.resources, |
|
47 |
org.eclipse.core.resources;resolution:=optional,
|
|
48 | 48 |
org.eclipse.core.runtime, |
49 | 49 |
org.eclipse.equinox.app, |
50 | 50 |
org.eclipse.jface.databinding.viewers, |
51 |
org.eclipse.jface.text, |
|
52 |
org.eclipse.jface.text.contentassist, |
|
53 |
org.eclipse.jface.text.source, |
|
54 | 51 |
org.eclipse.ui.forms.widgets, |
55 |
org.eclipse.ui.texteditor, |
|
56 | 52 |
org.eclipse.zest.core.viewers, |
57 | 53 |
org.eclipse.zest.layouts, |
58 | 54 |
org.osgi.framework |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/MultiPageTaxonEditor.java | ||
---|---|---|
17 | 17 |
import org.eclipse.core.commands.operations.UndoContext; |
18 | 18 |
import org.eclipse.core.runtime.IProgressMonitor; |
19 | 19 |
import org.eclipse.jface.dialogs.MessageDialog; |
20 |
import org.eclipse.swt.widgets.Composite; |
|
20 | 21 |
import org.eclipse.swt.widgets.Display; |
21 | 22 |
import org.eclipse.ui.IEditorInput; |
22 | 23 |
import org.eclipse.ui.IEditorPart; |
... | ... | |
51 | 52 |
*/ |
52 | 53 |
public class MultiPageTaxonEditor extends FormEditor implements IConversationEnabled, IPostOperationEnabled, IDirtyMarkableSelectionProvider, IPartContentHasDetails { |
53 | 54 |
|
55 |
@Override |
|
56 |
public Composite getContainer() { |
|
57 |
// TODO Auto-generated method stub |
|
58 |
return super.getContainer(); |
|
59 |
} |
|
60 |
|
|
54 | 61 |
/** Constant <code>ID="eu.etaxonomy.taxeditor.editor.taxon"{trunked}</code> */ |
55 | 62 |
public static final String ID = "eu.etaxonomy.taxeditor.editor.taxon"; |
56 | 63 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/internal/TaxeditorEditorPlugin.java | ||
---|---|---|
38 | 38 |
/** {@inheritDoc} */ |
39 | 39 |
public void start(BundleContext context) throws Exception { |
40 | 40 |
super.start(context); |
41 |
|
|
41 |
/* RAPExclude Moved to EntryPoint |
|
42 | 42 |
EditorStateManager stateManager = new EditorStateManager(); |
43 | 43 |
CdmStore.getContextManager().addContextListener(stateManager); |
44 |
|
|
44 |
*/ |
|
45 | 45 |
plugin = this; |
46 | 46 |
logger.trace("Plugin started: " + this.getBundle().getSymbolicName()); |
47 | 47 |
} |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/TaxonNameEditor.java | ||
---|---|---|
64 | 64 |
import eu.etaxonomy.taxeditor.editor.name.container.ContainerFactory; |
65 | 65 |
import eu.etaxonomy.taxeditor.editor.name.container.HomotypicalSynonymGroup; |
66 | 66 |
import eu.etaxonomy.taxeditor.editor.name.container.MisappliedGroup; |
67 |
import eu.etaxonomy.taxeditor.editor.name.container.NameViewer; |
|
67 | 68 |
import eu.etaxonomy.taxeditor.editor.name.dnd.NameEditorDropTargetListener; |
68 | 69 |
import eu.etaxonomy.taxeditor.model.IPartChangeListener; |
69 | 70 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/AbstractGroupedContainer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor.name.container; |
11 | 11 |
|
12 |
import java.util.List; |
|
13 | 12 |
import java.util.Set; |
14 | 13 |
|
15 |
import org.eclipse.core.runtime.Assert; |
|
16 | 14 |
import org.eclipse.jface.dialogs.Dialog; |
17 |
import org.eclipse.jface.text.IDocument; |
|
18 |
import org.eclipse.jface.text.Position; |
|
19 |
import org.eclipse.jface.window.DefaultToolTip; |
|
20 |
import org.eclipse.swt.custom.StyledText; |
|
21 | 15 |
import org.eclipse.swt.dnd.DND; |
22 | 16 |
import org.eclipse.swt.dnd.DragSource; |
23 | 17 |
import org.eclipse.swt.dnd.Transfer; |
... | ... | |
50 | 44 |
import eu.etaxonomy.cdm.model.name.NonViralName; |
51 | 45 |
import eu.etaxonomy.cdm.model.name.TaxonNameBase; |
52 | 46 |
import eu.etaxonomy.cdm.model.taxon.TaxonBase; |
53 |
import eu.etaxonomy.cdm.strategy.parser.ParserProblem; |
|
54 | 47 |
import eu.etaxonomy.taxeditor.editor.CdmDataTransfer; |
55 | 48 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
56 | 49 |
import eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor; |
57 |
import eu.etaxonomy.taxeditor.editor.name.container.EditorAnnotation.EditorAnnotationType; |
|
58 | 50 |
import eu.etaxonomy.taxeditor.editor.name.dnd.NameEditorDragListener; |
59 | 51 |
import eu.etaxonomy.taxeditor.editor.name.dnd.NameEditorDragSourceEffect; |
60 | 52 |
import eu.etaxonomy.taxeditor.editor.name.operation.CreateSynonymInNewGroupOperation; |
... | ... | |
101 | 93 |
private AbstractGroup group; |
102 | 94 |
|
103 | 95 |
private Label nonEditableInfoLabel; |
96 |
/* RAPExclude No Tooltips |
|
104 | 97 |
private DefaultToolTip nonEditableInfoHover; |
105 |
|
|
98 |
*/ |
|
106 | 99 |
private static AbstractGroupedContainer selection; |
107 | 100 |
|
108 | 101 |
private FocusListener focusListener; |
102 |
/* RAPExclude No LineBreakListener |
|
109 | 103 |
private LineBreakListener lineBreakListener; |
110 |
|
|
104 |
*/ |
|
111 | 105 |
private int cursorPosition; |
112 | 106 |
|
113 | 107 |
protected Composite control; |
... | ... | |
133 | 127 |
createControl(); |
134 | 128 |
|
135 | 129 |
createTextViewer(); |
130 |
/* RAPExclude TODO Currently no LineWrap or Break |
|
136 | 131 |
createLineWrapSupport(); |
137 | 132 |
createLineBreakListener(); |
138 |
|
|
133 |
*/ |
|
139 | 134 |
setMenu(getEditor().getMenu()); |
140 | 135 |
|
136 |
/*RAPExclude Ruler not supported |
|
141 | 137 |
setDraggableControl(new Control[]{getControl(), getNameViewer().getRulerControl()}); |
138 |
*/ |
|
139 |
setDraggableControl(new Control[]{getControl(), getNameViewer().getControl()}); |
|
142 | 140 |
|
141 |
/* RAPExclude Currently no Document Support |
|
143 | 142 |
createEmptyViewerPrompt(EMPTY_NAME_PROMPT); |
144 |
|
|
143 |
*/ |
|
145 | 144 |
|
146 | 145 |
initializeComposite(); |
147 | 146 |
|
... | ... | |
169 | 168 |
getTaxonBase().setTitleCache((getTaxonBase().generateTitle())); |
170 | 169 |
|
171 | 170 |
// show errors resulting from parsing |
171 |
/* RAPExclude TODO Currently no Annotations |
|
172 | 172 |
calculateAnnotations(); |
173 |
*/ |
|
173 | 174 |
// store the position of the cursor |
174 | 175 |
storeCursor(); |
175 | 176 |
// notify selection listener |
... | ... | |
193 | 194 |
} |
194 | 195 |
|
195 | 196 |
private void addListener(){ |
197 |
/* RAPExclude ModifyListeners Currently not supported |
|
196 | 198 |
getNameViewer().getTextWidget().addModifyListener(nameCompositeModifyListener); |
197 |
getNameViewer().getTextWidget().addFocusListener(nameCompositeFocusListener); |
|
199 |
*/ |
|
200 |
/* RAPModify FocusListener in NameViewer |
|
201 |
* getNameViewer().getTextWidget().addFocusListener(nameCompositeFocusListener); |
|
202 |
*/ |
|
203 |
getNameViewer().addFocusListener(nameCompositeFocusListener); |
|
198 | 204 |
} |
199 | 205 |
|
200 | 206 |
private void removeListener(){ |
207 |
/* RAPExclude Listeners Currently not supported |
|
201 | 208 |
getNameViewer().getTextWidget().removeModifyListener(nameCompositeModifyListener); |
202 |
getNameViewer().getTextWidget().removeFocusListener(nameCompositeFocusListener); |
|
209 |
*/ |
|
210 |
/* RAPModify FocusListener in NameViewer |
|
211 |
* getNameViewer().getTextWidget().removeFocusListener(nameCompositeFocusListener); |
|
212 |
*/ |
|
213 |
getNameViewer().removeFocusListener(nameCompositeFocusListener); |
|
214 |
|
|
203 | 215 |
} |
204 | 216 |
|
205 | 217 |
/** |
... | ... | |
269 | 281 |
getNameViewer().setText(text); |
270 | 282 |
placeCursor(); |
271 | 283 |
} |
284 |
/* RAPExclude No Annotations |
|
272 | 285 |
calculateAnnotations(); |
286 |
*/ |
|
273 | 287 |
} |
274 | 288 |
|
275 | 289 |
/** |
276 | 290 |
* <p>calculateErrors</p> |
277 | 291 |
*/ |
292 |
/* RAPExclude No Annotations |
|
278 | 293 |
synchronized protected void calculateAnnotations() { |
279 | 294 |
getNameViewer().clearAnnotations(); |
280 | 295 |
showAnnotations(); |
281 | 296 |
} |
282 |
|
|
297 |
*/ |
|
283 | 298 |
/** |
284 | 299 |
* |
285 | 300 |
*/ |
301 |
/* RAPExclude No Annotations |
|
302 |
|
|
286 | 303 |
public void showAnnotations() { |
287 | 304 |
|
288 | 305 |
if(getName().hasProblem()){ |
... | ... | |
300 | 317 |
|
301 | 318 |
|
302 | 319 |
} |
320 |
*/ |
|
303 | 321 |
|
304 | 322 |
/** |
305 | 323 |
* |
306 | 324 |
*/ |
325 |
/* RAPExclude No Annotations |
|
307 | 326 |
private void showParsingProblems() { |
308 | 327 |
String text = getNameViewer().getTextWidget().getText(); |
309 | 328 |
|
... | ... | |
313 | 332 |
getNameViewer().addAnnotation(new EditorAnnotation(problem), getParsingProblemPosition()); |
314 | 333 |
} |
315 | 334 |
} |
335 |
*/ |
|
336 |
|
|
337 |
/* RAPExclude No Annotations |
|
316 | 338 |
|
317 | 339 |
private Position getParsingProblemPosition(){ |
318 | 340 |
String text = getNameViewer().getTextWidget().getText(); |
... | ... | |
334 | 356 |
} |
335 | 357 |
return null; |
336 | 358 |
} |
359 |
*/ |
|
337 | 360 |
|
338 | 361 |
/** |
339 | 362 |
* <p>handleSplitText</p> |
... | ... | |
400 | 423 |
private void isFreeTextEnabled() { |
401 | 424 |
// Decide whether editing of freetext is allowed or not. |
402 | 425 |
if (freetextEditingAllowed()) { |
403 |
|
|
426 |
|
|
427 |
/* RAPExclude TODO Edit Name Viewer Functionality |
|
404 | 428 |
// set editable |
405 | 429 |
getNameViewer().getTextWidget().setEditable(true); |
406 |
|
|
430 |
*/ |
|
407 | 431 |
// restore foreground font color again |
432 |
/* RAPModify |
|
408 | 433 |
getNameViewer().getTextWidget().setForeground(control.getForeground()); |
434 |
*/ |
|
435 |
getNameViewer().setForeground(control.getForeground()); |
|
436 |
|
|
409 | 437 |
} else { |
438 |
/* RAPExclude TODO Edit Name Viewer Functionality |
|
410 | 439 |
// set non-editable |
411 | 440 |
getNameViewer().getTextWidget().setEditable(false); |
412 |
|
|
441 |
*/ |
|
413 | 442 |
// grey out text as a non-editable indicator |
443 |
/* RAPModify |
|
414 | 444 |
getNameViewer().getTextWidget().setForeground(EditorUtil.getColor(Resources.COLOR_DISABLED_EDITOR)); |
445 |
*/ |
|
446 |
getNameViewer().setForeground(EditorUtil.getColor(Resources.COLOR_DISABLED_EDITOR)); |
|
415 | 447 |
} |
416 | 448 |
} |
417 | 449 |
|
... | ... | |
455 | 487 |
/** |
456 | 488 |
* Parse the text and calculate errors |
457 | 489 |
*/ |
490 |
/* RAPExclude No Annotations |
|
491 |
|
|
458 | 492 |
public void parseAndCalculateAnnotations(){ |
459 | 493 |
removeListener(); |
460 | 494 |
String unparsedNameString = getNameViewer().getTextWidget().getText(); |
... | ... | |
462 | 496 |
addListener(); |
463 | 497 |
calculateAnnotations(); |
464 | 498 |
} |
499 |
*/ |
|
465 | 500 |
|
466 | 501 |
/** |
467 | 502 |
* <p>getTaxonBase</p> |
... | ... | |
486 | 521 |
*/ |
487 | 522 |
public void persistName(){ |
488 | 523 |
if(isDirty()){ |
524 |
/* RAPExlude Item not to enable |
|
489 | 525 |
getNameViewer().getTextWidget().setEnabled(false); |
526 |
*/ |
|
490 | 527 |
final String unparsedNameString = getNameViewer().getTextWidget().getText(); |
491 | 528 |
// Job job = new Job("Persisting Name"){ |
492 | 529 |
// |
... | ... | |
500 | 537 |
getTaxonBase().setName(name); |
501 | 538 |
getTaxonBase().setTitleCache((getTaxonBase().generateTitle())); |
502 | 539 |
setDirty(false); |
503 |
getNameViewer().getTextWidget().setEnabled(true); |
|
540 |
/* RAPExlude Item not to enable |
|
541 |
getNameViewer().getTextWidget().setEnabled(true); |
|
542 |
*/ |
|
504 | 543 |
// }; |
505 | 544 |
// }); |
506 | 545 |
// |
... | ... | |
573 | 612 |
/** |
574 | 613 |
* <p>createLineWrapSupport</p> |
575 | 614 |
*/ |
615 |
/* RAPExclude NoLineWrap |
|
576 | 616 |
protected void createLineWrapSupport() { |
577 | 617 |
new LineWrapSupport(getNameViewer(), getEditor().getManagedForm()); |
578 | 618 |
} |
579 |
|
|
619 |
*/ |
|
580 | 620 |
|
581 | 621 |
/** |
582 | 622 |
* <p>createTextViewer</p> |
583 | 623 |
*/ |
584 | 624 |
protected void createTextViewer() { |
585 | 625 |
nameViewer = new NameViewer(control); |
586 |
|
|
587 | 626 |
focusListener = new FocusAdapter() { |
588 | 627 |
@Override |
589 | 628 |
public void focusGained(FocusEvent e) { |
... | ... | |
595 | 634 |
colorSelected(SELECTED_FOCUS); |
596 | 635 |
} |
597 | 636 |
}; |
637 |
/* RAPModify Use Viewer directly |
|
598 | 638 |
nameViewer.getTextWidget().addFocusListener(focusListener); |
599 |
|
|
600 |
// |
|
639 |
*/ |
|
640 |
nameViewer.addFocusListener(focusListener); |
|
641 |
|
|
601 | 642 |
MouseAdapter mouseListener = new MouseAdapter() { |
602 | 643 |
@Override |
603 | 644 |
public void mouseDown(MouseEvent e) { |
... | ... | |
605 | 646 |
} |
606 | 647 |
}; |
607 | 648 |
control.addMouseListener(mouseListener); |
608 |
nameViewer.getRulerControl().addMouseListener(mouseListener); |
|
649 |
/* RAPExclude No Rulers |
|
650 |
* nameViewer.getRulerControl().addMouseListener(mouseListener); |
|
651 |
*/ |
|
652 |
/* RAPModify Use Viewer directly |
|
609 | 653 |
nameViewer.getTextWidget().addMouseListener(mouseListener); |
654 |
*/ |
|
655 |
nameViewer.addMouseListener(mouseListener); |
|
656 |
|
|
610 | 657 |
} |
611 | 658 |
|
612 | 659 |
/** |
... | ... | |
639 | 686 |
* <p>setSelected</p> |
640 | 687 |
*/ |
641 | 688 |
public void setSelected() { |
642 |
getNameViewer().getTextWidget().setFocus(); |
|
689 |
//RAPExclude getNameViewer().getTextWidget().setFocus();
|
|
643 | 690 |
} |
644 | 691 |
|
645 | 692 |
/** |
... | ... | |
745 | 792 |
* |
746 | 793 |
* @param prompt a {@link java.lang.String} object. |
747 | 794 |
*/ |
795 |
/* RAPExclude TODO Document not supported |
|
748 | 796 |
public void createEmptyViewerPrompt(final String prompt) { |
749 | 797 |
|
750 | 798 |
Assert.isNotNull(getNameViewer()); |
... | ... | |
777 | 825 |
document.set(prompt); |
778 | 826 |
} |
779 | 827 |
} |
780 |
|
|
828 |
*/ |
|
781 | 829 |
/** |
782 | 830 |
* <p>getViewerFont</p> |
783 | 831 |
* |
... | ... | |
791 | 839 |
protected void initEmptyText() { |
792 | 840 |
Font defaultFont = EditorUtil.getFont(Resources.FONT_DEFAULT_PROMPT); |
793 | 841 |
getNameViewer().getTextWidget().setFont(defaultFont); |
794 |
|
|
842 |
|
|
843 |
/* RAPExclude TODO Document Replacement |
|
795 | 844 |
getNameViewer().getDocument().set(getEmptyTextPrompt()); |
845 |
*/ |
|
846 |
getNameViewer().setText(getEmptyTextPrompt()); |
|
796 | 847 |
placeCursor(); |
797 | 848 |
} |
798 | 849 |
|
... | ... | |
929 | 980 |
nonEditableInfoLabel = getEditor().getToolkit().createLabel(control, ""); |
930 | 981 |
TableWrapData layoutData = new TableWrapData(TableWrapData.FILL_GRAB, TableWrapData.TOP); |
931 | 982 |
// Set indent to viewer ruler's width |
983 |
/* RAPExclude No Ruler |
|
932 | 984 |
if (getNameViewer().getRulerControl() != null) { |
933 | 985 |
// TODO right justify |
934 | 986 |
layoutData.indent = NameViewer.RULER_WIDTH; |
935 | 987 |
} |
988 |
*/ |
|
936 | 989 |
nonEditableInfoLabel.setLayoutData(layoutData); |
937 | 990 |
|
938 | 991 |
|
... | ... | |
944 | 997 |
} |
945 | 998 |
}; |
946 | 999 |
nonEditableInfoLabel.addControlListener(nonEditableLabelEllipsisListener); |
947 |
|
|
1000 |
|
|
1001 |
/* RAPExclude No Hovers |
|
948 | 1002 |
nonEditableInfoHover = new DefaultToolTip(nonEditableInfoLabel); |
949 | 1003 |
nonEditableInfoHover.setRespectDisplayBounds(true); |
1004 |
*/ |
|
950 | 1005 |
|
951 | 1006 |
} |
1007 |
/* RAPExclude No Hovers |
|
952 | 1008 |
nonEditableInfoHover.setText(nonEditableHoverText); |
1009 |
*/ |
|
953 | 1010 |
nonEditableInfoLabel.setText(nonEditableText); |
954 |
|
|
1011 |
|
|
1012 |
/* RAPExclude No Annotations |
|
955 | 1013 |
calculateAnnotations(); |
1014 |
*/ |
|
956 | 1015 |
} |
957 | 1016 |
|
958 | 1017 |
/** |
... | ... | |
978 | 1037 |
* i.e. the creation of a new composite - call this method and override |
979 | 1038 |
* the method handleSplitText(). |
980 | 1039 |
*/ |
1040 |
/* RAPExclude No LineBreakListener |
|
981 | 1041 |
protected void createLineBreakListener() { |
982 | 1042 |
lineBreakListener = new LineBreakListener() { |
983 | 1043 |
@Override |
... | ... | |
985 | 1045 |
AbstractGroupedContainer.this.handleSplitText(text); |
986 | 1046 |
} |
987 | 1047 |
}; |
988 |
|
|
989 | 1048 |
getNameViewer().getTextWidget().addVerifyListener(lineBreakListener); |
990 | 1049 |
} |
991 |
|
|
1050 |
*/ |
|
992 | 1051 |
abstract class LabelEllipsisListener extends ControlAdapter { |
993 | 1052 |
|
994 | 1053 |
private final Label label; |
... | ... | |
1016 | 1075 |
* <p>storeCursor</p> |
1017 | 1076 |
*/ |
1018 | 1077 |
public void storeCursor() { |
1078 |
/* RAPExclude TODO Currently no Cursor |
|
1019 | 1079 |
this.cursorPosition = getNameViewer().getCursorPosition(); |
1080 |
*/ |
|
1020 | 1081 |
} |
1021 | 1082 |
|
1022 | 1083 |
/** |
... | ... | |
1024 | 1085 |
* if no former position is known. |
1025 | 1086 |
*/ |
1026 | 1087 |
public void placeCursor(){ |
1088 |
/* RAPExclude TODO Currently no Cursor |
|
1027 | 1089 |
if(cursorPosition == 0){ |
1028 | 1090 |
getNameViewer().setCursorToEOL(); |
1029 | 1091 |
}else{ |
1030 | 1092 |
getNameViewer().setCursorPosition(cursorPosition); |
1031 | 1093 |
} |
1094 |
*/ |
|
1032 | 1095 |
} |
1033 | 1096 |
|
1034 | 1097 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/ConceptContainer.java | ||
---|---|---|
120 | 120 |
/* (non-Javadoc) |
121 | 121 |
* @see eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer#showAnnotations() |
122 | 122 |
*/ |
123 |
/* RAPExclude Annotations not supported |
|
123 | 124 |
@Override |
124 | 125 |
public void showAnnotations() { |
125 | 126 |
if(getData().getSec() == null){ |
... | ... | |
128 | 129 |
} |
129 | 130 |
super.showAnnotations(); |
130 | 131 |
} |
131 |
|
|
132 |
*/ |
|
132 | 133 |
/** {@inheritDoc} */ |
133 | 134 |
@Override |
134 | 135 |
protected void updateNonEditableInfo() { |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/LineBreakListener.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor.name.container; |
11 | 11 |
|
12 |
import java.util.ArrayList; |
|
13 |
import java.util.Collection; |
|
14 | 12 |
import java.util.Scanner; |
15 | 13 |
|
16 |
import org.eclipse.swt.custom.StyledText; |
|
17 | 14 |
import org.eclipse.swt.events.VerifyEvent; |
18 | 15 |
import org.eclipse.swt.events.VerifyListener; |
19 | 16 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/MisapplicationContainer.java | ||
---|---|---|
86 | 86 |
/* (non-Javadoc) |
87 | 87 |
* @see eu.etaxonomy.taxeditor.editor.name.container.AbstractGroupedContainer#showAnnotations() |
88 | 88 |
*/ |
89 |
/* RAPExclude Annotations not supported |
|
89 | 90 |
@Override |
90 | 91 |
public void showAnnotations() { |
91 | 92 |
if(getData().getSec() == null){ |
... | ... | |
94 | 95 |
} |
95 | 96 |
super.showAnnotations(); |
96 | 97 |
} |
97 |
|
|
98 |
*/ |
|
98 | 99 |
|
99 | 100 |
/** {@inheritDoc} */ |
100 | 101 |
@Override |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/container/NameViewer.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.taxeditor.editor.name.container; |
11 | 11 |
|
12 |
import java.util.Iterator; |
|
13 |
|
|
14 |
import org.eclipse.core.commands.operations.IUndoContext; |
|
15 | 12 |
import org.eclipse.core.runtime.Assert; |
16 |
import org.eclipse.jface.text.Document; |
|
17 |
import org.eclipse.jface.text.IUndoManager; |
|
18 |
import org.eclipse.jface.text.IUndoManagerExtension; |
|
19 |
import org.eclipse.jface.text.Position; |
|
20 |
import org.eclipse.jface.text.TextViewerUndoManager; |
|
21 |
import org.eclipse.jface.text.source.Annotation; |
|
22 |
import org.eclipse.jface.text.source.AnnotationModel; |
|
23 |
import org.eclipse.jface.text.source.AnnotationPainter; |
|
24 |
import org.eclipse.jface.text.source.IAnnotationAccess; |
|
25 |
import org.eclipse.jface.text.source.IVerticalRuler; |
|
26 |
import org.eclipse.jface.text.source.SourceViewer; |
|
13 |
import org.eclipse.jface.viewers.TableViewer; |
|
27 | 14 |
import org.eclipse.swt.SWT; |
15 |
import org.eclipse.swt.events.FocusListener; |
|
16 |
import org.eclipse.swt.events.MouseListener; |
|
28 | 17 |
import org.eclipse.swt.graphics.Color; |
29 | 18 |
import org.eclipse.swt.graphics.Image; |
30 |
import org.eclipse.swt.widgets.Canvas; |
|
31 | 19 |
import org.eclipse.swt.widgets.Composite; |
32 |
import org.eclipse.swt.widgets.Control; |
|
33 |
import org.eclipse.swt.widgets.Display; |
|
34 |
import org.eclipse.swt.widgets.Layout; |
|
35 | 20 |
import org.eclipse.swt.widgets.Menu; |
36 |
import org.eclipse.ui.IActionBars; |
|
37 |
import org.eclipse.ui.IEditorSite; |
|
38 |
import org.eclipse.ui.actions.ActionFactory; |
|
39 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
40 |
import org.eclipse.ui.forms.widgets.TableWrapLayout; |
|
41 |
import org.eclipse.ui.operations.OperationHistoryActionHandler; |
|
42 |
import org.eclipse.ui.operations.RedoActionHandler; |
|
43 |
import org.eclipse.ui.operations.UndoActionHandler; |
|
44 |
import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; |
|
45 |
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds; |
|
21 |
import org.eclipse.swt.widgets.TableItem; |
|
46 | 22 |
|
47 | 23 |
import eu.etaxonomy.taxeditor.editor.EditorUtil; |
48 |
import eu.etaxonomy.taxeditor.editor.ViewerConfiguration; |
|
49 |
import eu.etaxonomy.taxeditor.editor.name.container.EditorAnnotation.EditorAnnotationType; |
|
50 | 24 |
import eu.etaxonomy.taxeditor.preference.Resources; |
51 | 25 |
|
52 | 26 |
/** |
... | ... | |
56 | 30 |
* @created 27.05.2008 |
57 | 31 |
* @version 1.0 |
58 | 32 |
*/ |
59 |
public class NameViewer extends SourceViewer {
|
|
33 |
public class NameViewer extends TableViewer {
|
|
60 | 34 |
|
61 | 35 |
/** Constant <code>RULER_WIDTH=16</code> */ |
62 | 36 |
public static final int RULER_WIDTH = 16; |
63 | 37 |
|
38 |
/* RAPExclude not supported |
|
64 | 39 |
private final IVerticalRuler ruler; |
65 | 40 |
private final AnnotationModel annotationModel; |
66 |
|
|
41 |
*/ |
|
67 | 42 |
/** |
68 | 43 |
* <p>Constructor for NameViewer.</p> |
69 | 44 |
* |
70 | 45 |
* @param parent a {@link org.eclipse.swt.widgets.Composite} object. |
71 | 46 |
*/ |
72 | 47 |
public NameViewer(Composite parent) { |
73 |
super(parent, new RulerWithIcon(RULER_WIDTH), SWT.WRAP | SWT.MULTI | SWT.RESIZE); |
|
74 |
|
|
75 |
this.ruler = getVerticalRuler(); |
|
48 |
/* RAPExclude |
|
49 |
* super(parent, new RulerWithIcon(RULER_WIDTH), SWT.WRAP | SWT.MULTI | SWT.RESIZE); |
|
50 |
*/ |
|
51 |
super(parent, SWT.VIRTUAL); |
|
52 |
/* RAPExclude |
|
53 |
* this.ruler = getVerticalRuler(); |
|
54 |
*/ |
|
76 | 55 |
|
56 |
setItemCount(1); |
|
57 |
|
|
77 | 58 |
setBackground(EditorUtil.getColor(Resources.COLOR_COMPOSITE_BACKGROUND)); |
78 |
|
|
79 |
Canvas canvas = (Canvas) getControl(); |
|
80 |
TableWrapLayout layout = (TableWrapLayout) canvas.getLayout(); |
|
59 |
|
|
60 |
/* RAPExclude Table has no Layout |
|
61 |
Table table = (Table)getControl(); |
|
62 |
TableWrapLayout layout = (TableWrapLayout) table.getLayout(); |
|
81 | 63 |
layout.topMargin = 0; |
82 | 64 |
layout.rightMargin = 0; |
83 | 65 |
layout.bottomMargin = 0; |
... | ... | |
85 | 67 |
layout.verticalSpacing = 10; |
86 | 68 |
layout.horizontalSpacing = 0; |
87 | 69 |
|
88 |
canvas.setLayout(layout);
|
|
70 |
table.setLayout(layout);
|
|
89 | 71 |
|
90 | 72 |
// Lay out the viewer's widgets |
91 | 73 |
TableWrapData twdata = new TableWrapData(TableWrapData.FILL_GRAB); |
92 | 74 |
getControl().setLayoutData(twdata); |
75 |
*/ |
|
93 | 76 |
|
77 |
/*RAPExclude TextWidget=StyledText not supported |
|
94 | 78 |
twdata = new TableWrapData(TableWrapData.FILL_GRAB); |
95 | 79 |
getTextWidget().setLayoutData(twdata); |
96 | 80 |
getTextWidget().setLineSpacing(5); |
81 |
*/ |
|
97 | 82 |
|
83 |
/* RAPExclude not supported |
|
98 | 84 |
// Default implementation adds ruler after the text widget, then |
99 | 85 |
// uses a custom layout to display it before the text widget |
100 | 86 |
ruler.getControl().moveAbove(getTextWidget()); |
... | ... | |
105 | 91 |
createAnnotationPainter(); |
106 | 92 |
|
107 | 93 |
this.configure(new ViewerConfiguration()); |
94 |
*/ |
|
108 | 95 |
|
109 | 96 |
// setDecorationSupport(); |
110 | 97 |
// DocumentUndoManagerRegistry.connect(this.getDocument()); |
... | ... | |
122 | 109 |
* @param color a {@link org.eclipse.swt.graphics.Color} object. |
123 | 110 |
*/ |
124 | 111 |
public void setBackground(Color color) { |
112 |
|
|
125 | 113 |
|
114 |
/*RAPExclude not supported |
|
126 | 115 |
// Set background color of ruler |
127 | 116 |
ruler.getControl().setBackground(color); |
128 |
|
|
117 |
*/ |
|
129 | 118 |
// Set background color of text widget |
130 |
getTextWidget().setBackground(color); |
|
119 |
//RAPExclude getTextWidget().setBackground(color); |
|
120 |
getControl().setBackground(color); |
|
131 | 121 |
|
132 | 122 |
// Set background color of strip between ruler and textWidget |
133 |
getTextWidget().getParent().setBackground(color); |
|
123 |
//RAPExclude getTextWidget().getParent().setBackground(color); |
|
124 |
getControl().getParent().setBackground(color); |
|
125 |
} |
|
126 |
|
|
127 |
public void setForeground(Color color) |
|
128 |
{ |
|
129 |
getControl().setForeground(color); |
|
130 |
getControl().getParent().setForeground(color); |
|
134 | 131 |
} |
135 | 132 |
|
136 | 133 |
/** |
... | ... | |
138 | 135 |
* |
139 | 136 |
* @return a {@link org.eclipse.swt.widgets.Control} object. |
140 | 137 |
*/ |
138 |
/* RAPExclude |
|
141 | 139 |
public Control getRulerControl() { |
142 | 140 |
return ruler.getControl(); |
143 | 141 |
} |
144 |
|
|
142 |
*/ |
|
145 | 143 |
/** |
146 | 144 |
* <p>setIcon</p> |
147 | 145 |
* |
148 | 146 |
* @param icon a {@link org.eclipse.swt.graphics.Image} object. |
149 | 147 |
*/ |
148 |
/* RAPExclude |
|
150 | 149 |
public void setIcon(Image icon) { |
151 | 150 |
if (ruler instanceof RulerWithIcon) { |
152 | 151 |
((RulerWithIcon) ruler).setIcon(icon); |
... | ... | |
154 | 153 |
throw new IllegalStateException("Viewer's IVerticalRuler is not an instance of RulerWithIcon."); |
155 | 154 |
} |
156 | 155 |
} |
156 |
*/ |
|
157 |
void setIcon(Image icon) |
|
158 |
{ |
|
159 |
System.out.println("NameViewer.setIcon"); |
|
160 |
} |
|
157 | 161 |
|
158 | 162 |
/* (non-Javadoc) |
159 | 163 |
* @see org.eclipse.jface.text.source.SourceViewer#createLayout() |
... | ... | |
163 | 167 |
* |
164 | 168 |
* @return a {@link org.eclipse.swt.widgets.Layout} object. |
165 | 169 |
*/ |
170 |
/* RAPExclude TableViewer has no createLayout() |
|
166 | 171 |
@Override |
167 | 172 |
protected Layout createLayout() { |
168 | 173 |
TableWrapLayout layout = new TableWrapLayout(); |
... | ... | |
170 | 175 |
layout.verticalSpacing = 0; |
171 | 176 |
return layout; |
172 | 177 |
} |
173 |
|
|
178 |
*/ |
|
179 |
|
|
180 |
/* RAPExclude No Annotations |
|
174 | 181 |
private void createAnnotationPainter(){ |
175 | 182 |
// Annotations section |
176 | 183 |
IAnnotationAccess fAnnotationAccess = new DefaultMarkerAnnotationAccess(); |
... | ... | |
193 | 200 |
|
194 | 201 |
this.addPainter(annotationPainter); |
195 | 202 |
} |
196 |
|
|
203 |
*/ |
|
197 | 204 |
|
198 | 205 |
/** |
199 | 206 |
* <p>clearAnnotations</p> |
200 | 207 |
*/ |
208 |
/* RAPExclude No Annotations |
|
201 | 209 |
public void clearAnnotations() { |
202 | 210 |
Iterator<Annotation> annotations = this.getAnnotationModel().getAnnotationIterator(); |
203 | 211 |
while (annotations.hasNext()) { |
... | ... | |
205 | 213 |
this.getAnnotationModel().removeAnnotation(annotation); |
206 | 214 |
} |
207 | 215 |
} |
208 |
|
|
216 |
*/ |
|
209 | 217 |
/** |
210 | 218 |
* If <code>name.hasProblem()</code> is <code>true</code>, underlines section |
211 | 219 |
* of text bounded by <code>name.getProblemStarts()</code> and |
... | ... | |
249 | 257 |
// |
250 | 258 |
// } |
251 | 259 |
// } |
252 |
|
|
260 |
|
|
261 |
/* RAPExclude No Annotations |
|
253 | 262 |
public void addAnnotation(EditorAnnotation annotation){ |
254 | 263 |
addAnnotation(annotation, null); |
255 | 264 |
} |
... | ... | |
261 | 270 |
|
262 | 271 |
this.getAnnotationModel().addAnnotation(annotation, position); |
263 | 272 |
} |
264 |
|
|
273 |
*/ |
|
274 |
|
|
265 | 275 |
/** |
266 | 276 |
* <p>setText</p> |
267 | 277 |
* |
... | ... | |
273 | 283 |
} |
274 | 284 |
try { |
275 | 285 |
Assert.isNotNull(text); |
286 |
/* RAPModify |
|
276 | 287 |
// TODO figure out why getTextWidget() returns null! |
277 | 288 |
if (this.getTextWidget() == null) { |
278 | 289 |
return; |
279 | 290 |
} |
280 | 291 |
Assert.isNotNull(this.getTextWidget()); |
281 | 292 |
this.getTextWidget().setText(text); |
293 |
*/ |
|
294 |
getTextWidget().setText(text); |
|
282 | 295 |
} catch (RuntimeException e) { |
283 | 296 |
throw e; |
284 | 297 |
} |
285 | 298 |
} |
286 | 299 |
|
300 |
/* RAPAdded |
|
301 |
* |
|
302 |
*/ |
|
303 |
public TableItem getTextWidget() |
|
304 |
{ |
|
305 |
return getTable().getItem(0); |
|
306 |
} |
|
307 |
|
|
308 |
|
|
287 | 309 |
/** |
288 | 310 |
* <p>setMenu</p> |
289 | 311 |
* |
290 | 312 |
* @param menu a {@link org.eclipse.swt.widgets.Menu} object. |
291 | 313 |
*/ |
292 | 314 |
public void setMenu(Menu menu) { |
293 |
getRulerControl().setMenu(menu); |
|
294 |
getTextWidget().setMenu(menu); |
|
315 |
/*RAPExlude No Ruler |
|
316 |
* getRulerControl().setMenu(menu); |
|
317 |
*/ |
|
318 |
// getTextWidget().setMenu(menu); |
|
319 |
getControl().setMenu(menu); |
|
295 | 320 |
} |
296 | 321 |
|
297 | 322 |
/** |
298 | 323 |
* <p>setCursorToEOL</p> |
299 | 324 |
*/ |
325 |
/* RAPExclude @FIXME when Edit Functionality needed ? |
|
300 | 326 |
public void setCursorToEOL() { |
301 | 327 |
getTextWidget().setCaretOffset(getTextWidget().getText().length()); |
302 | 328 |
getTextWidget().setFocus(); |
303 | 329 |
} |
330 |
*/ |
|
304 | 331 |
|
305 | 332 |
|
306 | 333 |
/** |
... | ... | |
308 | 335 |
* |
309 | 336 |
* @return a int. |
310 | 337 |
*/ |
338 |
/* RAPExclude @FIXME when Edit Functionality needed ? |
|
311 | 339 |
public int getCursorPosition(){ |
312 | 340 |
return getTextWidget().getCaretOffset(); |
313 | 341 |
} |
314 |
|
|
342 |
*/ |
|
315 | 343 |
/** |
316 | 344 |
* <p>setCursorPosition</p> |
317 | 345 |
* |
318 | 346 |
* @param offset a int. |
319 | 347 |
*/ |
348 |
/* RAPExclude @FIXME when Edit Functionality needed ? |
|
320 | 349 |
public void setCursorPosition(int offset){ |
321 | 350 |
try{ |
322 | 351 |
getTextWidget().setCaretOffset(offset); |
... | ... | |
324 | 353 |
// do nothing |
325 | 354 |
} |
326 | 355 |
} |
327 |
|
|
356 |
*/ |
|
328 | 357 |
/** |
329 | 358 |
* <p>createUndoSupport</p> |
330 | 359 |
* |
331 | 360 |
* @param editorSite a {@link org.eclipse.ui.IEditorSite} object. |
332 | 361 |
*/ |
362 |
/* RAPExclude Currently NoUndo Support |
|
333 | 363 |
public void createUndoSupport(IEditorSite editorSite) { |
334 | 364 |
|
335 | 365 |
IUndoManager undoManager = new TextViewerUndoManager(25); |
... | ... | |
361 | 391 |
// actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction); |
362 | 392 |
// actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction); |
363 | 393 |
} |
364 |
|
|
394 |
*/ |
|
365 | 395 |
/** |
366 | 396 |
* <p>createUndoSupport_</p> |
367 | 397 |
* |
368 | 398 |
* @param editorSite a {@link org.eclipse.ui.IEditorSite} object. |
369 | 399 |
*/ |
400 |
/* RAPExclude NoUndoSupport |
|
370 | 401 |
public void createUndoSupport_(IEditorSite editorSite) { |
371 | 402 |
IUndoManager undoManager = new TextViewerUndoManager(25); |
372 | 403 |
this.setUndoManager(undoManager); |
... | ... | |
393 | 424 |
} |
394 | 425 |
} |
395 | 426 |
} |
427 |
*/ |
|
428 |
|
|
429 |
public void addFocusListener(FocusListener listener) |
|
430 |
{ |
|
431 |
getControl().addFocusListener(listener); |
|
432 |
} |
|
433 |
public void removeFocusListener(FocusListener listener) |
|
434 |
{ |
|
435 |
getControl().removeFocusListener(listener); |
|
436 |
} |
|
437 |
|
|
438 |
public void addMouseListener(MouseListener listener) |
|
439 |
{ |
|
440 |
getControl().addMouseListener(listener); |
|
441 |
} |
|
442 |
public void removeFocusListener(MouseListener listener) |
|
443 |
{ |
|
444 |
getControl().removeMouseListener(listener); |
|
445 |
} |
|
396 | 446 |
|
397 | 447 |
} |
398 | 448 |
|
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/concept/ConceptViewPart.java | ||
---|---|---|
51 | 51 |
showEmptyPage(); |
52 | 52 |
return; |
53 | 53 |
} |
54 |
|
|
54 |
|
|
55 |
/* RAPExclude BulkEditor not supported |
|
55 | 56 |
if(part instanceof BulkEditor){ |
56 | 57 |
showEmptyPage(); |
57 | 58 |
return; |
58 | 59 |
} |
59 |
|
|
60 |
*/ |
|
60 | 61 |
if(part instanceof AbstractGraphKeyEditor){ |
61 | 62 |
showEmptyPage(); |
62 | 63 |
return; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/descriptive/DescriptiveViewPart.java | ||
---|---|---|
154 | 154 |
showEmptyPage(); |
155 | 155 |
return; |
156 | 156 |
} |
157 |
|
|
157 |
|
|
158 |
/* RAPExclude BulkEditor not supported |
|
158 | 159 |
if(part instanceof BulkEditor){ |
159 | 160 |
showEmptyPage(); |
160 | 161 |
return; |
161 | 162 |
} |
162 |
|
|
163 |
*/ |
|
163 | 164 |
if(part instanceof AbstractGraphKeyEditor){ |
164 | 165 |
showEmptyPage(); |
165 | 166 |
return; |
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/media/MediaViewPart.java | ||
---|---|---|
102 | 102 |
showViewer(part, new StructuredSelection(input)); |
103 | 103 |
} |
104 | 104 |
|
105 |
/* RAPExclude BulkEditor not supported |
|
105 | 106 |
if(part instanceof BulkEditor && selection instanceof IStructuredSelection){ |
106 | 107 |
showViewer(part, (IStructuredSelection) selection); |
107 | 108 |
} |
109 |
*/ |
|
108 | 110 |
} |
109 | 111 |
|
110 | 112 |
/** {@inheritDoc} */ |
eu.etaxonomy.taxeditor.editor/src/test/java/eu/etaxonomy/taxeditor/editor/ApplicationWorkbenchAdvisor.java | ||
---|---|---|
46 | 46 |
ImageDescriptor desc = ImageDescriptor.createFromURL(url); |
47 | 47 |
configurer_p.declareImage(symbolicName, desc, shared); |
48 | 48 |
} |
49 |
|
|
49 |
/* RAPExclude Not needed ? |
|
50 | 50 |
public IAdaptable getDefaultPageInput() { |
51 | 51 |
IWorkspace workspace = ResourcesPlugin.getWorkspace(); |
52 | 52 |
return workspace.getRoot(); |
53 | 53 |
} |
54 |
|
|
54 |
*/ |
|
55 | 55 |
} |
eu.etaxonomy.taxeditor.navigation/META-INF/MANIFEST.MF | ||
---|---|---|
20 | 20 |
eu.etaxonomy.taxeditor.store, |
21 | 21 |
eu.etaxonomy.taxeditor.cdmlib;bundle-version="3.0.0", |
22 | 22 |
org.eclipse.core.expressions;resolution:=optional, |
23 |
eu.etaxonomy.taxeditor.editor;bundle-version="3.0.0";resolution:=optional
|
|
23 |
eu.etaxonomy.taxeditor.editor;bundle-version="3.0.0" |
|
24 | 24 |
Bundle-ActivationPolicy: lazy |
25 | 25 |
Import-Package: org.eclipse.core.runtime, |
26 | 26 |
org.eclipse.core.runtime.jobs, |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/internal/TaxeditorNavigationPlugin.java | ||
---|---|---|
36 | 36 |
public void start(BundleContext context) throws Exception { |
37 | 37 |
super.start(context); |
38 | 38 |
|
39 |
/* RAPExclude
|
|
39 |
/* RAPExclude Moved to Entity
|
|
40 | 40 |
NavigatorStateManager stateManager = new NavigatorStateManager(); |
41 | 41 |
CdmStore.getContextManager().addContextListener(stateManager); |
42 | 42 |
*/ |
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/handler/NewTaxonNodeHandler.java | ||
---|---|---|
36 | 36 |
*/ |
37 | 37 |
/** {@inheritDoc} */ |
38 | 38 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
39 |
/* RAPInclude */ |
|
39 |
/* RAPInclude Display */
|
|
40 | 40 |
final Display display = Display.getDefault(); |
41 | 41 |
|
42 | 42 |
NewTaxonNodeWizard wizard = new NewTaxonNodeWizard(); |
eu.etaxonomy.taxeditor.store/META-INF/MANIFEST.MF | ||
---|---|---|
54 | 54 |
eu.etaxonomy.taxeditor.view.detail, |
55 | 55 |
eu.etaxonomy.taxeditor.view.supplementaldata, |
56 | 56 |
eu.etaxonomy.taxeditor.view.user |
57 |
Require-Bundle: org.eclipse.rap.ui;bundle-version="1.4.0";resolution:=optional, |
|
57 |
Require-Bundle: org.eclipse.osgi, |
|
58 |
org.eclipse.rap.ui;bundle-version="1.4.0";resolution:=optional, |
|
58 | 59 |
org.eclipse.rap.ui.forms;bundle-version="1.4.0", |
59 |
org.eclipse.rap.ui.navigator;bundle-version="1.4.0", |
|
60 |
org.eclipse.rap.ui.views;bundle-version="1.4.0", |
|
61 | 60 |
eu.etaxonomy.taxeditor.cdmlib;bundle-version="3.0.0", |
62 |
org.eclipse.osgi, |
|
63 | 61 |
org.eclipse.jface.text;resolution:=optional, |
64 | 62 |
org.eclipse.pde.runtime;resolution:=optional, |
65 | 63 |
org.eclipse.ui.forms;bundle-version="3.5.0";resolution:=optional |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java | ||
---|---|---|
431 | 431 |
"There is no operation history for this context"); |
432 | 432 |
} |
433 | 433 |
|
434 |
// RAPModify final IAdaptable uiInfoAdapter = WorkspaceUndoUtil.getUIInfoAdapter(getShell()); |
|
434 |
/* RAPModify WorkspaceUndoUtil not available in RAP |
|
435 |
final IAdaptable uiInfoAdapter = WorkspaceUndoUtil.getUIInfoAdapter(getShell()); |
|
436 |
*/ |
|
435 | 437 |
final IAdaptable uiInfoAdapter = null; |
436 | 438 |
|
437 | 439 |
IRunnableWithProgress runnable = new IRunnableWithProgress() { |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/ImageElement.java | ||
---|---|---|
66 | 66 |
container = new Composite(getLayoutComposite(), style); |
67 | 67 |
container.setLayoutData(CdmFormFactory.FILL(2, 1)); |
68 | 68 |
|
69 |
/* RAPRemove: FIXME addPaintlistener obviously deprecated and not used anymore
|
|
69 |
/* RAPExclude: FIXME addPaintlistener not used in RAP anymore. Needs some Replacement to show images
|
|
70 | 70 |
container.addPaintListener(this); |
71 | 71 |
*/ |
72 | 72 |
} |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/forms/TextWithLabelElement.java | ||
---|---|---|
165 | 165 |
*/ |
166 | 166 |
/** {@inheritDoc} */ |
167 | 167 |
public void modifyText(ModifyEvent e) { |
168 |
//RAPExclude firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e)); |
|
169 | 168 |
firePropertyChangeEvent(new CdmPropertyChangeEvent(this, e)); |
170 | 169 |
} |
171 | 170 |
|
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/ImageFileElement.java | ||
---|---|---|
19 | 19 |
import org.eclipse.swt.events.SelectionListener; |
20 | 20 |
import org.eclipse.ui.PlatformUI; |
21 | 21 |
|
22 |
import eu.etaxonomy.cdm.api.service.IMediaService;
|
|
22 |
import eu.etaxonomy.cdm.common.media.ImageInfo;
|
|
23 | 23 |
import eu.etaxonomy.cdm.model.media.ImageFile; |
24 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
25 | 24 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
26 | 25 |
import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection; |
27 | 26 |
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory; |
... | ... | |
91 | 90 |
showImage(entity.getUri()); |
92 | 91 |
} |
93 | 92 |
|
93 |
/* RAPExclude replaced by new Implementation from trunk |
|
94 | 94 |
private void showImage(URI uri){ |
95 | 95 |
if(uri == null){ |
96 | 96 |
return; |
97 | 97 |
} |
98 |
/* RAPRemove: FIXME Reimplemented in trunk |
|
98 |
|
|
99 | 99 |
try { |
100 |
|
|
100 |
// RAP Obviously reimplemented in trunk |
|
101 | 101 |
Integer size = CdmStore.getService(IMediaService.class).getImageSize(uri, 10000); |
102 | 102 |
|
103 | 103 |
if(size != null){ |
... | ... | |
120 | 120 |
|
121 | 121 |
element_image.setImageUri(uri); |
122 | 122 |
|
123 |
element_image.loadImage(new Runnable(){ |
|
124 |
public void run() { |
|
125 |
StoreUtil.reflowDetailsViewer(); |
|
126 |
StoreUtil.reflowSupplementalViewer(); |
|
127 |
} |
|
128 |
}); |
|
129 |
// RAP Obviously reimplemented in trunk |
|
130 |
} catch (IOException e) { |
|
131 |
StoreUtil.error(getClass(), e); |
|
132 |
} |
|
133 |
} catch (Exception e) { |
|
134 |
StoreUtil.error(getClass(), "Image could not be shown: ", e); |
|
135 |
} |
|
136 |
} |
|
137 |
*/ |
|
138 |
private void showImage(URI uri){ |
|
139 |
if(uri == null){ |
|
140 |
return; |
|
141 |
} |
|
142 |
try { |
|
143 |
|
|
144 |
try { |
|
145 |
|
|
146 |
ImageInfo imageInfo = ImageInfo.NewInstanceWithMetaData(uri, 10000); |
|
147 |
|
|
148 |
text_size.setText(FileUtils.byteCountToDisplaySize(imageInfo.getLength())); |
|
149 |
// KLUDGE this is not save for very large files. I don't think we will handle such large files in the near future |
|
150 |
getEntity().setSize((int) imageInfo.getLength()); |
|
151 |
|
|
152 |
text_height.setInteger(imageInfo.getHeight()); |
|
153 |
getEntity().setHeight(imageInfo.getHeight()); |
|
154 |
|
|
155 |
text_width.setInteger(imageInfo.getWidth()); |
|
156 |
getEntity().setWidth(imageInfo.getWidth()); |
|
157 |
element_keyValue.setInput(imageInfo.getMetaData()); |
|
158 |
|
|
159 |
element_image.setImageUri(uri); |
|
160 |
|
|
123 | 161 |
element_image.loadImage(new Runnable(){ |
124 | 162 |
public void run() { |
125 | 163 |
StoreUtil.reflowDetailsViewer(); |
... | ... | |
133 | 171 |
} catch (Exception e) { |
134 | 172 |
StoreUtil.error(getClass(), "Image could not be shown: ", e); |
135 | 173 |
} |
136 |
*/ |
|
137 | 174 |
} |
175 |
|
|
138 | 176 |
|
139 | 177 |
/* |
140 | 178 |
* (non-Javadoc) |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/media/MediaRepresentationElement.java | ||
---|---|---|
14 | 14 |
import java.net.URI; |
15 | 15 |
import java.util.Collection; |
16 | 16 |
|
17 |
import org.apache.commons.lang.StringUtils; |
|
18 | 17 |
import org.apache.http.HttpException; |
19 | 18 |
import org.eclipse.swt.events.SelectionListener; |
20 | 19 |
|
21 |
import eu.etaxonomy.cdm.api.service.IMediaService; |
|
20 |
|
|
21 |
import eu.etaxonomy.cdm.common.media.ImageInfo; |
|
22 | 22 |
import eu.etaxonomy.cdm.model.media.ImageFile; |
23 | 23 |
import eu.etaxonomy.cdm.model.media.MediaRepresentation; |
24 | 24 |
import eu.etaxonomy.cdm.model.media.MediaRepresentationPart; |
25 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
|
26 | 25 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
27 | 26 |
import eu.etaxonomy.taxeditor.ui.forms.AbstractFormSection; |
28 | 27 |
import eu.etaxonomy.taxeditor.ui.forms.CdmFormFactory; |
... | ... | |
86 | 85 |
* @see eu.etaxonomy.taxeditor.section.AbstractEntityCollectionElement#handleEvent(java.lang.Object) |
87 | 86 |
*/ |
88 | 87 |
/** {@inheritDoc} */ |
88 |
/* RAPExclude: Replace by new Implementation in trunk |
|
89 | 89 |
@Override |
90 | 90 |
public void handleEvent(Object eventSource) { |
91 | 91 |
if(eventSource == text_mimeType){ |
... | ... | |
108 | 108 |
if(uri == null){ |
109 | 109 |
return; |
110 | 110 |
} |
111 |
/* RAPRemove: FIXME Obviously reimplemented in trunk
|
|
111 |
// RAPRemove: FIXME Obviously reimplemented in trunk
|
|
112 | 112 |
try { |
113 | 113 |
|
114 | 114 |
ImageMetaData imageInfo = CdmStore.getService(IMediaService.class).getImageInfo(uri, 10000); |
... | ... | |
119 | 119 |
} catch (HttpException e) { |
120 | 120 |
StoreUtil.error(getClass(), e); |
121 | 121 |
} |
122 |
*/
|
|
122 |
// RAPRemove: FIXME Obviously reimplemented in trunk
|
|
123 | 123 |
|
124 | 124 |
String path = uri.getPath(); |
125 | 125 |
|
... | ... | |
127 | 127 |
text_suffix.setText(suffix); |
128 | 128 |
} |
129 | 129 |
} |
130 |
*/ |
|
131 |
@Override |
|
132 |
public void handleEvent(Object eventSource) { |
|
133 |
if(eventSource == text_mimeType){ |
|
134 |
getEntity().setMimeType(text_mimeType.getText()); |
|
135 |
} |
|
136 |
else if(eventSource == text_suffix){ |
|
137 |
getEntity().setSuffix(text_suffix.getText()); |
|
138 |
} |
|
139 |
// FIXME HACK automatically set the mime type to the first mediaRepresentationPart's mimetype |
|
140 |
else if(eventSource == section_mediaRepresentationPart){ |
|
141 |
Collection<MediaRepresentationPart> imageFileElements = section_mediaRepresentationPart.getCollection(section_mediaRepresentationPart.getEntity()); |
|
142 |
|
|
143 |
MediaRepresentationPart mediaRepresentationPart = imageFileElements.iterator().next(); |
|
144 |
if(mediaRepresentationPart == null || !(mediaRepresentationPart instanceof ImageFile)){ |
|
145 |
return; |
|
146 |
} |
|
147 |
ImageFile imageFile = (ImageFile) mediaRepresentationPart; |
|
148 |
|
|
149 |
URI uri = imageFile.getUri(); |
|
150 |
if(uri == null){ |
|
151 |
return; |
|
152 |
} |
|
153 |
try { |
|
154 |
ImageInfo imageInfo = ImageInfo.NewInstance(uri, 10000); |
|
155 |
String mimeType = imageInfo.getMimeType(); |
|
156 |
text_mimeType.setText(mimeType); |
|
157 |
text_suffix.setText(imageInfo.getSuffix()); |
|
158 |
} catch (IOException e) { |
|
159 |
StoreUtil.error(getClass(), e); |
|
160 |
} catch (HttpException e) { |
|
161 |
StoreUtil.error(getClass(), e); |
|
162 |
} |
|
163 |
} |
|
164 |
} |
|
130 | 165 |
|
131 | 166 |
private String getMimeType(URI uri){ |
132 | 167 |
return null; |
Also available in: Unified diff
Läuft mit Media Daten, zeigt nur keine Bilder