Author: vyemialyanchyk
Date: 2009-12-10 08:52:03 -0500 (Thu, 10 Dec 2009)
New Revision: 19183
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5384 - fixed
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties 2009-12-10
12:47:46 UTC (rev 19182)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/DiagramViewerMessages.properties 2009-12-10
13:52:03 UTC (rev 19183)
@@ -47,5 +47,5 @@
Diagram_incorrect_state=incorrect Hibernate Console Configuration state.
Diagram_no_items_or_incorrect_state=no items or incorrect Hibernate Console Configuration
state.
OpenDiagramActionDelegate_could_not_load_configuration=Could not load configuration
-ConnectionRouterFanAction_select_fan_connection_router=Select fan connection router
-ConnectionRouterManhattanAction_select_manhattan_connection_router=Select manhattan
connection router
+ConnectionRouterFanAction_select_fan_connection_router=Show connections as straight
lines
+ConnectionRouterManhattanAction_select_manhattan_connection_router=Show connections as
routed
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java 2009-12-10
12:47:46 UTC (rev 19182)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramActionBarContributor.java 2009-12-10
13:52:03 UTC (rev 19183)
@@ -162,14 +162,14 @@
ConnectionRouterFanAction.img, IAction.AS_RADIO_BUTTON);
addRetargetAction(diagramAction);
//
- act = new Action[7];
+ act = new Action[4];
act[0] = (Action)getAction(TogglePropertyMappingAction.ACTION_ID);
act[1] = (Action)getAction(ToggleClassMappingAction.ACTION_ID);
act[2] = (Action)getAction(ToggleAssociationAction.ACTION_ID);
act[3] = (Action)getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
- act[4] = null;
- act[5] = (Action)getAction(ConnectionRouterManhattanAction.ACTION_ID);
- act[6] = (Action)getAction(ConnectionRouterFanAction.ACTION_ID);
+ //act[4] = null;
+ //act[5] = (Action)getAction(ConnectionRouterManhattanAction.ACTION_ID);
+ //act[6] = (Action)getAction(ConnectionRouterFanAction.ACTION_ID);
diagramToggleConnectionsAction.setMenuCreator(new ActionMenu(act));
//
//act = new Action[2];
@@ -244,6 +244,9 @@
viewMenu.add(getAction(GEFActionConstants.TOGGLE_RULER_VISIBILITY));
viewMenu.add(getAction(GEFActionConstants.TOGGLE_GRID_VISIBILITY));
viewMenu.add(getAction(GEFActionConstants.TOGGLE_SNAP_TO_GEOMETRY));
+ viewMenu.add(new Separator());
+ viewMenu.add(getAction(ConnectionRouterManhattanAction.ACTION_ID));
+ viewMenu.add(getAction(ConnectionRouterFanAction.ACTION_ID));
menubar.insertAfter(IWorkbenchActionConstants.M_EDIT, viewMenu);
}
}
\ No newline at end of file
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-12-10
12:47:46 UTC (rev 19182)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-12-10
13:52:03 UTC (rev 19183)
@@ -300,14 +300,14 @@
action = new LexicalSortingAction(this, null);
registry.registerAction(action);
- Action[] act = new Action[7];
+ Action[] act = new Action[4];
act[0] = (Action)registry.getAction(TogglePropertyMappingAction.ACTION_ID);
act[1] = (Action)registry.getAction(ToggleClassMappingAction.ACTION_ID);
act[2] = (Action)registry.getAction(ToggleAssociationAction.ACTION_ID);
act[3] = (Action)registry.getAction(ToggleForeignKeyConstraintAction.ACTION_ID);
- act[4] = null;
- act[5] = (Action)registry.getAction(ConnectionRouterManhattanAction.ACTION_ID);
- act[6] = (Action)registry.getAction(ConnectionRouterFanAction.ACTION_ID);
+ //act[4] = null;
+ //act[5] = (Action)registry.getAction(ConnectionRouterManhattanAction.ACTION_ID);
+ //act[6] = (Action)registry.getAction(ConnectionRouterFanAction.ACTION_ID);
actionToggleConnections.setMenuCreator(new ActionMenu(act));
//act = new Action[2];
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2009-12-10
12:47:46 UTC (rev 19182)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/popup/PopupMenuProvider.java 2009-12-10
13:52:03 UTC (rev 19183)
@@ -16,7 +16,6 @@
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.gef.ui.actions.ActionRegistry;
-import org.eclipse.gef.ui.actions.GEFActionConstants;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.Separator;
@@ -51,8 +50,13 @@
* @author Vitali Yemialyanchyk
*/
public class PopupMenuProvider extends ContextMenuProvider {
- private ActionRegistry actionRegistry;
+ public static final String GROUP_OPEN_SOURCE = "open_source";
//$NON-NLS-1$
+ public static final String GROUP_EDIT = "edit"; //$NON-NLS-1$
+ public static final String GROUP_ADDITIONAL_ACTIONS = "additional_actions";
//$NON-NLS-1$
+
+ private ActionRegistry actionRegistry;
+
public PopupMenuProvider(EditPartViewer viewer, ActionRegistry actionRegistry) {
super(viewer);
this.actionRegistry = actionRegistry;
@@ -61,10 +65,11 @@
@SuppressWarnings("unchecked")
public void buildContextMenu(IMenuManager menu) {
+ menu.add(new Separator(GROUP_OPEN_SOURCE));
+ menu.add(new Separator(GROUP_EDIT));
+ menu.add(new Separator(GROUP_ADDITIONAL_ACTIONS));
// Add standard action groups to the menu
- GEFActionConstants.addStandardActionGroups(menu);
-
- menu.add(new Separator(GEFActionConstants.MB_ADDITIONS));
+ //GEFActionConstants.addStandardActionGroups(menu);
IAction action = null;
if (getViewer().getSelection() instanceof StructuredSelection) {
Shape selectedShape = null;
@@ -88,11 +93,11 @@
|| first instanceof Table
|| first instanceof Column) {
action = getActionRegistry().getAction(OpenSourceAction.ACTION_ID);
- appendToGroup(GEFActionConstants.MB_ADDITIONS, action);
+ appendToGroup(GROUP_OPEN_SOURCE, action);
createMenuItem(getMenu(), action);
action = getActionRegistry().getAction(OpenMappingAction.ACTION_ID);
- appendToGroup(GEFActionConstants.MB_ADDITIONS, action);
+ appendToGroup(GROUP_OPEN_SOURCE, action);
createMenuItem(getMenu(), action);
}
}
@@ -120,34 +125,34 @@
}
if (addToggleVisibleStateMenu) {
action = getActionRegistry().getAction(ToggleShapeVisibleStateAction.ACTION_ID);
- appendToGroup(GEFActionConstants.GROUP_EDIT, action);
+ appendToGroup(GROUP_EDIT, action);
createMenuItem(getMenu(), action);
}
if (addToggleExpandStateMenu) {
action = getActionRegistry().getAction(ToggleShapeExpandStateAction.ACTION_ID);
- appendToGroup(GEFActionConstants.GROUP_EDIT, action);
+ appendToGroup(GROUP_EDIT, action);
createMenuItem(getMenu(), action);
}
}
action = getActionRegistry().getAction(ToggleConnectionsAction.ACTION_ID);
- appendToGroup(GEFActionConstants.GROUP_EDIT, action);
+ appendToGroup(GROUP_EDIT, action);
createMenuItem(getMenu(), action);
action = getActionRegistry().getAction(AutoLayoutAction.ACTION_ID);
- appendToGroup(GEFActionConstants.GROUP_VIEW, action);
+ appendToGroup(GROUP_ADDITIONAL_ACTIONS, action);
createMenuItem(getMenu(), action);
//action = getActionRegistry().getAction(CollapseAllAction.ACTION_ID);
- //appendToGroup(GEFActionConstants.GROUP_VIEW, action);
+ //appendToGroup(GROUP_EDIT, action);
//createMenuItem(getMenu(), action);
//action = getActionRegistry().getAction(ExpandAllAction.ACTION_ID);
- //appendToGroup(GEFActionConstants.GROUP_VIEW, action);
+ //appendToGroup(GROUP_EDIT, action);
//createMenuItem(getMenu(), action);
action = getActionRegistry().getAction(ExportImageAction.ACTION_ID);
- appendToGroup(GEFActionConstants.MB_ADDITIONS, action);
+ appendToGroup(GROUP_ADDITIONAL_ACTIONS, action);
createMenuItem(getMenu(), action);
// Add actions to the menu
@@ -161,7 +166,7 @@
getAction(ActionFactory.REDO.getId()));
/**/
menu.appendToGroup(
- GEFActionConstants.GROUP_VIEW, // target group id
+ GROUP_EDIT, // target group id
getAction(ActionFactory.SELECT_ALL.getId())); // action to add
}