protected void createActions() { super.createActions(); fOpenAction= new OpenAction(this); fOpenAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR); setAction(JdtActionConstants.OPEN, fOpenAction); }
@Override public void selectionChanged(ITextSelection selection) { setEnabled(checkEnabled(selection)); }
/** * Creates a new <code>OpenAction</code>. * * @param editor the Properties file editor which provides the context information for this action */ public OpenAction(PropertiesFileEditor editor) { super(editor.getEditorSite()); fEditor= editor; setText(PropertiesFileEditorMessages.OpenAction_label); setToolTipText(PropertiesFileEditorMessages.OpenAction_tooltip); setEnabled(PropertyKeyHyperlinkDetector.checkEnabled(fEditor, 0)); }
@Override public void run(ITextSelection selection) { if (!checkEnabled(selection)) return; IRegion region= new Region(selection.getOffset(), selection.getLength()); PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector(); detector.setContext(fEditor); IHyperlink[]hyperlinks= detector.detectHyperlinks(fEditor.internalGetSourceViewer(), region, false); if (hyperlinks != null && hyperlinks.length == 1) hyperlinks[0].open(); } }
public void run(ITextSelection selection) { if (!checkEnabled(selection)) return; IRegion region= new Region(selection.getOffset(), selection.getLength()); PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector(); detector.setContext(fEditor); IHyperlink[]hyperlinks= detector.detectHyperlinks(fEditor.internalGetSourceViewer(), region, false); if (hyperlinks != null && hyperlinks.length == 1) hyperlinks[0].open(); } }
/** * Creates a new <code>OpenAction</code>. * * @param editor the Properties file editor which provides the context information for this action */ public OpenAction(PropertiesFileEditor editor) { super(editor.getEditorSite()); fEditor= editor; setText(PropertiesFileEditorMessages.OpenAction_label); setToolTipText(PropertiesFileEditorMessages.OpenAction_tooltip); setEnabled(PropertyKeyHyperlinkDetector.checkEnabled(fEditor, 0)); }
@Override protected void createActions() { super.createActions(); IAction action= new ToggleCommentAction(PropertiesFileEditorMessages.getBundleForConstructedKeys(), "ToggleComment.", this); //$NON-NLS-1$ action.setActionDefinitionId(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT); setAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, action); markAsStateDependentAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, true); PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION); configureToggleCommentAction(); fOpenAction= new OpenAction(this); fOpenAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR); setAction(JdtActionConstants.OPEN, fOpenAction); }
@Override public void selectionChanged(ITextSelection selection) { setEnabled(checkEnabled(selection)); }
@Override public void run(ITextSelection selection) { if (!checkEnabled(selection)) return; IRegion region= new Region(selection.getOffset(), selection.getLength()); PropertyKeyHyperlinkDetector detector= new PropertyKeyHyperlinkDetector(); detector.setContext(fEditor); IHyperlink[]hyperlinks= detector.detectHyperlinks(fEditor.internalGetSourceViewer(), region, false); if (hyperlinks != null && hyperlinks.length == 1) hyperlinks[0].open(); } }
/** * Creates a new <code>OpenAction</code>. * * @param editor the Properties file editor which provides the context information for this action */ public OpenAction(PropertiesFileEditor editor) { super(editor.getEditorSite()); fEditor= editor; setText(PropertiesFileEditorMessages.OpenAction_label); setToolTipText(PropertiesFileEditorMessages.OpenAction_tooltip); // XXX: Must be removed once support for JARs is available (see class Javadoc for details). setEnabled(fEditor.getEditorInput() instanceof IFileEditorInput); }
@Override protected void createActions() { super.createActions(); IAction action= new ToggleCommentAction(PropertiesFileEditorMessages.getBundleForConstructedKeys(), "ToggleComment.", this); //$NON-NLS-1$ action.setActionDefinitionId(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT); setAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, action); markAsStateDependentAction(IJavaEditorActionDefinitionIds.TOGGLE_COMMENT, true); PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IJavaHelpContextIds.TOGGLE_COMMENT_ACTION); configureToggleCommentAction(); fOpenAction= new OpenAction(this); fOpenAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.OPEN_EDITOR); setAction(JdtActionConstants.OPEN, fOpenAction); }
public void selectionChanged(ITextSelection selection) { setEnabled(checkEnabled(selection)); }