|
From: David C. <dc...@us...> - 2005-09-03 19:05:18
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27402/src/org/rubypeople/rdt/internal/ui Modified Files: RubyPlugin.java Log Message: * Added TaskList to views associated with Ruby Perspective * Be sure Ruby projects have a RubyBuilder when plugin is loaded. * 'test tool' for odd parser bug. Index: RubyPlugin.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RubyPlugin.java 1 Apr 2005 02:11:43 -0000 1.9 --- RubyPlugin.java 3 Sep 2005 19:05:07 -0000 1.10 *************** *** 4,7 **** --- 4,8 ---- import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspace; + import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Platform; *************** *** 19,22 **** --- 20,25 ---- import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchWindow; + import org.eclipse.ui.PartInitException; + import org.eclipse.ui.PlatformUI; import org.eclipse.ui.editors.text.EditorsUI; import org.eclipse.ui.editors.text.TextEditorPreferenceConstants; *************** *** 43,47 **** public class RubyPlugin extends AbstractUIPlugin implements IRubyColorConstants { ! protected static RubyPlugin plugin; public static final String PLUGIN_ID = "org.rubypeople.rdt.ui"; //$NON-NLS-1$ --- 46,51 ---- public class RubyPlugin extends AbstractUIPlugin implements IRubyColorConstants { ! private static final String ORG_ECLIPSE_UI_VIEWS_TASK_LIST = "org.eclipse.ui.views.TaskList"; ! protected static RubyPlugin plugin; public static final String PLUGIN_ID = "org.rubypeople.rdt.ui"; //$NON-NLS-1$ *************** *** 111,116 **** } }); ! } /* --- 115,155 ---- } }); ! ! upgradeOldProjects(); } + + private void upgradeOldProjects() { + try { + boolean projectUpgraded = RubyCore.upgradeOldProjects(); + + if (projectUpgraded) { + openTasksView(); + } + } catch (CoreException e) { + log(IStatus.WARNING, "While upgrading RDT projects", e); + } + } + + // currently a "no-op", as there are no workbench pages when this is called. :( DSC + private void openTasksView() { + try{ + IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (dw != null) { + IWorkbenchPage page = dw.getActivePage(); + if (page == null) { + IWorkbenchPage[] pages = dw.getPages(); + for (int i=0; i<pages.length; i++) { + if (null != pages[i].findView(ORG_ECLIPSE_UI_VIEWS_TASK_LIST)) + break; + } + if (pages.length > 0) + page = pages[0]; + } + if (page != null) + page.showView(ORG_ECLIPSE_UI_VIEWS_TASK_LIST); + } + }catch (PartInitException ignored){ + } + } /* |