Author: mareshkau
Date: 2010-09-21 02:59:19 -0400 (Tue, 21 Sep 2010)
New Revision: 25042
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
Log:
JBIDE-7059,selection bar menu visabilty has been adjusted
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-21
05:24:55 UTC (rev 25041)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/selection/bar/SelectionBar.java 2010-09-21
06:59:19 UTC (rev 25042)
@@ -16,12 +16,9 @@
import org.eclipse.compare.Splitter;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.CommandEvent;
-import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.ICommandListener;
import org.eclipse.core.commands.IStateListener;
import org.eclipse.core.commands.State;
-import org.eclipse.core.commands.contexts.ContextManagerEvent;
-import org.eclipse.core.commands.contexts.IContextManagerListener;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.swt.SWT;
@@ -54,14 +51,11 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.internal.IWorkbenchGraphicConstants;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.messages.JstUIMessages;
import org.jboss.tools.jst.jsp.selection.SelectionHelper;
import org.jboss.tools.jst.jsp.selection.SourceSelection;
@@ -100,6 +94,7 @@
private StructuredTextEditor textEditor;
//Selection Bar State
private State toggleSelBarState;
+ private Command toggleSelBarCommand;
public SelectionBar(StructuredTextEditor textEditor) {
super();
@@ -109,13 +104,12 @@
ICommandService commandService =
(ICommandService) PlatformUI.getWorkbench()
.getService(ICommandService.class);
- toggleSelBarState= commandService.getCommand(
- "org.jboss.tools.jst.jsp.commands.showSelectionBar") //$NON-NLS-1$
+ this.toggleSelBarCommand = commandService.getCommand(
+ "org.jboss.tools.jst.jsp.commands.showSelectionBar"); //$NON-NLS-1$
+ toggleSelBarState= toggleSelBarCommand
.getState("org.eclipse.ui.commands.toggleState"); //$NON-NLS-1$
toggleSelBarState.addListener(this);
- commandService.getCommand(
- "org.jboss.tools.jst.jsp.commands.showSelectionBar"). //$NON-NLS-1$
- addCommandListener(this);
+ toggleSelBarCommand.addCommandListener(this);
}
/**
@@ -496,6 +490,7 @@
public void dispose() {
removeNodeListenerFromAllNodes();
+ toggleSelBarCommand.removeCommandListener(this);
if(textEditor.getTextViewer()!=null)
textEditor.getTextViewer().removeSelectionChangedListener(this);
toggleSelBarState.removeListener(this);
Show replies by date