[jbosstools-commits] JBoss Tools SVN: r17680 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui: select and 1 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Sep 21 09:30:56 EDT 2009


Author: scabanovich
Date: 2009-09-21 09:30:56 -0400 (Mon, 21 Sep 2009)
New Revision: 17680

Added:
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/ModelNavigatorActionGroup.java
Removed:
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/StrutsNavigatorActionGroup.java
Modified:
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
   trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4913
Minor changes to remove 'jsf' and 'struts' names.

Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java (from rev 16771, trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/ModelContributionManager.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.model.ui.action;
+
+import java.util.*;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.viewers.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.actions.ActionContext;
+import org.jboss.tools.common.model.XModelObject;
+
+public class ModelContributionManager extends MenuManager {
+	ActionContext context;
+	Shell shell;
+	
+	public ModelContributionManager(Shell shell) {
+		super("JBoss Tools");
+		this.shell = shell;
+	}
+	
+	public void setContext(ActionContext context) {
+		this.context = context;
+	}
+	
+	protected void update(boolean force, boolean recursive) {
+		if (isDirty() || force) {
+			if (getMenu() != null && !getMenu().isDisposed()) {
+				Menu menu = getMenu();
+				MenuItem[] is = menu.getItems();
+				for (int i = 0; i < is.length; i++) is[i].dispose();
+				XModelObject[] os = getSelectedModelObjects();
+				if(os.length == 0) return;
+				XModelObject o = os[0];
+				if(os.length == 1) os = null;
+				XModelObjectActionList l = new XModelObjectActionList(o.getModelEntity().getActionList(), o, os, new Object[]{o});
+				l.setShell(shell);
+				l.createMenu(menu);
+				l.removeLastSeparator(menu);
+			}
+		}
+	}
+	
+	public XModelObject[] getSelectedModelObjects() {
+		ISelection s = context.getSelection();
+		if(s.isEmpty() || !(s instanceof StructuredSelection)) return new XModelObject[0];
+		StructuredSelection ss = (StructuredSelection)s;
+		Iterator it = ss.iterator();
+		ArrayList<XModelObject> l = new ArrayList<XModelObject>();
+		while(it.hasNext()) {
+			IAdaptable a = (IAdaptable)it.next();
+			XModelObject o = (XModelObject)a.getAdapter(XModelObject.class);
+			if(o != null) l.add(o);
+		}
+		return l.toArray(new XModelObject[0]); 
+	}
+	
+}

Deleted: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java	2009-09-21 12:41:16 UTC (rev 17679)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/StrutsContributionManager.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.model.ui.action;
-
-import java.util.*;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.actions.ActionContext;
-import org.jboss.tools.common.model.XModelObject;
-
-public class StrutsContributionManager extends MenuManager {
-	ActionContext context;
-	Shell shell;
-	
-	public StrutsContributionManager(Shell shell) {
-		super("JBoss Tools Struts");
-		this.shell = shell;
-	}
-	
-	public void setContext(ActionContext context) {
-		this.context = context;
-	}
-	
-	protected void update(boolean force, boolean recursive) {
-		if (isDirty() || force) {
-			if (getMenu() != null && !getMenu().isDisposed()) {
-				Menu menu = getMenu();
-				MenuItem[] is = menu.getItems();
-				for (int i = 0; i < is.length; i++) is[i].dispose();
-				XModelObject[] os = getSelectedModelObjects();
-				if(os.length == 0) return;
-				XModelObject o = os[0];
-				if(os.length == 1) os = null;
-				XModelObjectActionList l = new XModelObjectActionList(o.getModelEntity().getActionList(), o, os, new Object[]{o});
-				l.setShell(shell);
-				l.createMenu(menu);
-				l.removeLastSeparator(menu);
-			}
-		}
-	}
-	
-	public XModelObject[] getSelectedModelObjects() {
-		ISelection s = context.getSelection();
-		if(s.isEmpty() || !(s instanceof StructuredSelection)) return new XModelObject[0];
-		StructuredSelection ss = (StructuredSelection)s;
-		Iterator it = ss.iterator();
-		ArrayList<XModelObject> l = new ArrayList<XModelObject>();
-		while(it.hasNext()) {
-			IAdaptable a = (IAdaptable)it.next();
-			XModelObject o = (XModelObject)a.getAdapter(XModelObject.class);
-			if(o != null) l.add(o);
-		}
-		return l.toArray(new XModelObject[0]); 
-	}
-	
-}

Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java	2009-09-21 12:41:16 UTC (rev 17679)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -88,9 +88,6 @@
 	
 	String[] views = new String[]{
 		"org.jboss.tools.jst.web.ui.navigator.WebProjectsView" //$NON-NLS-1$
-//		"org.jboss.tools.jsf.ui.navigator.JsfProjectsView",
-//		"org.jboss.tools.struts.ui.navigator.StrutsProjectsView",
-//		"org.jboss.tools.common.model.ui.navigator.NavigatorViewPart"
 	};
 
 	private XModelObject selectInNavigator() {

Copied: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/ModelNavigatorActionGroup.java (from rev 16771, trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/StrutsNavigatorActionGroup.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/ModelNavigatorActionGroup.java	                        (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/ModelNavigatorActionGroup.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -0,0 +1,169 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/ 
+package org.jboss.tools.common.model.ui.views.navigator;
+
+import org.jboss.tools.common.model.ui.action.ModelContributionManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
+//import org.eclipse.jface.util.IPropertyChangeListener;
+//import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.actions.ActionContext;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.AddBookmarkAction;
+import org.eclipse.ui.actions.AddTaskAction;
+import org.eclipse.ui.actions.WorkingSetFilterActionGroup;
+import org.eclipse.ui.dialogs.PropertyDialogAction;
+import org.eclipse.ui.ide.IDEActionFactory;
+import org.eclipse.ui.views.navigator.*;
+
+public class ModelNavigatorActionGroup extends ResourceNavigatorActionGroup {
+
+	protected AddBookmarkAction addBookmarkAction;
+	protected AddTaskAction addTaskAction;	
+	protected PropertyDialogAction propertyDialogAction;
+	protected CollapseAllAction collapseAllAction;
+	protected ToggleLinkingAction toggleLinkingAction;
+	
+	protected OpenActionGroup openGroup;
+	protected NRefactorActionGroup refactorGroup;
+	protected WorkingSetFilterActionGroup workingSetGroup;
+	protected WorkspaceActionGroup workspaceGroup;
+	
+	protected ModelContributionManager mcm;
+	protected boolean activateModelContribution = false;
+
+	/**
+	 * Constructs the main action group.
+	 */
+	public ModelNavigatorActionGroup(IResourceNavigator navigator) {
+		super(navigator);
+		makeSubGroups();
+	}
+
+	/**
+	 * Makes the actions contained directly in this action group.
+	 */
+	protected void makeActions() {
+		Shell shell = navigator.getSite().getShell();
+		
+		if(activateModelContribution) {
+			mcm = new ModelContributionManager(shell);
+		}
+		
+		addBookmarkAction = new AddBookmarkAction(shell);
+		addTaskAction = new AddTaskAction(shell);		
+		propertyDialogAction =
+			new PropertyDialogAction(navigator.getSite(), navigator.getViewer());
+		
+		collapseAllAction = new CollapseAllAction(navigator, "Collapse All");
+		collapseAllAction.setToolTipText("Collapse All");
+		collapseAllAction.setImageDescriptor(getImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
+
+		toggleLinkingAction = new ToggleLinkingAction(
+			navigator, "Link with Editor");
+		toggleLinkingAction.setToolTipText("Link with Editor");
+		toggleLinkingAction.setImageDescriptor(getImageDescriptor("elcl16/synced.gif"));//$NON-NLS-1$
+	}
+	
+	/**
+	 * Makes the sub action groups.
+	 */
+	protected void makeSubGroups() {
+		openGroup = new OpenActionGroup(navigator);
+		refactorGroup = new NRefactorActionGroup(navigator);
+		workspaceGroup = new WorkspaceActionGroup(navigator);
+	}
+	
+	/**
+	 * Extends the superclass implementation to set the context in the subgroups.
+	 */
+	public void setContext(ActionContext context) {
+		super.setContext(context);
+		openGroup.setContext(context);
+		refactorGroup.setContext(context);
+		workspaceGroup.setContext(context);
+		if(mcm != null) mcm.setContext(context);
+	}
+	
+	/**
+	 * Adds the actions in this group and its subgroups to the action bars.
+	 */
+	public void fillActionBars(IActionBars actionBars) {
+		actionBars.setGlobalActionHandler(
+				ActionFactory.PROPERTIES.getId(),
+			propertyDialogAction);
+		actionBars.setGlobalActionHandler(
+				IDEActionFactory.BOOKMARK.getId(),
+			addBookmarkAction);
+		actionBars.setGlobalActionHandler(
+				IDEActionFactory.ADD_TASK.getId(),
+			addTaskAction);
+		openGroup.fillActionBars(actionBars);
+		refactorGroup.fillActionBars(actionBars);
+		workspaceGroup.fillActionBars(actionBars);
+
+		IToolBarManager toolBar = actionBars.getToolBarManager();
+		toolBar.add(new Separator());
+		toolBar.add(collapseAllAction);		
+		toolBar.add(toggleLinkingAction);
+	}
+	
+	/**
+	 * Updates the actions which were added to the action bars,
+	 * delegating to the subgroups as necessary.
+	 */
+	public void updateActionBars() {
+		IStructuredSelection selection =
+			(IStructuredSelection) getContext().getSelection();
+		propertyDialogAction.setEnabled(selection.size() == 1);
+		addBookmarkAction.selectionChanged(selection);
+		addTaskAction.selectionChanged(selection);
+		
+		openGroup.updateActionBars();
+		refactorGroup.updateActionBars();
+		workspaceGroup.updateActionBars();
+		if(mcm != null) mcm.markDirty();
+		if(mcm != null) mcm.update(true);
+	} 
+	
+	/**
+	 * Runs the default action (open file) by delegating the open group.
+	 */
+	public void runDefaultAction(IStructuredSelection selection) {
+		openGroup.runDefaultAction(selection);
+	}
+	
+	/**
+	 * Handles a key pressed event by invoking the appropriate action,
+	 * delegating to the subgroups as necessary.
+	 */
+	public void handleKeyPressed(KeyEvent event) {
+		refactorGroup.handleKeyPressed(event);
+		workspaceGroup.handleKeyPressed(event);
+	}
+	
+	/**
+	 * Extends the superclass implementation to dispose the subgroups.
+	 */
+	public void dispose() {
+		openGroup.dispose();
+		refactorGroup.dispose();
+		workspaceGroup.dispose();
+		if(mcm != null) mcm.dispose();
+		super.dispose();
+	}
+	
+	
+}

Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java	2009-09-21 12:41:16 UTC (rev 17679)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/NavigatorViewPart.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -104,7 +104,7 @@
 	private NavigatorStatusLineProvider statusLineProvider = new NavigatorStatusLineProvider();
 	private ActivationListener fActivationListener= new ActivationListener();
 	
-	boolean useStrutsMenu = true;
+	boolean useModelMenu = true;
 	
 	public NavigatorViewPart() {
 		selectionProvider.addSelectionChangedListener(new SL());
@@ -167,8 +167,6 @@
 	
 	protected String[] getActionClasses() {
 		String[] actions = new String[]{
-			"org.jboss.tools.struts.ui.internal.action.CreateProjectAction", //$NON-NLS-1$
-			"org.jboss.tools.struts.ui.internal.action.ImportProjectAction"        			 //$NON-NLS-1$
 		};
 		return actions;
 	}
@@ -246,7 +244,7 @@
 //@S_CHECK@
   		TreeViewerMenuInvoker listener = createMenuInvoker();
 		listener.setViewer(viewer);
-		if(useStrutsMenu) {
+		if(useModelMenu) {
 			viewer.getTree().addMouseListener(listener);
 		}
 	}
@@ -453,7 +451,7 @@
 	}
 	
 	protected void makeActions() {
-		setActionGroup(new StrutsNavigatorActionGroup(this));
+		setActionGroup(new ModelNavigatorActionGroup(this));
 	}
 	
 	ResourceNavigatorActionGroup actionGroup;
@@ -486,7 +484,7 @@
 				fillContextMenu(manager);
 			}
 		});
-		if(!useStrutsMenu) {
+		if(!useModelMenu) {
 			TreeViewer treeViewer = getViewer();
 			Menu menu = menuMgr.createContextMenu(treeViewer.getTree());
 			treeViewer.getTree().setMenu(menu);
@@ -530,11 +528,11 @@
 	};
 	
 	private void saveLinkingEnabled(IMemento _memento) {
-		_memento.putInteger("LinkStrutsProjectsToEditor", isLinkingEnabled ? 1 : 0); //$NON-NLS-1$
+		_memento.putInteger("LinkModelProjectsToEditor", isLinkingEnabled ? 1 : 0); //$NON-NLS-1$
 	}
 	
 	private void restoreLinkingEnabled() {
-		Integer val = memento.getInteger("LinkStrutsProjectsToEditor");//IWorkbenchPreferenceConstants.LINK_NAVIGATOR_TO_EDITOR); //$NON-NLS-1$
+		Integer val = memento.getInteger("LinkModelProjectsToEditor");//IWorkbenchPreferenceConstants.LINK_NAVIGATOR_TO_EDITOR); //$NON-NLS-1$
 		if (val != null) {
 			isLinkingEnabled = val.intValue() != 0;
 		}

Deleted: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/StrutsNavigatorActionGroup.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/StrutsNavigatorActionGroup.java	2009-09-21 12:41:16 UTC (rev 17679)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/navigator/StrutsNavigatorActionGroup.java	2009-09-21 13:30:56 UTC (rev 17680)
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/ 
-package org.jboss.tools.common.model.ui.views.navigator;
-
-import org.jboss.tools.common.model.ui.action.StrutsContributionManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.Separator;
-//import org.eclipse.jface.util.IPropertyChangeListener;
-//import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.actions.AddBookmarkAction;
-import org.eclipse.ui.actions.AddTaskAction;
-import org.eclipse.ui.actions.WorkingSetFilterActionGroup;
-import org.eclipse.ui.dialogs.PropertyDialogAction;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.views.navigator.*;
-
-public class StrutsNavigatorActionGroup extends ResourceNavigatorActionGroup {
-
-	protected AddBookmarkAction addBookmarkAction;
-	protected AddTaskAction addTaskAction;	
-	protected PropertyDialogAction propertyDialogAction;
-	protected CollapseAllAction collapseAllAction;
-	protected ToggleLinkingAction toggleLinkingAction;
-	
-	protected OpenActionGroup openGroup;
-	protected NRefactorActionGroup refactorGroup;
-	protected WorkingSetFilterActionGroup workingSetGroup;
-	protected WorkspaceActionGroup workspaceGroup;
-	
-	protected StrutsContributionManager struts;
-	protected boolean activateStrutsContribution = false;
-
-	/**
-	 * Constructs the main action group.
-	 */
-	public StrutsNavigatorActionGroup(IResourceNavigator navigator) {
-		super(navigator);
-		makeSubGroups();
-	}
-
-	/**
-	 * Makes the actions contained directly in this action group.
-	 */
-	protected void makeActions() {
-		Shell shell = navigator.getSite().getShell();
-		
-		if(activateStrutsContribution) {
-			struts = new StrutsContributionManager(shell);
-		}
-		
-		addBookmarkAction = new AddBookmarkAction(shell);
-		addTaskAction = new AddTaskAction(shell);		
-		propertyDialogAction =
-			new PropertyDialogAction(navigator.getSite(), navigator.getViewer());
-		
-		collapseAllAction = new CollapseAllAction(navigator, "Collapse All");
-		collapseAllAction.setToolTipText("Collapse All");
-		collapseAllAction.setImageDescriptor(getImageDescriptor("elcl16/collapseall.gif")); //$NON-NLS-1$
-
-		toggleLinkingAction = new ToggleLinkingAction(
-			navigator, "Link with Editor");
-		toggleLinkingAction.setToolTipText("Link with Editor");
-		toggleLinkingAction.setImageDescriptor(getImageDescriptor("elcl16/synced.gif"));//$NON-NLS-1$
-	}
-	
-	/**
-	 * Makes the sub action groups.
-	 */
-	protected void makeSubGroups() {
-		openGroup = new OpenActionGroup(navigator);
-		refactorGroup = new NRefactorActionGroup(navigator);
-		workspaceGroup = new WorkspaceActionGroup(navigator);
-	}
-	
-	/**
-	 * Extends the superclass implementation to set the context in the subgroups.
-	 */
-	public void setContext(ActionContext context) {
-		super.setContext(context);
-		openGroup.setContext(context);
-		refactorGroup.setContext(context);
-		workspaceGroup.setContext(context);
-		if(struts != null) struts.setContext(context);
-	}
-	
-	/**
-	 * Adds the actions in this group and its subgroups to the action bars.
-	 */
-	public void fillActionBars(IActionBars actionBars) {
-		actionBars.setGlobalActionHandler(
-				ActionFactory.PROPERTIES.getId(),
-			propertyDialogAction);
-		actionBars.setGlobalActionHandler(
-				IDEActionFactory.BOOKMARK.getId(),
-			addBookmarkAction);
-		actionBars.setGlobalActionHandler(
-				IDEActionFactory.ADD_TASK.getId(),
-			addTaskAction);
-		openGroup.fillActionBars(actionBars);
-		refactorGroup.fillActionBars(actionBars);
-		workspaceGroup.fillActionBars(actionBars);
-
-		IToolBarManager toolBar = actionBars.getToolBarManager();
-		toolBar.add(new Separator());
-		toolBar.add(collapseAllAction);		
-		toolBar.add(toggleLinkingAction);
-	}
-	
-	/**
-	 * Updates the actions which were added to the action bars,
-	 * delegating to the subgroups as necessary.
-	 */
-	public void updateActionBars() {
-		IStructuredSelection selection =
-			(IStructuredSelection) getContext().getSelection();
-		propertyDialogAction.setEnabled(selection.size() == 1);
-		addBookmarkAction.selectionChanged(selection);
-		addTaskAction.selectionChanged(selection);
-		
-		openGroup.updateActionBars();
-		refactorGroup.updateActionBars();
-		workspaceGroup.updateActionBars();
-		if(struts != null) struts.markDirty();
-		if(struts != null) struts.update(true);
-	} 
-	
-	/**
-	 * Runs the default action (open file) by delegating the open group.
-	 */
-	public void runDefaultAction(IStructuredSelection selection) {
-		openGroup.runDefaultAction(selection);
-	}
-	
-	/**
-	 * Handles a key pressed event by invoking the appropriate action,
-	 * delegating to the subgroups as necessary.
-	 */
-	public void handleKeyPressed(KeyEvent event) {
-		refactorGroup.handleKeyPressed(event);
-		workspaceGroup.handleKeyPressed(event);
-	}
-	
-	/**
-	 * Extends the superclass implementation to dispose the subgroups.
-	 */
-	public void dispose() {
-		openGroup.dispose();
-		refactorGroup.dispose();
-		workspaceGroup.dispose();
-		if(struts != null) struts.dispose();
-		super.dispose();
-	}
-	
-	
-}



More information about the jbosstools-commits mailing list