|
From: Christopher W. <caw...@us...> - 2006-03-30 03:03:43
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29442/src/org/rubypeople/rdt/internal/ui/actions Modified Files: ActionMessages.java ActionMessages.properties Added Files: CompositeActionGroup.java LexicalSortingAction.java Log Message: Index: ActionMessages.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ActionMessages.java 28 Mar 2006 23:15:47 -0000 1.2 --- ActionMessages.java 30 Mar 2006 03:03:38 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- public static String ActionUtil_notOnBuildPath_title; public static String ActionUtil_notOnBuildPath_message; + public static String OpenWithMenu_label; static { --- NEW FILE: LexicalSortingAction.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are 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: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.actions; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.ui.PlatformUI; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPlugin; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.internal.ui.browsing.RubyBrowsingMessages; import org.rubypeople.rdt.internal.ui.viewsupport.SourcePositionSorter; import org.rubypeople.rdt.ui.RubyElementSorter; /* * XXX: This class should become part of the MemberFilterActionGroup * which should be renamed to MemberActionsGroup */ public class LexicalSortingAction extends Action { private RubyElementSorter fSorter= new RubyElementSorter(); private SourcePositionSorter fSourcePositonSorter= new SourcePositionSorter(); private StructuredViewer fViewer; private String fPreferenceKey; public LexicalSortingAction(StructuredViewer viewer, String id) { super(); fViewer= viewer; fPreferenceKey= "LexicalSortingAction." + id + ".isChecked"; //$NON-NLS-1$ //$NON-NLS-2$ setText(RubyBrowsingMessages.LexicalSortingAction_label); RubyPluginImages.setLocalImageDescriptors(this, "alphab_sort_co.gif"); //$NON-NLS-1$ setToolTipText(RubyBrowsingMessages.LexicalSortingAction_tooltip); setDescription(RubyBrowsingMessages.LexicalSortingAction_description); boolean checked= RubyPlugin.getDefault().getPreferenceStore().getBoolean(fPreferenceKey); valueChanged(checked, false); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.LEXICAL_SORTING_BROWSING_ACTION); } public void run() { valueChanged(isChecked(), true); } private void valueChanged(final boolean on, boolean store) { setChecked(on); BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() { public void run() { if (on) fViewer.setSorter(fSorter); else fViewer.setSorter(fSourcePositonSorter); } }); if (store) RubyPlugin.getDefault().getPreferenceStore().setValue(fPreferenceKey, on); } } Index: ActionMessages.properties =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/actions/ActionMessages.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ActionMessages.properties 24 Feb 2006 20:01:58 -0000 1.2 --- ActionMessages.properties 30 Mar 2006 03:03:38 -0000 1.3 *************** *** 11,14 **** --- 11,26 ---- ############################################################################### + OpenWithMenu_label=Open Wit&h + + OpenAction_label=&Open + OpenAction_tooltip=Open an Editor on the Selected Element + OpenAction_description=Open an editor on the selected element + OpenAction_declaration_label=&Open Declaration + OpenAction_select_element=&Select or enter the element to open: + + OpenAction_error_message=Cannot open default editor. + OpenAction_error_messageArgs=Cannot open default editor on {0}. {1} + OpenAction_error_messageProblems=Problems Opening Editor + MemberFilterActionGroup_hide_fields_label=Hide Fiel&ds MemberFilterActionGroup_hide_fields_tooltip=Hide Fields *************** *** 31,32 **** --- 43,46 ---- ToggleLinkingAction_description=Link with active editor + ActionUtil_notOnBuildPath_title=Cannot Perform Operation + ActionUtil_notOnBuildPath_message=The resource is not on the build path of a Ruby project. --- NEW FILE: CompositeActionGroup.java --- /******************************************************************************* * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are 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: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.rubypeople.rdt.internal.ui.actions; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.util.Assert; import org.eclipse.ui.IActionBars; import org.eclipse.ui.actions.ActionContext; import org.eclipse.ui.actions.ActionGroup; public class CompositeActionGroup extends ActionGroup { private ActionGroup[] fGroups; public CompositeActionGroup() { } public CompositeActionGroup(ActionGroup[] groups) { setGroups(groups); } protected void setGroups(ActionGroup[] groups) { Assert.isTrue(fGroups == null); Assert.isNotNull(groups); fGroups= groups; } public ActionGroup get(int index) { if (fGroups == null) return null; return fGroups[index]; } public void addGroup(ActionGroup group) { if (fGroups == null) { fGroups= new ActionGroup[] { group }; } else { ActionGroup[] newGroups= new ActionGroup[fGroups.length + 1]; System.arraycopy(fGroups, 0, newGroups, 0, fGroups.length); newGroups[fGroups.length]= group; fGroups= newGroups; } } public void dispose() { super.dispose(); if (fGroups == null) return; for (int i= 0; i < fGroups.length; i++) { fGroups[i].dispose(); } } public void fillActionBars(IActionBars actionBars) { super.fillActionBars(actionBars); if (fGroups == null) return; for (int i= 0; i < fGroups.length; i++) { fGroups[i].fillActionBars(actionBars); } } public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); if (fGroups == null) return; for (int i= 0; i < fGroups.length; i++) { fGroups[i].fillContextMenu(menu); } } public void setContext(ActionContext context) { super.setContext(context); if (fGroups == null) return; for (int i= 0; i < fGroups.length; i++) { fGroups[i].setContext(context); } } public void updateActionBars() { super.updateActionBars(); if (fGroups == null) return; for (int i= 0; i < fGroups.length; i++) { fGroups[i].updateActionBars(); } } } |