|
From: <caw...@us...> - 2007-09-12 18:03:22
|
Revision: 3155
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3155&view=rev
Author: cawilliams
Date: 2007-09-12 11:03:19 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
replace references to Ruby Resources View with references to new Ruby Explorer view
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RdtActionConstants.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyExplorerViewAction.java
Removed Paths:
-------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyResourcesViewAction.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.properties 2007-09-12 17:53:36 UTC (rev 3154)
+++ trunk/org.rubypeople.rdt.ui/plugin.properties 2007-09-12 18:03:19 UTC (rev 3155)
@@ -67,7 +67,6 @@
commentHover=Ruby RDoc comment hover
PerspectiveRuby.name=Ruby
-ViewRubyResources.name=Ruby Resources
NewWizardCategory.name=Ruby
NewWizardRubyProject.name=Ruby Project
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-09-12 17:53:36 UTC (rev 3154)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/rubyeditor/RubyEditor.java 2007-09-12 18:03:19 UTC (rev 3155)
@@ -134,7 +134,7 @@
import org.rubypeople.rdt.ui.actions.OpenViewActionGroup;
import org.rubypeople.rdt.ui.actions.RubyActionGroup;
import org.rubypeople.rdt.ui.actions.RubySearchActionGroup;
-import org.rubypeople.rdt.ui.actions.ShowInRubyResourcesViewAction;
+import org.rubypeople.rdt.ui.actions.ShowInRubyExplorerViewAction;
import org.rubypeople.rdt.ui.actions.SurroundWithBeginRescueAction;
import org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProvider;
import org.rubypeople.rdt.ui.text.folding.IRubyFoldingStructureProviderExtension;
@@ -279,7 +279,7 @@
WorkbenchHelp.setHelp(action, IRubyHelpContextIds.TOGGLE_COMMENT_ACTION);
configureToggleCommentAction();
- action= new ShowInRubyResourcesViewAction(this);
+ action= new ShowInRubyExplorerViewAction(this);
action.setActionDefinitionId(IRubyEditorActionDefinitionIds.SHOW_IN_RUBY_RESOURCES_VIEW);
setAction("ShowInPackageView", action); //$NON-NLS-1$
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RdtActionConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RdtActionConstants.java 2007-09-12 17:53:36 UTC (rev 3154)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/RdtActionConstants.java 2007-09-12 18:03:19 UTC (rev 3155)
@@ -114,10 +114,4 @@
* (value <code>"org.rubypeople.rdt.ui.actions.WriteAccessInWorkingSet"</code>).
*/
public static final String FIND_WRITE_ACCESS_IN_WORKING_SET= "org.rubypeople.rdt.ui.actions.WriteAccessInWorkingSet"; //$NON-NLS-1$
-
- /**
- * Navigate menu: name of standard Show in Ruby Resources View global action
- * (value <code>"org.rubypeople.rdt.ui.actions.ShowInRubyResourcesView"</code>).
- */
- public static final String SHOW_IN_RESOURCES_VIEW= "org.rubypeople.rdt.ui.actions.ShowInRubyResourcesView"; //$NON-NLS-1$
}
Copied: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyExplorerViewAction.java (from rev 3149, trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyResourcesViewAction.java)
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyExplorerViewAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyExplorerViewAction.java 2007-09-12 18:03:19 UTC (rev 3155)
@@ -0,0 +1,130 @@
+/*******************************************************************************
+ * 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.ui.actions;
+
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.text.ITextSelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.IWorkbenchSite;
+import org.eclipse.ui.PlatformUI;
+import org.rubypeople.rdt.core.IOpenable;
+import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.RubyModelException;
+import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
+import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.internal.ui.actions.SelectionConverter;
+import org.rubypeople.rdt.internal.ui.packageview.PackageExplorerPart;
+import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
+/**
+ * This action reveals the currently selected Ruby element in the
+ * package explorer.
+ * <p>
+ * The action is applicable to selections containing elements of type
+ * <code>IRubyElement</code>.
+ *
+ * <p>
+ * This class may be instantiated; it is not intended to be subclassed.
+ * </p>
+ * @since 2.0
+ */
+public class ShowInRubyExplorerViewAction extends SelectionDispatchAction {
+
+ private RubyEditor fEditor;
+
+ /**
+ * Creates a new <code>ShowInPackageViewAction</code>. The action requires
+ * that the selection provided by the site's selection provider is of type
+ * <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
+ *
+ * @param site the site providing context information for this action
+ */
+ public ShowInRubyExplorerViewAction(IWorkbenchSite site) {
+ super(site);
+ setText(ActionMessages.ShowInPackageViewAction_label);
+ setDescription(ActionMessages.ShowInPackageViewAction_description);
+ setToolTipText(ActionMessages.ShowInPackageViewAction_tooltip);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION);
+ }
+
+ /**
+ * Note: This constructor is for internal use only. Clients should not call this constructor.
+ * @param editor the Ruby editor
+ */
+ public ShowInRubyExplorerViewAction(RubyEditor editor) {
+ this(editor.getEditorSite());
+ fEditor= editor;
+ setEnabled(SelectionConverter.canOperateOn(fEditor));
+ }
+
+ /* (non-Javadoc)
+ * Method declared on SelectionDispatchAction.
+ */
+ public void selectionChanged(ITextSelection selection) {
+ }
+
+ /* (non-Javadoc)
+ * Method declared on SelectionDispatchAction.
+ */
+ public void selectionChanged(IStructuredSelection selection) {
+ setEnabled(checkEnabled(selection));
+ }
+
+ private boolean checkEnabled(IStructuredSelection selection) {
+ if (selection.size() != 1)
+ return false;
+ return selection.getFirstElement() instanceof IRubyElement;
+ }
+
+ /* (non-Javadoc)
+ * Method declared on SelectionDispatchAction.
+ */
+ public void run(ITextSelection selection) {
+ try {
+ IRubyElement element= SelectionConverter.getElementAtOffset(fEditor);
+ if (element != null)
+ run(element);
+ } catch (RubyModelException e) {
+ RubyPlugin.log(e);
+ String message= ActionMessages.ShowInPackageViewAction_error_message;
+ ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus());
+ }
+ }
+
+ /* (non-Javadoc)
+ * Method declared on SelectionDispatchAction.
+ */
+ public void run(IStructuredSelection selection) {
+ if (!checkEnabled(selection))
+ return;
+ run((IRubyElement)selection.getFirstElement());
+ }
+
+ /*
+ * No Rubydoc. The method should be internal but can't be changed since
+ * we shipped it with a public visibility
+ */
+ public void run(IRubyElement element) {
+ if (element == null)
+ return;
+
+ // reveal the top most element only
+ IOpenable openable= element.getOpenable();
+ if (openable instanceof IRubyElement)
+ element= (IRubyElement)openable;
+
+ PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
+ view.tryToReveal(element);
+ }
+
+ private static String getDialogTitle() {
+ return ActionMessages.ShowInPackageViewAction_dialog_title;
+ }
+}
Deleted: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyResourcesViewAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyResourcesViewAction.java 2007-09-12 17:53:36 UTC (rev 3154)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/actions/ShowInRubyResourcesViewAction.java 2007-09-12 18:03:19 UTC (rev 3155)
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * 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.ui.actions;
-
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchSite;
-import org.eclipse.ui.PlatformUI;
-import org.rubypeople.rdt.core.IOpenable;
-import org.rubypeople.rdt.core.IRubyElement;
-import org.rubypeople.rdt.core.RubyModelException;
-import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
-import org.rubypeople.rdt.internal.ui.RubyPlugin;
-import org.rubypeople.rdt.internal.ui.actions.SelectionConverter;
-import org.rubypeople.rdt.internal.ui.packageview.PackageExplorerPart;
-import org.rubypeople.rdt.internal.ui.rubyeditor.RubyEditor;
-/**
- * This action reveals the currently selected Ruby element in the
- * package explorer.
- * <p>
- * The action is applicable to selections containing elements of type
- * <code>IRubyElement</code>.
- *
- * <p>
- * This class may be instantiated; it is not intended to be subclassed.
- * </p>
- * @since 2.0
- */
-public class ShowInRubyResourcesViewAction extends SelectionDispatchAction {
-
- private RubyEditor fEditor;
-
- /**
- * Creates a new <code>ShowInPackageViewAction</code>. The action requires
- * that the selection provided by the site's selection provider is of type
- * <code>org.eclipse.jface.viewers.IStructuredSelection</code>.
- *
- * @param site the site providing context information for this action
- */
- public ShowInRubyResourcesViewAction(IWorkbenchSite site) {
- super(site);
- setText(ActionMessages.ShowInPackageViewAction_label);
- setDescription(ActionMessages.ShowInPackageViewAction_description);
- setToolTipText(ActionMessages.ShowInPackageViewAction_tooltip);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.SHOW_IN_PACKAGEVIEW_ACTION);
- }
-
- /**
- * Note: This constructor is for internal use only. Clients should not call this constructor.
- * @param editor the Ruby editor
- */
- public ShowInRubyResourcesViewAction(RubyEditor editor) {
- this(editor.getEditorSite());
- fEditor= editor;
- setEnabled(SelectionConverter.canOperateOn(fEditor));
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void selectionChanged(ITextSelection selection) {
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void selectionChanged(IStructuredSelection selection) {
- setEnabled(checkEnabled(selection));
- }
-
- private boolean checkEnabled(IStructuredSelection selection) {
- if (selection.size() != 1)
- return false;
- return selection.getFirstElement() instanceof IRubyElement;
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void run(ITextSelection selection) {
- try {
- IRubyElement element= SelectionConverter.getElementAtOffset(fEditor);
- if (element != null)
- run(element);
- } catch (RubyModelException e) {
- RubyPlugin.log(e);
- String message= ActionMessages.ShowInPackageViewAction_error_message;
- ErrorDialog.openError(getShell(), getDialogTitle(), message, e.getStatus());
- }
- }
-
- /* (non-Javadoc)
- * Method declared on SelectionDispatchAction.
- */
- public void run(IStructuredSelection selection) {
- if (!checkEnabled(selection))
- return;
- run((IRubyElement)selection.getFirstElement());
- }
-
- /*
- * No Rubydoc. The method should be internal but can't be changed since
- * we shipped it with a public visibility
- */
- public void run(IRubyElement element) {
- if (element == null)
- return;
-
- // reveal the top most element only
- IOpenable openable= element.getOpenable();
- if (openable instanceof IRubyElement)
- element= (IRubyElement)openable;
-
- PackageExplorerPart view= PackageExplorerPart.openInActivePerspective();
- view.tryToReveal(element);
- }
-
- private static String getDialogTitle() {
- return ActionMessages.ShowInPackageViewAction_dialog_title;
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|