/** * Creates a <code>NavigationAction</code> that initializes its attributes * from the given <code>ResourceBundle</code>. * * @param bundle is used to initialize the action * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference. */ public NavigationAction(ResourceBundle bundle, boolean next) { Utilities.initAction(this, bundle, next ? "action.Next." : "action.Previous."); //$NON-NLS-2$ //$NON-NLS-1$ fNext= next; }
/** * Creates a <code>NavigationAction</code> that initializes its attributes * from the given <code>ResourceBundle</code>. * * @param bundle is used to initialize the action * @param next if <code>true</code> action goes to the next difference; otherwise to the previous difference. */ public NavigationAction(ResourceBundle bundle, boolean next) { Utilities.initAction(this, bundle, next ? "action.Next." : "action.Previous."); //$NON-NLS-2$ //$NON-NLS-1$ fNext= next; }
public ChangePropertyAction(ResourceBundle bundle, CompareConfiguration cc, String rkey, String pkey) { fPropertyKey= pkey; fBundle= bundle; fPrefix= rkey; Utilities.initAction(this, fBundle, fPrefix); setCompareConfiguration(cc); }
public ChangePropertyAction(ResourceBundle bundle, CompareConfiguration cc, String rkey, String pkey) { fPropertyKey= pkey; fBundle= bundle; fPrefix= rkey; Utilities.initAction(this, fBundle, fPrefix); setCompareConfiguration(cc); }
SaveAction(boolean left) { super(true, false, false); Utilities.initAction(this, getResourceBundle(), "action.save."); //$NON-NLS-1$ }
Utilities.initAction(fExpandAllAction, fBundle, "action.ExpandAll."); //$NON-NLS-1$
Utilities.initAction(fExpandAllAction, fBundle, "action.ExpandAll."); //$NON-NLS-1$
public IAction getAction(String actionId) { IAction action= (IAction) fActions.get(actionId); if (action == null) { action= createAction(actionId); if (action == null) return null; if (action instanceof MergeViewerAction) { MergeViewerAction mva = (MergeViewerAction) action; if (mva.isContentDependent()) addTextListener(this); if (mva.isSelectionDependent()) addSelectionChangedListener(this); Utilities.initAction(action, fResourceBundle, "action." + actionId + "."); //$NON-NLS-1$ //$NON-NLS-2$ } addAction(actionId, action); } if (action instanceof MergeViewerAction) { MergeViewerAction mva = (MergeViewerAction) action; if (mva.isEditableDependent() && !isEditable()) return null; } return action; }
@Override protected void fillContextMenu(IMenuManager manager) { if (fOpenAction == null) { fOpenAction= new Action() { @Override public void run() { handleOpen(null); } }; Utilities.initAction(fOpenAction, getBundle(), "action.CompareContents."); //$NON-NLS-1$ } boolean enable= false; ISelection selection= getSelection(); if (selection instanceof IStructuredSelection) { IStructuredSelection ss= (IStructuredSelection)selection; if (ss.size() == 1) { Object element= ss.getFirstElement(); if (element instanceof MyDiffNode) { ITypedElement te= ((MyDiffNode) element).getId(); if (te != null) enable= !ITypedElement.FOLDER_TYPE.equals(te.getType()); } else enable= true; } } fOpenAction.setEnabled(enable); manager.add(fOpenAction); super.fillContextMenu(manager); } };
public IAction getAction(String actionId) { IAction action= fActions.get(actionId); if (action == null) { action= createAction(actionId); if (action == null) return null; if (action instanceof MergeViewerAction) { MergeViewerAction mva = (MergeViewerAction) action; if (mva.isContentDependent()) getSourceViewer().addTextListener(this); if (mva.isSelectionDependent()) getSourceViewer().addSelectionChangedListener(this); Utilities.initAction(action, fResourceBundle, "action." + actionId + "."); //$NON-NLS-1$ //$NON-NLS-2$ } addAction(actionId, action); } if (action instanceof MergeViewerAction) { MergeViewerAction mva = (MergeViewerAction) action; if (mva.isEditableDependent() && !getSourceViewer().isEditable()) return null; } return action; }
public ChangeCompareFilterPropertyAction( CompareFilterDescriptor compareFilterDescriptor, CompareConfiguration compareConfiguration) { this.fBundle = compareFilterDescriptor.getResourceBundle(); this.fCompareFilterDescriptor = compareFilterDescriptor; this.fCompareFilter = compareFilterDescriptor.createCompareFilter(); Utilities.initAction(this, fBundle, fPrefix); // Utilities only loads images from compare plugin setImageDescriptor(compareFilterDescriptor.getImageDescriptor()); setId(compareFilterDescriptor.getFilterId()); setActionDefinitionId(compareFilterDescriptor.getDefinitionId()); setCompareConfiguration(compareConfiguration); if (fCompareFilter.isEnabledInitially()) { setChecked(true); setProperty(true); } }
Utilities.initAction(ignoreAncestorAction, getResourceBundle(), ignoreAncestorActionKey); Utilities.initToggleAction(ignoreAncestorAction, getResourceBundle(), ignoreAncestorActionKey, isIgnoreAncestor()); Utilities.initAction(a, getResourceBundle(), "action.NextDiff."); //$NON-NLS-1$ fNextDiff= new ActionContributionItem(a); tbm.appendToGroup("navigation", fNextDiff); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.PrevDiff."); //$NON-NLS-1$ fPreviousDiff= new ActionContributionItem(a); tbm.appendToGroup("navigation", fPreviousDiff); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.NextChange."); //$NON-NLS-1$ fNextChange= new ActionContributionItem(a); tbm.appendToGroup("navigation", fNextChange); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.PrevChange."); //$NON-NLS-1$ fPreviousChange= new ActionContributionItem(a); tbm.appendToGroup("navigation", fPreviousChange); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.CopyDiffLeftToRight."); //$NON-NLS-1$ fCopyDiffLeftToRightItem= new ActionContributionItem(a); fCopyDiffLeftToRightItem.setVisible(true); Utilities.initAction(a, getResourceBundle(), "action.CopyDiffRightToLeft."); //$NON-NLS-1$ fCopyDiffRightToLeftItem= new ActionContributionItem(a); fCopyDiffRightToLeftItem.setVisible(true);
Utilities.initAction(copyLeftToRightItem.getAction(), getResourceBundle(), "action.CopyLeftToRight."); //$NON-NLS-1$ tbm.appendToGroup("merge", copyLeftToRightItem); //$NON-NLS-1$ fHandlerService.registerAction(copyLeftToRightItem.getAction(), "org.eclipse.compare.copyAllLeftToRight"); //$NON-NLS-1$ Utilities.initAction(copyRightToLeftItem.getAction(), getResourceBundle(), "action.CopyRightToLeft."); //$NON-NLS-1$ tbm.appendToGroup("merge", copyRightToLeftItem); //$NON-NLS-1$ fHandlerService.registerAction(copyRightToLeftItem.getAction(), "org.eclipse.compare.copyAllRightToLeft"); //$NON-NLS-1$ Utilities.initAction(fSwitchLeftAndRight, getResourceBundle(), "action.SwitchLeftAndRight."); //$NON-NLS-1$ tbm.appendToGroup("modes", fSwitchLeftAndRight); //$NON-NLS-1$
Utilities.initAction(ignoreAncestorAction, getResourceBundle(), ignoreAncestorActionKey); Utilities.initToggleAction(ignoreAncestorAction, getResourceBundle(), ignoreAncestorActionKey, isIgnoreAncestor()); Utilities.initAction(a, getResourceBundle(), "action.NextDiff."); //$NON-NLS-1$ fNextDiff= new ActionContributionItem(a); tbm.appendToGroup("navigation", fNextDiff); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.PrevDiff."); //$NON-NLS-1$ fPreviousDiff= new ActionContributionItem(a); tbm.appendToGroup("navigation", fPreviousDiff); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.NextChange."); //$NON-NLS-1$ fNextChange= new ActionContributionItem(a); tbm.appendToGroup("navigation", fNextChange); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.PrevChange."); //$NON-NLS-1$ fPreviousChange= new ActionContributionItem(a); tbm.appendToGroup("navigation", fPreviousChange); //$NON-NLS-1$ Utilities.initAction(a, getResourceBundle(), "action.CopyDiffLeftToRight."); //$NON-NLS-1$ fCopyDiffLeftToRightItem= new ActionContributionItem(a); fCopyDiffLeftToRightItem.setVisible(isRightEditable()); Utilities.initAction(a, getResourceBundle(), "action.CopyDiffRightToLeft."); //$NON-NLS-1$ fCopyDiffRightToLeftItem= new ActionContributionItem(a); fCopyDiffRightToLeftItem.setVisible(isLeftEditable());
Utilities.initAction(fCopyLeftToRightAction, getResourceBundle(), "action.CopyLeftToRight."); //$NON-NLS-1$ tbm.appendToGroup("merge", fCopyLeftToRightAction); //$NON-NLS-1$ fHandlerService.registerAction(fCopyLeftToRightAction, "org.eclipse.compare.copyAllLeftToRight"); //$NON-NLS-1$ Utilities.initAction(fCopyRightToLeftAction, getResourceBundle(), "action.CopyRightToLeft."); //$NON-NLS-1$ tbm.appendToGroup("merge", fCopyRightToLeftAction); //$NON-NLS-1$ fHandlerService.registerAction(fCopyRightToLeftAction, "org.eclipse.compare.copyAllRightToLeft"); //$NON-NLS-1$