|
From: <caw...@us...> - 2007-07-18 21:03:39
|
Revision: 2783
http://svn.sourceforge.net/rubyeclipse/?rev=2783&view=rev
Author: cawilliams
Date: 2007-07-18 14:03:38 -0700 (Wed, 18 Jul 2007)
Log Message:
-----------
yet more type hierarchy junk
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/EnableMemberFilterAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnSelectionAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnTypeAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/ToggleViewAction.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/EnableMemberFilterAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/EnableMemberFilterAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/EnableMemberFilterAction.java 2007-07-18 21:03:38 UTC (rev 2783)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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.typehierarchy;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.ui.PlatformUI;
+import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
+import org.rubypeople.rdt.internal.ui.RubyPluginImages;
+
+/**
+ * Action enable / disable member filtering
+ */
+public class EnableMemberFilterAction extends Action {
+
+ private TypeHierarchyViewPart fView;
+
+ public EnableMemberFilterAction(TypeHierarchyViewPart v, boolean initValue) {
+ super(TypeHierarchyMessages.EnableMemberFilterAction_label);
+ setDescription(TypeHierarchyMessages.EnableMemberFilterAction_description);
+ setToolTipText(TypeHierarchyMessages.EnableMemberFilterAction_tooltip);
+
+ RubyPluginImages.setLocalImageDescriptors(this, "impl_co.gif"); //$NON-NLS-1$
+
+ fView= v;
+ setChecked(initValue);
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.ENABLE_METHODFILTER_ACTION);
+
+ }
+
+ /*
+ * @see Action#actionPerformed
+ */
+ public void run() {
+ BusyIndicator.showWhile(fView.getSite().getShell().getDisplay(), new Runnable() {
+ public void run() {
+ fView.enableMemberFilter(isChecked());
+ }
+ });
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/EnableMemberFilterAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnSelectionAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnSelectionAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnSelectionAction.java 2007-07-18 21:03:38 UTC (rev 2783)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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.typehierarchy;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.ui.PlatformUI;
+import org.rubypeople.rdt.core.IType;
+import org.rubypeople.rdt.internal.corext.util.Messages;
+import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
+import org.rubypeople.rdt.internal.ui.util.SelectionUtil;
+import org.rubypeople.rdt.ui.RubyElementLabels;
+
+/**
+ * Refocuses the type hierarchy on the currently selection type.
+ */
+public class FocusOnSelectionAction extends Action {
+
+ private TypeHierarchyViewPart fViewPart;
+
+ public FocusOnSelectionAction(TypeHierarchyViewPart part) {
+ super(TypeHierarchyMessages.FocusOnSelectionAction_label);
+ setDescription(TypeHierarchyMessages.FocusOnSelectionAction_description);
+ setToolTipText(TypeHierarchyMessages.FocusOnSelectionAction_tooltip);
+ fViewPart= part;
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.FOCUS_ON_SELECTION_ACTION);
+ }
+
+ private ISelection getSelection() {
+ ISelectionProvider provider= fViewPart.getSite().getSelectionProvider();
+ if (provider != null) {
+ return provider.getSelection();
+ }
+ return null;
+ }
+
+
+ /*
+ * @see Action#run
+ */
+ public void run() {
+ Object element= SelectionUtil.getSingleElement(getSelection());
+ if (element instanceof IType) {
+ fViewPart.setInputElement((IType)element);
+ }
+ }
+
+ public boolean canActionBeAdded() {
+ Object element= SelectionUtil.getSingleElement(getSelection());
+ if (element instanceof IType) {
+ IType type= (IType)element;
+ setText(Messages.format(
+ TypeHierarchyMessages.FocusOnSelectionAction_label,
+ RubyElementLabels.getTextLabel(type, 0)));
+ return true;
+ }
+ return false;
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnSelectionAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnTypeAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnTypeAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnTypeAction.java 2007-07-18 21:03:38 UTC (rev 2783)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * 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.typehierarchy;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.rubypeople.rdt.core.IType;
+import org.rubypeople.rdt.core.search.IRubySearchConstants;
+import org.rubypeople.rdt.core.search.SearchEngine;
+import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
+import org.rubypeople.rdt.internal.ui.dialogs.TypeSelectionDialog2;
+
+/**
+ * Refocuses the type hierarchy on a type selection from a all types dialog.
+ */
+public class FocusOnTypeAction extends Action {
+
+ private TypeHierarchyViewPart fViewPart;
+
+ public FocusOnTypeAction(TypeHierarchyViewPart part) {
+ super(TypeHierarchyMessages.FocusOnTypeAction_label);
+ setDescription(TypeHierarchyMessages.FocusOnTypeAction_description);
+ setToolTipText(TypeHierarchyMessages.FocusOnTypeAction_tooltip);
+
+ fViewPart= part;
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.FOCUS_ON_TYPE_ACTION);
+ }
+
+ /*
+ * @see Action#run
+ */
+ public void run() {
+ Shell parent= fViewPart.getSite().getShell();
+ TypeSelectionDialog2 dialog= new TypeSelectionDialog2(parent, false,
+ PlatformUI.getWorkbench().getProgressService(),
+ SearchEngine.createWorkspaceScope(), IRubySearchConstants.TYPE);
+
+ dialog.setTitle(TypeHierarchyMessages.FocusOnTypeAction_dialog_title);
+ dialog.setMessage(TypeHierarchyMessages.FocusOnTypeAction_dialog_message);
+ if (dialog.open() != IDialogConstants.OK_ID) {
+ return;
+ }
+
+ Object[] types= dialog.getResult();
+ if (types != null && types.length > 0) {
+ IType type= (IType)types[0];
+ fViewPart.setInputElement(type);
+ }
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/FocusOnTypeAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/ToggleViewAction.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/ToggleViewAction.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/ToggleViewAction.java 2007-07-18 21:03:38 UTC (rev 2783)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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.typehierarchy;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.util.Assert;
+import org.eclipse.ui.PlatformUI;
+import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds;
+import org.rubypeople.rdt.internal.ui.RubyPluginImages;
+
+/**
+ * Action to switch between the different hierarchy views.
+ */
+public class ToggleViewAction extends Action {
+
+ private TypeHierarchyViewPart fViewPart;
+ private int fViewerIndex;
+
+ public ToggleViewAction(TypeHierarchyViewPart v, int viewerIndex) {
+ super("", AS_RADIO_BUTTON); //$NON-NLS-1$
+ String contextHelpId= null;
+ if (viewerIndex == TypeHierarchyViewPart.VIEW_ID_SUPER) {
+ setText(TypeHierarchyMessages.ToggleViewAction_supertypes_label);
+ contextHelpId= IRubyHelpContextIds.SHOW_SUPERTYPES;
+ setDescription(TypeHierarchyMessages.ToggleViewAction_supertypes_description);
+ setToolTipText(TypeHierarchyMessages.ToggleViewAction_supertypes_tooltip);
+ RubyPluginImages.setLocalImageDescriptors(this, "super_co.gif"); //$NON-NLS-1$
+ } else if (viewerIndex == TypeHierarchyViewPart.VIEW_ID_SUB) {
+ setText(TypeHierarchyMessages.ToggleViewAction_subtypes_label);
+ contextHelpId= IRubyHelpContextIds.SHOW_SUBTYPES;
+ setDescription(TypeHierarchyMessages.ToggleViewAction_subtypes_description);
+ setToolTipText(TypeHierarchyMessages.ToggleViewAction_subtypes_tooltip);
+ RubyPluginImages.setLocalImageDescriptors(this, "sub_co.gif"); //$NON-NLS-1$
+ } else if (viewerIndex == TypeHierarchyViewPart.VIEW_ID_TYPE) {
+ setText(TypeHierarchyMessages.ToggleViewAction_vajhierarchy_label);
+ contextHelpId= IRubyHelpContextIds.SHOW_HIERARCHY;
+ setDescription(TypeHierarchyMessages.ToggleViewAction_vajhierarchy_description);
+ setToolTipText(TypeHierarchyMessages.ToggleViewAction_vajhierarchy_tooltip);
+ RubyPluginImages.setLocalImageDescriptors(this, "hierarchy_co.gif"); //$NON-NLS-1$
+ } else {
+ Assert.isTrue(false);
+ }
+
+ fViewPart= v;
+ fViewerIndex= viewerIndex;
+
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, contextHelpId);
+ }
+
+ public int getViewerIndex() {
+ return fViewerIndex;
+ }
+
+ /*
+ * @see Action#actionPerformed
+ */
+ public void run() {
+ fViewPart.setView(fViewerIndex);
+ }
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/ToggleViewAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties 2007-07-18 21:03:38 UTC (rev 2783)
@@ -0,0 +1,108 @@
+###############################################################################
+# Copyright (c) 2000, 2006 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
+###############################################################################
+
+EnableMemberFilterAction_label=Members in Hierarchy
+EnableMemberFilterAction_tooltip=Lock View and Show Members in Hierarchy
+EnableMemberFilterAction_description=Lock view and show members in hierarchy
+
+ToggleOrientationAction_horizontal_label=&Horizontal View Orientation
+ToggleOrientationAction_horizontal_tooltip=Horizontal View Orientation
+ToggleOrientationAction_horizontal_description=Horizontal View Orientation
+
+ToggleOrientationAction_vertical_label=&Vertical View Orientation
+ToggleOrientationAction_vertical_tooltip=Vertical View Orientation
+ToggleOrientationAction_vertical_description=Vertical View Orientation
+
+ToggleOrientationAction_automatic_label=&Automatic View Orientation
+ToggleOrientationAction_automatic_tooltip=Automatic View Orientation
+ToggleOrientationAction_automatic_description=Automatic View Orientation
+
+
+ToggleOrientationAction_single_label=Hierarchy View &Only
+ToggleOrientationAction_single_tooltip=Hierarchy View Only
+ToggleOrientationAction_single_description=Hierarchy View Only
+
+FocusOnSelectionAction_label=Fo&cus On ''{0}''
+FocusOnSelectionAction_tooltip=Focus the Type Hierarchy on the Selected Element
+FocusOnSelectionAction_description=Focus the Type Hierarchy on the selected element
+
+FocusOnTypeAction_label=Foc&us On...
+FocusOnTypeAction_tooltip=Focus the Type Hierarchy on a New Type
+FocusOnTypeAction_description=Focus the Type Hierarchy on a new type
+FocusOnTypeAction_dialog_title=Focus On Type
+FocusOnTypeAction_dialog_message=&Select the type to be shown in the Type Hierarchy view:
+
+HistoryDropDownAction_tooltip=Previous Type Hierarchies
+HistoryDropDownAction_clearhistory_label=Clear History
+
+HistoryAction_description=Open ''{0}'' in Hierarchy
+HistoryAction_tooltip=Open ''{0}'' in Hierarchy
+
+HistoryListDialog_title=Type Hierarchy History
+HistoryListDialog_label=&Select the element to open in the type hierarchy:
+HistoryListDialog_remove_button=&Remove
+
+HistoryListAction_label=History...
+
+ShowInheritedMembersAction_label=All Inherited Members
+ShowInheritedMembersAction_tooltip=Show All Inherited Members
+ShowInheritedMembersAction_description=Show all inherited members
+
+ShowQualifiedTypeNamesAction_label=Show &Qualified Type Names
+ShowQualifiedTypeNamesAction_tooltip=Show Qualified Type Names
+ShowQualifiedTypeNamesAction_description=Show qualified type names
+
+SortByDefiningTypeAction_label=Sort by the Defining Type
+SortByDefiningTypeAction_tooltip=Sort Methods by the Defining Type
+SortByDefiningTypeAction_description=Sort methods by the defining type
+
+SubTypeHierarchyViewer_title=Hierarchy
+SubTypeHierarchyViewer_filtered_title=Hierarchy
+
+SuperTypeHierarchyViewer_title=Hierarchy
+SuperTypeHierarchyViewer_filtered_title=Hierarchy
+
+TraditionalHierarchyViewer_title=Hierarchy
+TraditionalHierarchyViewer_filtered_title=Hierarchy
+
+TypeHierarchyViewPart_error_title=Open Type Hierarchy
+
+TypeHierarchyViewPart_error_message=The selected element only exists in the editor. To perform this operation you have to save the editor first.
+TypeHierarchyViewPart_empty=To display the type hierarchy, select a type (for example in the outline view or in the editor), and select the \'Open Type Hierarchy\' menu option. Alternatively, you can drag and drop an element (e.g. project, package, type) onto this view.
+TypeHierarchyViewPart_nodecl=All types of the current hierarchy ''{0}'' have been filtered by either the selected working set or the chosen locked method.
+TypeHierarchyViewPart_exception_title=Type Hierarchy
+TypeHierarchyViewPart_exception_message=Creating hierarchy failed. See log for details.
+
+TypeHierarchyViewPart_title={1}
+TypeHierarchyViewPart_tooltip={0} of ''{1}''
+TypeHierarchyViewPart_ws_title={1}, working set: {2}
+TypeHierarchyViewPart_ws_tooltip={0} of {1} - working set: {2}
+
+TypeHierarchyViewPart_restoreinput=Restoring type hierarchy of ''{0}''...
+
+TypeHierarchyViewPart_layout_submenu=&Layout
+
+ToggleViewAction_subtypes_label=Su&btype Hierarchy
+ToggleViewAction_subtypes_tooltip=Show the Subtype Hierarchy
+ToggleViewAction_subtypes_description=Show the subtype hierarchy
+
+ToggleViewAction_supertypes_label=Su&pertype Hierarchy
+ToggleViewAction_supertypes_tooltip=Show the Supertype Hierarchy
+ToggleViewAction_supertypes_description=Show the supertype hierarchy
+
+ToggleViewAction_vajhierarchy_label=&Type Hierarchy
+ToggleViewAction_vajhierarchy_tooltip=Show the Type Hierarchy
+ToggleViewAction_vajhierarchy_description=Show the type hierarchy
+
+HierarchyInformationControl_methodhierarchy_label=Types implementing or defining ''{0}.{1}''
+HierarchyInformationControl_hierarchy_label=Type hierarchy of ''{0}'':
+HierarchyInformationControl_toggle_traditionalhierarchy_label=Press ''{0}'' to see the subtype hierarchy
+HierarchyInformationControl_toggle_superhierarchy_label=Press ''{0}'' to see the supertype hierarchy
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/typehierarchy/TypeHierarchyMessages.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|