1 11 package org.eclipse.debug.internal.ui.views.expression; 12 13 14 import org.eclipse.debug.core.DebugPlugin; 15 import org.eclipse.debug.internal.ui.IDebugHelpContextIds; 16 import org.eclipse.debug.internal.ui.preferences.IDebugPreferenceConstants; 17 import org.eclipse.debug.internal.ui.views.variables.AvailableLogicalStructuresAction; 18 import org.eclipse.debug.internal.ui.views.variables.VariablesView; 19 import org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages; 20 import org.eclipse.debug.internal.ui.views.variables.details.AvailableDetailPanesAction; 21 import org.eclipse.debug.ui.IDebugUIConstants; 22 import org.eclipse.jface.action.IAction; 23 import org.eclipse.jface.action.IMenuManager; 24 import org.eclipse.jface.action.IToolBarManager; 25 import org.eclipse.jface.action.Separator; 26 import org.eclipse.jface.viewers.ISelection; 27 import org.eclipse.swt.SWT; 28 import org.eclipse.ui.IWorkbenchActionConstants; 29 30 34 public class ExpressionView extends VariablesView { 35 36 39 protected String getHelpContextId() { 40 return IDebugHelpContextIds.EXPRESSION_VIEW; 41 } 42 43 46 protected void setInitialContent() { 47 getViewer().setInput(DebugPlugin.getDefault().getExpressionManager()); 48 } 49 50 55 protected void configureToolBar(IToolBarManager tbm) { 56 super.configureToolBar(tbm); 57 tbm.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP)); 58 tbm.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP)); 59 } 60 61 67 protected void fillContextMenu(IMenuManager menu) { 68 69 menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP)); 70 menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP)); 71 menu.add(getAction(VARIABLES_FIND_ELEMENT_ACTION)); 72 menu.add(getAction("ChangeVariableValue")); menu.add(new Separator()); 74 IAction action = new AvailableLogicalStructuresAction(this); 75 if (action.isEnabled()) { 76 menu.add(action); 77 } 78 action = new AvailableDetailPanesAction(this); 79 if (isDetailPaneVisible() && action.isEnabled()) { 80 menu.add(action); 81 } 82 menu.add(new Separator(IDebugUIConstants.EMPTY_RENDER_GROUP)); 83 menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); 84 } 85 86 protected void contextActivated(ISelection selection) { 87 if (!isVisible()) { 88 return; 89 } 90 updateAction("ContentAssist"); updateAction(VARIABLES_FIND_ELEMENT_ACTION); 93 updateAction(FIND_ACTION); 94 } 95 96 99 protected String getDetailPanePreferenceKey() { 100 return IDebugPreferenceConstants.EXPRESSIONS_DETAIL_PANE_ORIENTATION; 101 } 102 103 106 protected String getToggleActionLabel() { 107 return VariablesViewMessages.ExpressionView_4; 108 } 109 110 113 protected void becomesVisible() { 114 setInitialContent(); 115 super.becomesVisible(); 116 } 117 118 121 protected int getViewerStyle() { 122 return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL; 123 } 124 125 128 protected String getPresentationContextId() { 129 return IDebugUIConstants.ID_EXPRESSION_VIEW; 130 } 131 132 133 } 134 | Popular Tags |