Author: DartPeng
Date: 2009-05-05 03:25:52 -0400 (Tue, 05 May 2009)
New Revision: 15016
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
Log:
JBIDE-4260
disable some useless actions.
change the position of some menu items
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-04
21:03:52 UTC (rev 15015)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksActionBarContributor.java 2009-05-05
07:25:52 UTC (rev 15016)
@@ -18,7 +18,6 @@
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.ui.action.ControlAction;
import org.eclipse.emf.edit.ui.action.CopyAction;
import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
import org.eclipse.emf.edit.ui.action.CutAction;
@@ -216,7 +215,7 @@
super(ADDITIONS_LAST_STYLE);
// loadResourceAction = new LoadResourceAction();
validateAction = new ValidateAction();
- controlAction = new ControlAction();
+// controlAction = new ControlAction();
}
protected void addMapNode() {
@@ -575,7 +574,25 @@
*/
@Override
public void menuAboutToShow(IMenuManager menuManager) {
- super.menuAboutToShow(menuManager);
+ menuManager.add(new Separator("edit"));
+ menuManager.add(new ActionContributionItem(undoAction));
+ menuManager.add(new ActionContributionItem(redoAction));
+ menuManager.add(new Separator());
+ menuManager.add(new ActionContributionItem(deleteAction));
+ menuManager.add(new Separator());
+ menuManager.add(new ActionContributionItem(cutAction));
+ menuManager.add(new ActionContributionItem(copyAction));
+ menuManager.add(new ActionContributionItem(pasteAction));
+ menuManager.add(new Separator());
+
+// if ((style & ADDITIONS_LAST_STYLE) != 0)
+// {
+// menuManager.add(new Separator("additions"));
+// menuManager.add(new Separator());
+// }
+ // Add our other standard marker.
+ //
+ menuManager.add(new Separator("additions-end"));
MenuManager submenuManager = null;
updateRootElementAddAction();
@@ -603,6 +620,10 @@
submenuManager = new MenuManager("Create Sibling");
populateManager(submenuManager, createSiblingActions, null);
menuManager.insertBefore("edit", submenuManager);
+ // don't show properties that
+// menuManager.insertAfter("additions-end", showPropertiesViewAction);
+ menuManager.insertAfter("additions-end", validateAction);
+ this.addGlobalActions(menuManager);
}
private boolean isSmooksResourceListElement() {
@@ -791,13 +812,13 @@
*/
@Override
protected void addGlobalActions(IMenuManager menuManager) {
- menuManager.insertAfter("additions-end", new
Separator("ui-actions"));
- menuManager.insertAfter("ui-actions", showPropertiesViewAction);
+// menuManager.insertAfter("additions-end", new
Separator("ui-actions"));
+// menuManager.insertAfter("additions-end", showPropertiesViewAction);
- refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
- menuManager.insertAfter("ui-actions", refreshViewerAction);
+// refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
+// menuManager.insertAfter("ui-actions", refreshViewerAction);
- super.addGlobalActions(menuManager);
+// super.addGlobalActions(menuManager);
}
/**
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-05-04
21:03:52 UTC (rev 15015)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-05-05
07:25:52 UTC (rev 15016)
@@ -29,7 +29,6 @@
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
@@ -262,15 +261,15 @@
}
private void createMenuForViewer(TreeViewer smooksTreeViewer2) {
- MenuManager contextMenu = new MenuManager("#PopUp");
- contextMenu.add(new Separator("additions"));
+ MenuManager contextMenu = new MenuManager();
+// contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu = contextMenu.createContextMenu(smooksTreeViewer2.getControl());
smooksTreeViewer2.getControl().setMenu(menu);
- formEditor.getSite().registerContextMenu(contextMenu,
- new UnwrappingSelectionProvider(smooksTreeViewer2));
+// formEditor.getSite().registerContextMenu(contextMenu,
+// new UnwrappingSelectionProvider(smooksTreeViewer2));
}
public TreeViewer getSmooksTreeViewer() {
Show replies by date