/******************************************************************************* * Copyright (c) 2005 RadRails.org and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ package org.radrails.ide.ui; import org.eclipse.ui.application.IWorkbenchConfigurer; import org.eclipse.ui.application.IWorkbenchWindowConfigurer; import org.eclipse.ui.application.WorkbenchAdvisor; import org.eclipse.ui.application.WorkbenchWindowAdvisor; import org.eclipse.ui.internal.ide.model.WorkbenchAdapterBuilder; /** * The main workbench class. Used to specify the initial perspective and register * adapters before the application is run. * * @author Marc */ public class RadRailsWorkbenchAdvisor extends WorkbenchAdvisor { // The perspective ID for the default initial perspective private static final String PERSPECTIVE_ID = "org.radrails.rails.ui.PerspectiveRails"; /** * @see org.eclipse.ui.application.WorkbenchAdvisor#createWorkbenchWindowAdvisor(org.eclipse.ui.application.IWorkbenchWindowConfigurer) */ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor( IWorkbenchWindowConfigurer configurer) { return new RadRailsWorkbenchWindowAdvisor(configurer); } /** * @see org.eclipse.ui.application.WorkbenchAdvisor#getInitialWindowPerspectiveId() */ public String getInitialWindowPerspectiveId() { return PERSPECTIVE_ID; } /** * @see org.eclipse.ui.application.WorkbenchAdvisor#initialize(org.eclipse.ui.application.IWorkbenchConfigurer) */ public void initialize(IWorkbenchConfigurer configurer) { super.initialize(configurer); configurer.setSaveAndRestore(true); } /** * @see org.eclipse.ui.application.WorkbenchAdvisor#preStartup() */ public void preStartup() { // Navigator view needs this WorkbenchAdapterBuilder.registerAdapters(); } } // RadRailsWorkbenchAdvisor