|
From: <caw...@us...> - 2007-09-17 18:06:48
|
Revision: 3194
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=3194&view=rev
Author: cawilliams
Date: 2007-09-17 11:06:42 -0700 (Mon, 17 Sep 2007)
Log Message:
-----------
try to avoid error message about being unable to restore perspective (because of removed Ruby Resources view).
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/plugin.xml
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/DeprecatedView.java
Modified: trunk/org.rubypeople.rdt.ui/plugin.xml
===================================================================
--- trunk/org.rubypeople.rdt.ui/plugin.xml 2007-09-17 13:52:23 UTC (rev 3193)
+++ trunk/org.rubypeople.rdt.ui/plugin.xml 2007-09-17 18:06:42 UTC (rev 3194)
@@ -386,6 +386,13 @@
id="org.rubypeople.rdt.ui.RubyExplorer">
</view>
<view
+ name="Ruby Resources View"
+ icon="$nl$/icons/full/ctool16/ruby.gif"
+ category="org.rubypeople.rdt.ui.ruby"
+ class="org.rubypeople.rdt.ui.DeprecatedView"
+ id="org.rubypeople.rdt.ui.ViewRubyResources">
+ </view>
+ <view
name="RI"
icon="icons/full/elcl16/help.gif"
category="org.rubypeople.rdt.ui.ruby"
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-09-17 13:52:23 UTC (rev 3193)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-09-17 18:06:42 UTC (rev 3194)
@@ -41,6 +41,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
@@ -74,6 +75,7 @@
import org.rubypeople.rdt.internal.ui.text.template.contentassist.RubyTemplateAccess;
import org.rubypeople.rdt.internal.ui.viewsupport.ProblemMarkerManager;
import org.rubypeople.rdt.ui.PreferenceConstants;
+import org.rubypeople.rdt.ui.RubyUI;
import org.rubypeople.rdt.ui.text.RubyTextTools;
public class RubyPlugin extends AbstractUIPlugin implements IRubyColorConstants {
@@ -82,6 +84,7 @@
private static final String ORG_ECLIPSE_UI_VIEWS_PROBLEM_VIEW = "org.eclipse.ui.views.ProblemView";
protected static RubyPlugin plugin;
public static final String PLUGIN_ID = "org.rubypeople.rdt.ui"; //$NON-NLS-1$
+ private static final String OPENED_RUBY_EXPLORER = PLUGIN_ID + ".opened.ruby.explorer";
protected RubyTextTools textTools;
protected RubyFileMatcher rubyFileMatcher;
@@ -173,7 +176,9 @@
fMembersOrderPreferenceCache.install(store);
listenForNewProjects();
- upgradeOldProjects();
+ upgradeOldProjects();
+ openRubyExplorer();
+
String generateRdocOption = Platform.getDebugOption(RubyPlugin.PLUGIN_ID + "/generaterdoc");
RDocUtility.setDebugging(generateRdocOption == null ? false : generateRdocOption.equalsIgnoreCase("true"));
@@ -181,6 +186,33 @@
getASTProvider();
new InitializeAfterLoadJob().schedule();
}
+
+ private void openRubyExplorer() {
+ final IPreferenceStore store = RubyPlugin.getDefault().getPreferenceStore();
+ if (store.getBoolean(OPENED_RUBY_EXPLORER)) return;
+ WorkbenchJob job = new WorkbenchJob("Show New Ruby Explorer View") {
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ try {
+ IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ if (dw != null) {
+ IWorkbenchPage page = dw.getActivePage();
+ if (page != null) {
+ if (page.findView(RubyUI.ID_RUBY_EXPLORER) == null) {
+ IViewPart part = page.findView(RubyUI.ID_RUBY_RESOURCE_VIEW);
+ if (part != null) {
+ page.hideView(part);
+ page.showView(RubyUI.ID_RUBY_EXPLORER);
+ store.setValue(OPENED_RUBY_EXPLORER, true);
+ }
+ }
+ }
+ }
+ } catch (PartInitException ignored) {}
+ return Status.OK_STATUS;
+ }
+ };
+ job.schedule();
+ }
/* package */ static void initializeAfterLoad(IProgressMonitor monitor) {
OpenTypeHistory.getInstance().checkConsistency(monitor);
Added: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/DeprecatedView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/DeprecatedView.java (rev 0)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/DeprecatedView.java 2007-09-17 18:06:42 UTC (rev 3194)
@@ -0,0 +1,20 @@
+package org.rubypeople.rdt.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.part.ViewPart;
+
+public class DeprecatedView extends ViewPart {
+
+ @Override
+ public void createPartControl(Composite parent) {
+ Label label = new Label(parent, SWT.NULL);
+ label.setText("This view has been replaced by the new Ruby Explorer view.");
+ }
+
+ @Override
+ public void setFocus() {
+ }
+
+}
Property changes on: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/DeprecatedView.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-17 13:52:23 UTC (rev 3193)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyUI.java 2007-09-17 18:06:42 UTC (rev 3194)
@@ -150,6 +150,11 @@
public static final String ID_RUBY_EXPLORER= "org.rubypeople.rdt.ui.RubyExplorer"; //$NON-NLS-1$
/**
+ * @deprecated View is going to be removed
+ */
+ public static final String ID_RUBY_RESOURCE_VIEW = "org.rubypeople.rdt.ui.ViewRubyResources"; //$NON-NLS-1$
+
+ /**
* Returns the Ruby element wrapped by the given editor input.
*
* @param editorInput
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|