Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java39
1 files changed, 0 insertions, 39 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java
index dc5eb7dcaa3..058ff3b924c 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/part/UMLDiagramEditor.java
@@ -78,7 +78,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
public static final String CONTEXT_ID = "org.eclipse.papyrus.uml.diagram.profile.ui.diagramContext"; //$NON-NLS-1$
-
/**
* @generated
*/
@@ -109,17 +108,13 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
public UMLDiagramEditor(ServicesRegistry servicesRegistry, Diagram diagram) throws ServiceException {
super(servicesRegistry, diagram);
-
// adds a listener to the palette service, which reacts to palette customizations
PapyrusPaletteService.getInstance().addProviderChangeListener(this);
-
// Share the same editing provider
editingDomain = servicesRegistry.getService(TransactionalEditingDomain.class);
documentProvider = new GmfMultiDiagramDocumentProvider(editingDomain);
-
// overrides editing domain created by super constructor
setDocumentProvider(documentProvider);
-
}
/**
@@ -158,7 +153,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
return UMLDiagramEditorPlugin.ID;
}
-
/**
* @generated
*/
@@ -231,12 +225,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
return new ShowInContext(getEditorInput(), getNavigatorSelection());
}
-
/**
* @generated
*/
private ISelection getNavigatorSelection() {
- IDiagramDocument document = getDiagramDocument();
return StructuredSelection.EMPTY;
}
@@ -250,8 +242,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
getSite().registerContextMenu(ActionIds.DIAGRAM_EDITOR_CONTEXT_MENU, provider, getDiagramGraphicalViewer());
}
-
-
/**
* @generated
*/
@@ -299,7 +289,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
dirtyState.dispose();
dirtyState = null;
}
-
super.setUndoContext(context);
}
@@ -327,12 +316,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
// remove palette service listener
// remove preference listener
PapyrusPaletteService.getInstance().removeProviderChangeListener(this);
-
if(dirtyState != null) {
dirtyState.dispose();
dirtyState = null;
}
-
super.dispose();
}
@@ -343,8 +330,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
return getEditDomain().getPaletteViewer();
}
-
-
/**
* @generated
*/
@@ -368,13 +353,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
protected void configurePaletteViewer(PaletteViewer viewer) {
super.configurePaletteViewer(viewer);
-
// customize menu...
viewer.setContextMenu(new PapyrusPaletteContextMenuProvider(viewer));
-
viewer.getKeyHandler().setParent(getPaletteKeyHandler());
viewer.getControl().addMouseListener(getPaletteMouseListener());
-
// Add a transfer drag target listener that is supported on
// palette template entries whose template is a creation tool.
// This will enable drag and drop of the palette shape creation
@@ -395,9 +377,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Key Handler for the palette
*/
private KeyHandler getPaletteKeyHandler() {
-
if(paletteKeyHandler == null) {
-
paletteKeyHandler = new KeyHandler() {
/**
@@ -411,27 +391,18 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return <code>true</code> if KeyEvent was handled in some way
*/
public boolean keyReleased(KeyEvent event) {
-
if(event.keyCode == SWT.Selection) {
-
Tool tool = getPaletteViewer().getActiveTool().createTool();
-
if(toolSupportsAccessibility(tool)) {
-
tool.keyUp(event, getDiagramGraphicalViewer());
-
// deactivate current selection
getPaletteViewer().setActiveTool(null);
-
return true;
}
-
}
return super.keyReleased(event);
}
-
};
-
}
return paletteKeyHandler;
}
@@ -440,9 +411,7 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
* @return Palette Mouse listener for the palette
*/
private MouseListener getPaletteMouseListener() {
-
if(paletteMouseListener == null) {
-
paletteMouseListener = new MouseListener() {
/**
@@ -459,13 +428,10 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
*/
public void mouseDoubleClick(MouseEvent e) {
Tool tool = getPaletteViewer().getActiveTool().createTool();
-
if(toolSupportsAccessibility(tool)) {
-
tool.setViewer(getDiagramGraphicalViewer());
tool.setEditDomain(getDiagramGraphicalViewer().getEditDomain());
tool.mouseDoubleClick(e, getDiagramGraphicalViewer());
-
// Current active tool should be deactivated,
// but if it is down here it will get
// reactivated deep in GEF palette code after
@@ -485,14 +451,11 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
getPaletteViewer().setActiveTool(null);
clearActiveTool = false;
}
-
}
};
-
}
return paletteMouseListener;
}
-
};
}
@@ -510,7 +473,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
@Override
protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
-
// Enable Drop
getDiagramGraphicalViewer().addDropTargetListener(new DropTargetListener(getDiagramGraphicalViewer(), LocalSelectionTransfer.getTransfer()) {
@@ -525,7 +487,6 @@ public class UMLDiagramEditor extends UmlGmfDiagramEditor implements IProviderCh
return getEditingDomain();
}
});
-
}
/**

Back to the top