Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java20
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java26
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java37
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java96
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java94
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java212
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java19
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java35
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java411
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java233
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java240
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java603
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java64
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java65
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java65
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java9
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java17
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java49
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java100
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java96
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java239
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java71
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java304
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java246
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java419
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java131
-rwxr-xr-xbundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java656
-rwxr-xr-xbundles/org.eclipse.rap.ui/plugin.xml2
-rwxr-xr-xbundles/org.eclipse.rap.ui/schema/intro.exsd33
-rwxr-xr-xbundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java3
30 files changed, 2410 insertions, 2185 deletions
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java
index 5d4c0b0630..a4503adc88 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbench.java
@@ -20,11 +20,10 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.activities.IWorkbenchActivitySupport;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.eclipse.ui.commands.ICommandService;
-//import org.eclipse.ui.commands.IWorkbenchCommandSupport;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.contexts.IWorkbenchContextSupport;
import org.eclipse.ui.handlers.IHandlerService;
-//import org.eclipse.ui.intro.IIntroManager;
+import org.eclipse.ui.intro.IIntroManager;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
import org.eclipse.ui.progress.IProgressService;
@@ -497,15 +496,14 @@ public interface IWorkbench extends IAdaptable, IServiceLocator {
*/
public IThemeManager getThemeManager();
-// RAP [rh] Intro mechanism not supported
-// /**
-// * Return the intro manager for this workbench.
-// *
-// * @return the intro manager for this workbench. Guaranteed not to be
-// * <code>null</code>.
-// * @since 1.1
-// */
-// public IIntroManager getIntroManager();
+ /**
+ * Return the intro manager for this workbench.
+ *
+ * @return the intro manager for this workbench. Guaranteed not to be
+ * <code>null</code>.
+ * @since 1.2
+ */
+ public IIntroManager getIntroManager();
// RAP [bm]:
// /**
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java
index 90abb443a4..ed007f5f01 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java
@@ -220,19 +220,19 @@ public interface IWorkbenchPreferenceConstants {
*/
public static final String RIGHT = "right"; //$NON-NLS-1$
- // RAP [bm]: intro
-// /**
-// * A named preference indicating whether the workbench should show the
-// * introduction component (if available) on startup.
-// *
-// * <p>
-// * The default value for this preference is: <code>true</code> (show
-// * intro)
-// * </p>
-// *
-// * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()
-// */
-// public static final String SHOW_INTRO = "showIntro"; //$NON-NLS-1$
+ /**
+ * A named preference indicating whether the workbench should show the
+ * introduction component (if available) on startup.
+ *
+ * <p>
+ * The default value for this preference is: <code>true</code> (show
+ * intro)
+ * </p>
+ *
+ * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()
+ * @since 1.2
+ */
+ public static final String SHOW_INTRO = "showIntro"; //$NON-NLS-1$
// RAP [bm]: no different tab styles in ctabfolder
// /**
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
index 1ebda4215d..77c0b7b04d 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/actions/ActionFactory.java
@@ -17,7 +17,7 @@ import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.internal.CloseAllSavedAction;
import org.eclipse.ui.internal.IWorkbenchGraphicConstants;
-//import org.eclipse.ui.internal.IntroAction;
+import org.eclipse.ui.internal.IntroAction;
import org.eclipse.ui.internal.NavigationHistoryAction;
import org.eclipse.ui.internal.OpenPreferencesAction;
import org.eclipse.ui.internal.SaveAction;
@@ -327,24 +327,23 @@ public abstract class ActionFactory {
}
};
-// RAP [rh] Intro mechanism not supported
-// /**
-// * Workbench action (id "intro"): Activate the introduction extension.
-// * @since 1.1
-// */
-// public static final ActionFactory INTRO = new ActionFactory("intro") {//$NON-NLS-1$
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
-// */
-// public IWorkbenchAction create(IWorkbenchWindow window) {
-// if (window == null) {
-// throw new IllegalArgumentException();
-// }
-// IWorkbenchAction action = new IntroAction(window);
-// action.setId(getId());
-// return action;
-// }
-// };
+ /**
+ * Workbench action (id "intro"): Activate the introduction extension.
+ * @since 1.2
+ */
+ public static final ActionFactory INTRO = new ActionFactory("intro") {//$NON-NLS-1$
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionFactory#create(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public IWorkbenchAction create(IWorkbenchWindow window) {
+ if (window == null) {
+ throw new IllegalArgumentException();
+ }
+ IWorkbenchAction action = new IntroAction(window);
+ action.setId(getId());
+ return action;
+ }
+ };
// RAP [bm]: clipboard
// /**
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
index 479ed642f3..dd1a6eb9f5 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchAdvisor.java
@@ -25,6 +25,7 @@ import org.eclipse.ui.internal.StartupThreading;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkbenchWindowConfigurer;
import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
+import org.eclipse.ui.internal.util.PrefUtil;
import org.eclipse.ui.model.ContributionComparator;
import org.eclipse.ui.model.IContributionService;
import org.eclipse.ui.statushandlers.AbstractStatusHandler;
@@ -159,8 +160,7 @@ public abstract class WorkbenchAdvisor {
*/
private AbstractStatusHandler workbenchErrorHandler;
-// RAP [rh] unused code as openIntro code is disabled
-// private boolean introOpened;
+ private boolean introOpened;
/**
* Creates and initializes a new workbench advisor instance.
@@ -485,52 +485,52 @@ public abstract class WorkbenchAdvisor {
// do nothing
}
-// RAP [rh] intro not yet supported
-// /**
-// * Opens the introduction componenet.
-// * <p>
-// * Clients must not call this method directly (although super calls are
-// * okay). The default implementation opens the intro in the first window
-// * provided the preference IWorkbenchPreferences.SHOW_INTRO is
-// * <code>true</code>. If an intro is shown then this preference will be
-// * set to <code>false</code>. Subsequently, and intro will be shown only
-// * if <code>WorkbenchConfigurer.getSaveAndRestore()</code> returns
-// * <code>true</code> and the introduction was visible on last shutdown.
-// * Subclasses may override.
-// * </p>
-// *
-// * @param configurer
-// * configurer an object for configuring the particular workbench
-// * window just created
-// *
-// * @deprecated since 3.1, override
-// * {@link WorkbenchWindowAdvisor#openIntro()} instead
-// * @see #createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer)
-// */
-// public void openIntro(IWorkbenchWindowConfigurer configurer) {
-// if (introOpened) {
-// return;
-// }
-//
-// introOpened = true;
-//
-// boolean showIntro = PrefUtil.getAPIPreferenceStore().getBoolean(
-// IWorkbenchPreferenceConstants.SHOW_INTRO);
-//
-// if (!showIntro) {
-// return;
-// }
-//
-// if (getWorkbenchConfigurer().getWorkbench().getIntroManager()
-// .hasIntro()) {
-// getWorkbenchConfigurer().getWorkbench().getIntroManager()
-// .showIntro(configurer.getWindow(), false);
-//
-// PrefUtil.getAPIPreferenceStore().setValue(
-// IWorkbenchPreferenceConstants.SHOW_INTRO, false);
-// PrefUtil.saveAPIPrefs();
-// }
-// }
+ /**
+ * Opens the introduction componenet.
+ * <p>
+ * Clients must not call this method directly (although super calls are
+ * okay). The default implementation opens the intro in the first window
+ * provided the preference IWorkbenchPreferences.SHOW_INTRO is
+ * <code>true</code>. If an intro is shown then this preference will be
+ * set to <code>false</code>. Subsequently, and intro will be shown only
+ * if <code>WorkbenchConfigurer.getSaveAndRestore()</code> returns
+ * <code>true</code> and the introduction was visible on last shutdown.
+ * Subclasses may override.
+ * </p>
+ *
+ * @param configurer
+ * configurer an object for configuring the particular workbench
+ * window just created
+ *
+ * @deprecated since 3.1, override
+ * {@link WorkbenchWindowAdvisor#openIntro()} instead
+ * @see #createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer)
+ * @since 1.2
+ */
+ public void openIntro(IWorkbenchWindowConfigurer configurer) {
+ if (introOpened) {
+ return;
+ }
+
+ introOpened = true;
+
+ boolean showIntro = PrefUtil.getAPIPreferenceStore().getBoolean(
+ IWorkbenchPreferenceConstants.SHOW_INTRO);
+
+ if (!showIntro) {
+ return;
+ }
+
+ if (getWorkbenchConfigurer().getWorkbench().getIntroManager()
+ .hasIntro()) {
+ getWorkbenchConfigurer().getWorkbench().getIntroManager()
+ .showIntro(configurer.getWindow(), false);
+
+ PrefUtil.getAPIPreferenceStore().setValue(
+ IWorkbenchPreferenceConstants.SHOW_INTRO, false);
+ PrefUtil.saveAPIPrefs();
+ }
+ }
/**
* Performs arbitrary actions after the given workbench window has been
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
index 3e064b76e4..d4b457e57d 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/application/WorkbenchWindowAdvisor.java
@@ -17,13 +17,13 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IMemento;
-//import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.internal.WorkbenchWindowConfigurer;
-//import org.eclipse.ui.internal.util.PrefUtil;
-//import org.eclipse.ui.intro.IIntroManager;
+import org.eclipse.ui.internal.util.PrefUtil;
+import org.eclipse.ui.intro.IIntroManager;
/**
* Public base class for configuring a workbench window.
@@ -134,50 +134,50 @@ public class WorkbenchWindowAdvisor {
// do nothing
}
-// RAP [rh] Intro mechanism not supported
-// /**
-// * Opens the introduction componenet.
-// * <p>
-// * Clients must not call this method directly (although super calls are okay).
-// * The default implementation opens the intro in the first window provided
-// * if the preference IWorkbenchPreferences.SHOW_INTRO is <code>true</code>. If
-// * an intro is shown then this preference will be set to <code>false</code>.
-// * Subsequently, and intro will be shown only if
-// * <code>WorkbenchConfigurer.getSaveAndRestore()</code> returns
-// * <code>true</code> and the introduction was visible on last shutdown.
-// * Subclasses may override.
-// * </p>
-// */
-// public void openIntro() {
-// // TODO: Refactor this into an IIntroManager.openIntro(IWorkbenchWindow) call
-//
-// // introOpened flag needs to be global
-// IWorkbenchConfigurer wbConfig = getWindowConfigurer().getWorkbenchConfigurer();
-// final String key = "introOpened"; //$NON-NLS-1$
-// Boolean introOpened = (Boolean) wbConfig.getData(key);
-// if (introOpened != null && introOpened.booleanValue()) {
-// return;
-// }
-//
-// wbConfig.setData(key, Boolean.TRUE);
-//
-// boolean showIntro = PrefUtil.getAPIPreferenceStore().getBoolean(
-// IWorkbenchPreferenceConstants.SHOW_INTRO);
-//
-// IIntroManager introManager = wbConfig.getWorkbench().getIntroManager();
-//
-// boolean hasIntro = introManager.hasIntro();
-// boolean isNewIntroContentAvailable = introManager.isNewContentAvailable();
-//
-// if (hasIntro && (showIntro || isNewIntroContentAvailable)) {
-// introManager
-// .showIntro(getWindowConfigurer().getWindow(), false);
-//
-// PrefUtil.getAPIPreferenceStore().setValue(
-// IWorkbenchPreferenceConstants.SHOW_INTRO, false);
-// PrefUtil.saveAPIPrefs();
-// }
-// }
+ /**
+ * Opens the introduction componenet.
+ * <p>
+ * Clients must not call this method directly (although super calls are okay).
+ * The default implementation opens the intro in the first window provided
+ * if the preference IWorkbenchPreferences.SHOW_INTRO is <code>true</code>. If
+ * an intro is shown then this preference will be set to <code>false</code>.
+ * Subsequently, and intro will be shown only if
+ * <code>WorkbenchConfigurer.getSaveAndRestore()</code> returns
+ * <code>true</code> and the introduction was visible on last shutdown.
+ * Subclasses may override.
+ * </p>
+ * @since 1.2
+ */
+ public void openIntro() {
+ // TODO: Refactor this into an IIntroManager.openIntro(IWorkbenchWindow) call
+
+ // introOpened flag needs to be global
+ IWorkbenchConfigurer wbConfig = getWindowConfigurer().getWorkbenchConfigurer();
+ final String key = "introOpened"; //$NON-NLS-1$
+ Boolean introOpened = (Boolean) wbConfig.getData(key);
+ if (introOpened != null && introOpened.booleanValue()) {
+ return;
+ }
+
+ wbConfig.setData(key, Boolean.TRUE);
+
+ boolean showIntro = PrefUtil.getAPIPreferenceStore().getBoolean(
+ IWorkbenchPreferenceConstants.SHOW_INTRO);
+
+ IIntroManager introManager = wbConfig.getWorkbench().getIntroManager();
+
+ boolean hasIntro = introManager.hasIntro();
+ boolean isNewIntroContentAvailable = introManager.isNewContentAvailable();
+
+ if (hasIntro && (showIntro || isNewIntroContentAvailable)) {
+ introManager
+ .showIntro(getWindowConfigurer().getWindow(), false);
+
+ PrefUtil.getAPIPreferenceStore().setValue(
+ IWorkbenchPreferenceConstants.SHOW_INTRO, false);
+ PrefUtil.saveAPIPrefs();
+ }
+ }
/**
* Performs arbitrary actions after the window has been created (possibly
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java
index 59576a2d1a..0252e4dd94 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/IntroAction.java
@@ -1,108 +1,108 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2003, 2007 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
-// * Sebastian Davids <sdavids@gmx.de> - Fix for bug 95292 - [Intro]
-// * Help > Welcome missing F1 context
-// *******************************************************************************/
-//package org.eclipse.ui.internal;
-//
-//import org.eclipse.jface.action.Action;
-//import org.eclipse.jface.dialogs.MessageDialog;
-//import org.eclipse.jface.resource.ImageDescriptor;
-//import org.eclipse.swt.widgets.Event;
-//import org.eclipse.ui.IPageListener;
-//import org.eclipse.ui.IWorkbenchPage;
-//import org.eclipse.ui.IWorkbenchWindow;
-//import org.eclipse.ui.actions.ActionFactory;
-//import org.eclipse.ui.internal.intro.IntroDescriptor;
-//import org.eclipse.ui.internal.intro.IntroMessages;
-//
-///**
-// * Action that will launch the intro in the given window.
-// */
-//public class IntroAction extends Action implements
-// ActionFactory.IWorkbenchAction {
-//
-// private IWorkbenchWindow workbenchWindow;
-//
-// private IPageListener pageListener = new IPageListener() {
-//
-// public void pageActivated(IWorkbenchPage page) {
-// //no-op
-// }
-//
-// public void pageClosed(IWorkbenchPage page) {
-// setEnabled(workbenchWindow.getPages().length > 0);
-// }
-//
-// public void pageOpened(IWorkbenchPage page) {
-// setEnabled(true);
-// }
-// };
-//
-// /**
-// * @param window the window to bind the action to.
-// */
-// public IntroAction(IWorkbenchWindow window) {
-// super(IntroMessages.Intro_action_text);
-// if (window == null) {
-// throw new IllegalArgumentException();
-// }
-// this.workbenchWindow = window;
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 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
+ * Sebastian Davids <sdavids@gmx.de> - Fix for bug 95292 - [Intro]
+ * Help > Welcome missing F1 context
+ *******************************************************************************/
+package org.eclipse.ui.internal;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.ui.IPageListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.internal.intro.IntroDescriptor;
+import org.eclipse.ui.internal.intro.IntroMessages;
+
+/**
+ * Action that will launch the intro in the given window.
+ */
+public class IntroAction extends Action implements
+ ActionFactory.IWorkbenchAction {
+
+ private IWorkbenchWindow workbenchWindow;
+
+ private IPageListener pageListener = new IPageListener() {
+
+ public void pageActivated(IWorkbenchPage page) {
+ //no-op
+ }
+
+ public void pageClosed(IWorkbenchPage page) {
+ setEnabled(workbenchWindow.getPages().length > 0);
+ }
+
+ public void pageOpened(IWorkbenchPage page) {
+ setEnabled(true);
+ }
+ };
+
+ /**
+ * @param window the window to bind the action to.
+ */
+ public IntroAction(IWorkbenchWindow window) {
+ super(IntroMessages.get().Intro_action_text);
+ if (window == null) {
+ throw new IllegalArgumentException();
+ }
+ this.workbenchWindow = window;
+ // RAP [bm]: helpsystem
// window.getWorkbench().getHelpSystem().setHelp(this,
// IWorkbenchHelpContextIds.INTRO_ACTION);
-//
-// IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
-// .getWorkbench()).getIntroDescriptor();
-// String labelOverride = introDescriptor.getLabelOverride();
-// if (labelOverride != null)
-// setText(labelOverride);
-//
-// setActionDefinitionId("org.eclipse.ui.help.quickStartAction"); //$NON-NLS-1$
-//
-// window.addPageListener(pageListener);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
-// */
-// public void dispose() {
-// workbenchWindow.removePageListener(pageListener);
-// workbenchWindow = null;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
-// */
-// public void runWithEvent(Event event) {
-// IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
-// .getWorkbench()).getIntroDescriptor();
-// if (introDescriptor == null) {
-// MessageDialog.openWarning(workbenchWindow.getShell(),
-// IntroMessages.Intro_missing_product_title,
-// IntroMessages.Intro_missing_product_message);
-// } else {
-// workbenchWindow.getWorkbench().getIntroManager().showIntro(
-// workbenchWindow, false);
-// }
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.jface.action.IAction#getImageDescriptor()
-// */
-// public ImageDescriptor getImageDescriptor() {
-// IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
-// .getWorkbench()).getIntroDescriptor();
-// if (introDescriptor == null) {
-// return null;
-// }
-// return introDescriptor.getImageDescriptor();
-// }
-//}
+
+ IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
+ .getWorkbench()).getIntroDescriptor();
+ String labelOverride = introDescriptor.getLabelOverride();
+ if (labelOverride != null)
+ setText(labelOverride);
+
+ setActionDefinitionId("org.eclipse.ui.help.quickStartAction"); //$NON-NLS-1$
+
+ window.addPageListener(pageListener);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
+ */
+ public void dispose() {
+ workbenchWindow.removePageListener(pageListener);
+ workbenchWindow = null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
+ */
+ public void runWithEvent(Event event) {
+ IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
+ .getWorkbench()).getIntroDescriptor();
+ if (introDescriptor == null) {
+ MessageDialog.openWarning(workbenchWindow.getShell(),
+ IntroMessages.get().Intro_missing_product_title,
+ IntroMessages.get().Intro_missing_product_message);
+ } else {
+ workbenchWindow.getWorkbench().getIntroManager().showIntro(
+ workbenchWindow, false);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ IntroDescriptor introDescriptor = ((Workbench) workbenchWindow
+ .getWorkbench()).getIntroDescriptor();
+ if (introDescriptor == null) {
+ return null;
+ }
+ return introDescriptor.getImageDescriptor();
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java
index c8186801ff..e36e3d21f5 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java
@@ -49,7 +49,7 @@ import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
//import org.eclipse.ui.internal.dnd.DragUtil;
//import org.eclipse.ui.internal.dnd.IDropTarget;
import org.eclipse.ui.internal.dnd.SwtUtil;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.internal.layout.ITrimManager;
import org.eclipse.ui.internal.layout.IWindowTrim;
import org.eclipse.ui.internal.presentations.PresentablePart;
@@ -1328,15 +1328,14 @@ public abstract class PartStack extends LayoutPart implements ILayoutContainer {
* as a ViewPane (not if it's only a placeholder)
*/
private boolean isIntroInStack() {
-// RAP [rh] Intro mechanism not supported
-// LayoutPart[] kids = getChildren();
-// for (int i = 0; i < kids.length; i++) {
-// if (kids[i] instanceof ViewPane) {
-// ViewPane vp = (ViewPane) kids[i];
-// if (vp.getID().equals(IIntroConstants.INTRO_VIEW_ID))
-// return true;
-// }
-// }
+ LayoutPart[] kids = getChildren();
+ for (int i = 0; i < kids.length; i++) {
+ if (kids[i] instanceof ViewPane) {
+ ViewPane vp = (ViewPane) kids[i];
+ if (vp.getID().equals(IIntroConstants.INTRO_VIEW_ID))
+ return true;
+ }
+ }
return false;
}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java
index cd86d19c2f..7dc4a54acf 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java
@@ -55,7 +55,7 @@ import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
import org.eclipse.ui.internal.contexts.ContextAuthority;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.internal.layout.ITrimManager;
import org.eclipse.ui.internal.layout.IWindowTrim;
import org.eclipse.ui.internal.layout.TrimLayout;
@@ -1122,11 +1122,10 @@ public class Perspective {
// Get the view details.
IMemento childMem = views[x];
String id = childMem.getString(IWorkbenchConstants.TAG_ID);
-// RAP [rh] Intro mechanism not supported
-// // skip creation of the intro reference - it's handled elsewhere.
-// if (id.equals(IIntroConstants.INTRO_VIEW_ID)) {
-// continue;
-// }
+ // skip creation of the intro reference - it's handled elsewhere.
+ if (id.equals(IIntroConstants.INTRO_VIEW_ID)) {
+ continue;
+ }
String secondaryId = ViewFactory.extractSecondaryId(id);
if (secondaryId != null) {
@@ -1217,11 +1216,10 @@ public class Perspective {
id = ViewFactory.extractPrimaryId(id);
}
-// RAP [rh] Intro mechanism not supported
-// // skip the intro as it is restored higher up in workbench.
-// if (id.equals(IIntroConstants.INTRO_VIEW_ID)) {
-// continue;
-// }
+ // skip the intro as it is restored higher up in workbench.
+ if (id.equals(IIntroConstants.INTRO_VIEW_ID)) {
+ continue;
+ }
// Create and open the view.
IViewReference viewRef = viewFactory.getView(id, secondaryId);
@@ -2028,14 +2026,13 @@ public class Perspective {
saveFastViewWidthRatio();
-// RAP [rh] Intro mechanism not supported
-// // Special check to ensure that a 'minimized' intro view shows
-// // as 'standby'
-// if (ref.getId().equals("org.eclipse.ui.internal.introview")) { //$NON-NLS-1$
-// if (refPart instanceof ViewIntroAdapterPart) {
-// ((ViewIntroAdapterPart)refPart).setStandby(true);
-// }
-// }
+ // Special check to ensure that a 'minimized' intro view shows
+ // as 'standby'
+ if (ref.getId().equals("org.eclipse.ui.internal.introview")) { //$NON-NLS-1$
+ if (refPart instanceof ViewIntroAdapterPart) {
+ ((ViewIntroAdapterPart)refPart).setStandby(true);
+ }
+ }
// Determine the display orientation
int side = fastViewManager.getViewSide(ref);
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
index 9adfacf454..06d2245c59 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterPart.java
@@ -1,206 +1,205 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 2007 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.eclipse.ui.internal;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.core.runtime.IStatus;
-//import org.eclipse.core.runtime.Status;
-//import org.eclipse.swt.custom.BusyIndicator;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.swt.widgets.Control;
-//import org.eclipse.ui.IMemento;
-//import org.eclipse.ui.IPropertyListener;
-//import org.eclipse.ui.IViewSite;
-//import org.eclipse.ui.IWorkbenchPartSite;
-//import org.eclipse.ui.PartInitException;
-//import org.eclipse.ui.internal.intro.IntroMessages;
-//import org.eclipse.ui.intro.IIntroPart;
-//import org.eclipse.ui.intro.IIntroSite;
-//import org.eclipse.ui.part.ViewPart;
-//
-///**
-// * Simple view that will wrap an <code>IIntroPart</code>.
-// *
-// * @since 3.0
-// */
-//public final class ViewIntroAdapterPart extends ViewPart {
-//
-// private IIntroPart introPart;
-//
-// private IIntroSite introSite;
-//
-// private boolean handleZoomEvents = true;
-//
-// /**
-// * Adds a listener that toggles standby state if the view pane is zoomed.
-// */
-// private void addPaneListener() {
-// IWorkbenchPartSite site = getSite();
-// if (site instanceof PartSite) {
-// final WorkbenchPartReference ref = ((WorkbenchPartReference)((PartSite) site).getPartReference());
-// ref.addInternalPropertyListener(
-// new IPropertyListener() {
-// public void propertyChanged(Object source, int propId) {
-// if (handleZoomEvents) {
-// if (propId == WorkbenchPartReference.INTERNAL_PROPERTY_ZOOMED) {
-// setStandby(!ref.getPane().isZoomed());
-// }
-// }
-// }
-// });
-// }
-// }
-//
-// /**
-// * Forces the standby state of the intro part.
-// *
-// * @param standby update the standby state
-// */
-// public void setStandby(final boolean standby) {
-// final Control control = ((PartSite) getSite()).getPane().getControl();
-// BusyIndicator.showWhile(control.getDisplay(), new Runnable() {
-// public void run() {
-// try {
-// control.setRedraw(false);
-// introPart.standbyStateChanged(standby);
-// } finally {
-// control.setRedraw(true);
-// }
-//
-// setBarVisibility(standby);
-// }
-// });
-// }
-//
-// /**
-// * Toggles handling of zoom events.
-// *
-// * @param handle whether to handle zoom events
-// */
-// public void setHandleZoomEvents(boolean handle) {
-// handleZoomEvents = handle;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-// */
-// public void createPartControl(Composite parent) {
-// addPaneListener();
-// introPart.createPartControl(parent);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchPart#dispose()
-// */
-// public void dispose() {
-// setBarVisibility(true);
-// super.dispose();
-// getSite().getWorkbenchWindow().getWorkbench().getIntroManager()
-// .closeIntro(introPart);
-// introPart.dispose();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-// */
-// public Object getAdapter(Class adapter) {
-// return introPart.getAdapter(adapter);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
-// */
-// public Image getTitleImage() {
-// return introPart.getTitleImage();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.part.WorkbenchPart#getTitle()
-// */
-// public String getTitle() {
-// // this method is called eagerly before our init method is called (and
-// // therefore before our intropart is created). By default return
-// // the view title from the view declaration. We will fire a property
-// // change to set the title to the proper value in the init method.
-// return introPart == null ? super.getTitle() : introPart.getTitle();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
-// */
-// public void init(IViewSite site, IMemento memento) throws PartInitException {
-// super.init(site);
-// Workbench workbench = (Workbench) site.getWorkbenchWindow()
-// .getWorkbench();
-// try {
-// introPart = workbench.getWorkbenchIntroManager()
-// .createNewIntroPart();
-// // reset the part name of this view to be that of the intro title
-// setPartName(introPart.getTitle());
-// introPart.addPropertyListener(new IPropertyListener() {
-// public void propertyChanged(Object source, int propId) {
-// firePropertyChange(propId);
-// }
-// });
-// introSite = new ViewIntroAdapterSite(site, workbench
-// .getIntroDescriptor());
-// introPart.init(introSite, memento);
-//
-// } catch (CoreException e) {
-// WorkbenchPlugin
-// .log(
-// IntroMessages.Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_proxy, e));
-// }
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.IWorkbenchPart#setFocus()
-// */
-// public void setFocus() {
-// introPart.setFocus();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento)
-// */
-// public void saveState(IMemento memento) {
-// introPart.saveState(memento);
-// }
-//
-// /**
-// * Sets whether the CoolBar/PerspectiveBar should be visible.
-// *
-// * @param visible whether the CoolBar/PerspectiveBar should be visible
-// * @since 3.1
-// */
-// private void setBarVisibility(final boolean visible) {
-// WorkbenchWindow window = (WorkbenchWindow) getSite()
-// .getWorkbenchWindow();
-//
-// final boolean layout = (visible != window.getCoolBarVisible())
-// || (visible != window.getPerspectiveBarVisible()); // don't layout unless things have actually changed
-// if (visible) {
-// window.setCoolBarVisible(true);
-// window.setPerspectiveBarVisible(true);
-// } else {
-// window.setCoolBarVisible(false);
-// window.setPerspectiveBarVisible(false);
-// }
-//
-// if (layout) {
-// window.getShell().layout();
-// }
-// }
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.eclipse.ui.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.internal.intro.IntroMessages;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.intro.IIntroSite;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * Simple view that will wrap an <code>IIntroPart</code>.
+ *
+ * @since 1.2
+ */
+public final class ViewIntroAdapterPart extends ViewPart {
+
+ private IIntroPart introPart;
+
+ private IIntroSite introSite;
+
+ private boolean handleZoomEvents = true;
+
+ /**
+ * Adds a listener that toggles standby state if the view pane is zoomed.
+ */
+ private void addPaneListener() {
+ IWorkbenchPartSite site = getSite();
+ if (site instanceof PartSite) {
+ final WorkbenchPartReference ref = ((WorkbenchPartReference)((PartSite) site).getPartReference());
+ ref.addInternalPropertyListener(
+ new IPropertyListener() {
+ public void propertyChanged(Object source, int propId) {
+ if (handleZoomEvents) {
+ if (propId == WorkbenchPartReference.INTERNAL_PROPERTY_ZOOMED) {
+ setStandby(!ref.getPane().isZoomed());
+ }
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Forces the standby state of the intro part.
+ *
+ * @param standby update the standby state
+ */
+ public void setStandby(final boolean standby) {
+ final Control control = ((PartSite) getSite()).getPane().getControl();
+ BusyIndicator.showWhile(control.getDisplay(), new Runnable() {
+ public void run() {
+ try {
+ control.setRedraw(false);
+ introPart.standbyStateChanged(standby);
+ } finally {
+ control.setRedraw(true);
+ }
+
+ setBarVisibility(standby);
+ }
+ });
+ }
+
+ /**
+ * Toggles handling of zoom events.
+ *
+ * @param handle whether to handle zoom events
+ */
+ public void setHandleZoomEvents(boolean handle) {
+ handleZoomEvents = handle;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+ */
+ public void createPartControl(Composite parent) {
+ addPaneListener();
+ introPart.createPartControl(parent);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#dispose()
+ */
+ public void dispose() {
+ setBarVisibility(true);
+ super.dispose();
+ getSite().getWorkbenchWindow().getWorkbench().getIntroManager()
+ .closeIntro(introPart);
+ introPart.dispose();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ return introPart.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
+ */
+ public Image getTitleImage() {
+ return introPart.getTitleImage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.part.WorkbenchPart#getTitle()
+ */
+ public String getTitle() {
+ // this method is called eagerly before our init method is called (and
+ // therefore before our intropart is created). By default return
+ // the view title from the view declaration. We will fire a property
+ // change to set the title to the proper value in the init method.
+ return introPart == null ? super.getTitle() : introPart.getTitle();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
+ */
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ super.init(site);
+ Workbench workbench = (Workbench) site.getWorkbenchWindow()
+ .getWorkbench();
+ try {
+ introPart = workbench.getWorkbenchIntroManager()
+ .createNewIntroPart();
+ // reset the part name of this view to be that of the intro title
+ setPartName(introPart.getTitle());
+ introPart.addPropertyListener(new IPropertyListener() {
+ public void propertyChanged(Object source, int propId) {
+ firePropertyChange(propId);
+ }
+ });
+ introSite = new ViewIntroAdapterSite(site, workbench
+ .getIntroDescriptor());
+ introPart.init(introSite, memento);
+
+ } catch (CoreException e) {
+ WorkbenchPlugin
+ .log(
+ IntroMessages.get().Intro_could_not_create_proxy, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.get().Intro_could_not_create_proxy, e));
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchPart#setFocus()
+ */
+ public void setFocus() {
+ introPart.setFocus();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IViewPart#saveState(org.eclipse.ui.IMemento)
+ */
+ public void saveState(IMemento memento) {
+ introPart.saveState(memento);
+ }
+
+ /**
+ * Sets whether the CoolBar/PerspectiveBar should be visible.
+ *
+ * @param visible whether the CoolBar/PerspectiveBar should be visible
+ * @since 1.2
+ */
+ private void setBarVisibility(final boolean visible) {
+ WorkbenchWindow window = (WorkbenchWindow) getSite()
+ .getWorkbenchWindow();
+
+ final boolean layout = (visible != window.getCoolBarVisible())
+ || (visible != window.getPerspectiveBarVisible()); // don't layout unless things have actually changed
+ if (visible) {
+ window.setCoolBarVisible(true);
+ window.setPerspectiveBarVisible(true);
+ } else {
+ window.setCoolBarVisible(false);
+ window.setPerspectiveBarVisible(false);
+ }
+
+ if (layout) {
+ window.getShell().layout();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java
index 03b44d1bdc..548e277b48 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewIntroAdapterSite.java
@@ -1,123 +1,122 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.internal;
-//
-//import org.eclipse.jface.viewers.ISelectionProvider;
-//import org.eclipse.swt.widgets.Shell;
-//import org.eclipse.ui.IActionBars;
-//import org.eclipse.ui.IKeyBindingService;
-//import org.eclipse.ui.IViewSite;
-//import org.eclipse.ui.IWorkbenchPage;
-//import org.eclipse.ui.IWorkbenchWindow;
-//import org.eclipse.ui.internal.intro.IntroDescriptor;
-//import org.eclipse.ui.intro.IIntroSite;
-//
-///**
-// * Simple <code>IIntroSite</code> that wraps a <code>IViewSite</code>. For use in conjunction with
-// * <code>ViewIntroAdapterPart</code>.
-// *
-// */
-//final class ViewIntroAdapterSite implements IIntroSite {
-// private IntroDescriptor descriptor;
-//
-// private IViewSite viewSite;
-//
-// public ViewIntroAdapterSite(IViewSite viewSite, IntroDescriptor descriptor) {
-// this.viewSite = viewSite;
-// this.descriptor = descriptor;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroSite#getActionBars()
-// */
-// public IActionBars getActionBars() {
-// return viewSite.getActionBars();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-// */
-// public Object getAdapter(Class adapter) {
-// return viewSite.getAdapter(adapter);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchPartSite#getId()
-// */
-// public String getId() {
-// return descriptor.getId();
-// }
-//
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.internal;
+
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.internal.intro.IntroDescriptor;
+import org.eclipse.ui.intro.IIntroSite;
+
+/**
+ * Simple <code>IIntroSite</code> that wraps a <code>IViewSite</code>. For use in conjunction with
+ * <code>ViewIntroAdapterPart</code>.
+ *
+ */
+final class ViewIntroAdapterSite implements IIntroSite {
+ private IntroDescriptor descriptor;
+
+ private IViewSite viewSite;
+
+ public ViewIntroAdapterSite(IViewSite viewSite, IntroDescriptor descriptor) {
+ this.viewSite = viewSite;
+ this.descriptor = descriptor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroSite#getActionBars()
+ */
+ public IActionBars getActionBars() {
+ return viewSite.getActionBars();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
+ */
+ public Object getAdapter(Class adapter) {
+ return viewSite.getAdapter(adapter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPartSite#getId()
+ */
+ public String getId() {
+ return descriptor.getId();
+ }
+
+ // RAP [bm]: key bindings
// /* (non-Javadoc)
// * @see org.eclipse.ui.IWorkbenchPartSite#getKeyBindingService()
// */
// public IKeyBindingService getKeyBindingService() {
// return viewSite.getKeyBindingService();
// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchSite#getPage()
-// */
-// public IWorkbenchPage getPage() {
-// return viewSite.getPage();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchPartSite#getPluginId()
-// */
-// public String getPluginId() {
-// return descriptor.getPluginId();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchSite#getSelectionProvider()
-// */
-// public ISelectionProvider getSelectionProvider() {
-// return viewSite.getSelectionProvider();
-// }
-//
-// public final Object getService(final Class key) {
-// return viewSite.getService(key);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchSite#getShell()
-// */
-// public Shell getShell() {
-// return viewSite.getShell();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchSite#getWorkbenchWindow()
-// */
-// public IWorkbenchWindow getWorkbenchWindow() {
-// return viewSite.getWorkbenchWindow();
-// }
-//
-// public final boolean hasService(final Class key) {
-// return viewSite.hasService(key);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbenchSite#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
-// */
-// public void setSelectionProvider(ISelectionProvider provider) {
-// viewSite.setSelectionProvider(provider);
-// }
-//
-// /* (non-Javadoc)
-// * @see java.lang.Object#toString()
-// */
-// public String toString() {
-// return viewSite.toString();
-// }
-//}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchSite#getPage()
+ */
+ public IWorkbenchPage getPage() {
+ return viewSite.getPage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchPartSite#getPluginId()
+ */
+ public String getPluginId() {
+ return descriptor.getPluginId();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchSite#getSelectionProvider()
+ */
+ public ISelectionProvider getSelectionProvider() {
+ return viewSite.getSelectionProvider();
+ }
+
+ public final Object getService(final Class key) {
+ return viewSite.getService(key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchSite#getShell()
+ */
+ public Shell getShell() {
+ return viewSite.getShell();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchSite#getWorkbenchWindow()
+ */
+ public IWorkbenchWindow getWorkbenchWindow() {
+ return viewSite.getWorkbenchWindow();
+ }
+
+ public final boolean hasService(final Class key) {
+ return viewSite.hasService(key);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchSite#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
+ */
+ public void setSelectionProvider(ISelectionProvider provider) {
+ viewSite.setSelectionProvider(provider);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return viewSite.toString();
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
index 39bcc2685f..83306af52d 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java
@@ -13,22 +13,51 @@
package org.eclipse.ui.internal;
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.CommandManager;
import org.eclipse.core.commands.contexts.ContextManager;
import org.eclipse.core.databinding.observable.Realm;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionDelta;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IRegistryChangeEvent;
+import org.eclipse.core.runtime.IRegistryChangeListener;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.SafeRunner;
+import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.action.ExternalActionManager.*;
-import org.eclipse.jface.bindings.*;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.ExternalActionManager;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.ExternalActionManager.CommandCallback;
+import org.eclipse.jface.action.ExternalActionManager.IActiveChecker;
+import org.eclipse.jface.action.ExternalActionManager.IExecuteApplicable;
+import org.eclipse.jface.bindings.BindingManager;
+import org.eclipse.jface.bindings.BindingManagerEvent;
+import org.eclipse.jface.bindings.IBindingManagerListener;
import org.eclipse.jface.databinding.swt.SWTObservables;
-import org.eclipse.jface.dialogs.*;
+import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.ModalContext;
import org.eclipse.jface.preference.IPreferenceStore;
@@ -37,20 +66,53 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.OpenStrategy;
import org.eclipse.jface.util.SafeRunnable;
import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.*;
+import org.eclipse.jface.window.IShellProvider;
+import org.eclipse.jface.window.Window;
+import org.eclipse.jface.window.WindowManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rwt.RWT;
+import org.eclipse.rwt.internal.branding.BrandingUtil;
import org.eclipse.rwt.internal.service.ContextProvider;
-import org.eclipse.rwt.service.*;
import org.eclipse.rwt.lifecycle.UICallBack;
import org.eclipse.rwt.service.ISessionStore;
+import org.eclipse.rwt.service.ISettingStore;
import org.eclipse.rwt.service.SessionStoreEvent;
import org.eclipse.rwt.service.SessionStoreListener;
+import org.eclipse.rwt.service.SettingStoreException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IDecoratorManager;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.ILocalWorkingSetManager;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.ISaveableFilter;
+import org.eclipse.ui.ISaveablePart;
+import org.eclipse.ui.ISaveablesLifecycleListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.ISourceProvider;
+import org.eclipse.ui.ISources;
+import org.eclipse.ui.IWindowListener;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchListener;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPreferenceConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.Saveable;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
import org.eclipse.ui.activities.IWorkbenchActivitySupport;
import org.eclipse.ui.application.IWorkbenchConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
@@ -64,27 +126,54 @@ import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
import org.eclipse.ui.internal.actions.CommandAction;
import org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport;
import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
-import org.eclipse.ui.internal.commands.*;
-import org.eclipse.ui.internal.contexts.*;
+import org.eclipse.ui.internal.commands.CommandImageManager;
+import org.eclipse.ui.internal.commands.CommandImageService;
+import org.eclipse.ui.internal.commands.CommandService;
+import org.eclipse.ui.internal.contexts.ActiveContextSourceProvider;
+import org.eclipse.ui.internal.contexts.ContextService;
+import org.eclipse.ui.internal.contexts.WorkbenchContextSupport;
import org.eclipse.ui.internal.dialogs.PropertyPageContributorManager;
+import org.eclipse.ui.internal.intro.IIntroRegistry;
+import org.eclipse.ui.internal.intro.IntroDescriptor;
import org.eclipse.ui.internal.keys.BindingService;
import org.eclipse.ui.internal.menus.FocusControlSourceProvider;
import org.eclipse.ui.internal.menus.WorkbenchMenuService;
-import org.eclipse.ui.internal.misc.*;
+import org.eclipse.ui.internal.misc.Policy;
+import org.eclipse.ui.internal.misc.StatusUtil;
+import org.eclipse.ui.internal.misc.UIStats;
import org.eclipse.ui.internal.model.ContributionService;
import org.eclipse.ui.internal.progress.ProgressManager;
-import org.eclipse.ui.internal.registry.*;
-import org.eclipse.ui.internal.services.*;
+import org.eclipse.ui.internal.registry.IActionSetDescriptor;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.internal.registry.UIExtensionTracker;
+import org.eclipse.ui.internal.services.ActionSetSourceProvider;
+import org.eclipse.ui.internal.services.EvaluationService;
+import org.eclipse.ui.internal.services.IRestrictionService;
+import org.eclipse.ui.internal.services.IServiceLocatorCreator;
+import org.eclipse.ui.internal.services.MenuSourceProvider;
+import org.eclipse.ui.internal.services.ServiceLocator;
+import org.eclipse.ui.internal.services.ServiceLocatorCreator;
+import org.eclipse.ui.internal.services.SourceProviderService;
import org.eclipse.ui.internal.testing.WorkbenchTestable;
-import org.eclipse.ui.internal.themes.*;
-import org.eclipse.ui.internal.tweaklets.*;
-import org.eclipse.ui.internal.util.*;
+import org.eclipse.ui.internal.themes.ColorDefinition;
+import org.eclipse.ui.internal.themes.FontDefinition;
+import org.eclipse.ui.internal.themes.ThemeElementHelper;
+import org.eclipse.ui.internal.themes.WorkbenchThemeManager;
+import org.eclipse.ui.internal.tweaklets.GrabFocus;
+import org.eclipse.ui.internal.tweaklets.Tweaklets;
+import org.eclipse.ui.internal.tweaklets.WorkbenchImplementation;
+import org.eclipse.ui.internal.util.PrefUtil;
+import org.eclipse.ui.internal.util.SessionSingletonEventManager;
+import org.eclipse.ui.internal.util.Util;
+import org.eclipse.ui.intro.IIntroManager;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.menus.IMenuService;
import org.eclipse.ui.model.IContributionService;
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
import org.eclipse.ui.progress.IProgressService;
-import org.eclipse.ui.services.*;
+import org.eclipse.ui.services.IDisposable;
+import org.eclipse.ui.services.IEvaluationService;
+import org.eclipse.ui.services.ISourceProviderService;
import org.eclipse.ui.swt.IFocusService;
import org.eclipse.ui.themes.IThemeManager;
import org.eclipse.ui.views.IViewRegistry;
@@ -1260,16 +1349,22 @@ public final class Workbench extends SessionSingletonEventManager implements IWo
// create workbench window manager
windowManager = new WindowManager();
-// RAP [rh] Intro mechanism not supported
-// IIntroRegistry introRegistry = WorkbenchPlugin.getDefault()
-// .getIntroRegistry();
-// if (introRegistry.getIntroCount() > 0) {
+ IIntroRegistry introRegistry = WorkbenchPlugin.getDefault()
+ .getIntroRegistry();
+ if (introRegistry.getIntroCount() > 0) {
+ // RAP [bm]: no product support - use branding instead
// IProduct product = Platform.getProduct();
// if (product != null) {
// introDescriptor = (IntroDescriptor) introRegistry
// .getIntroForProduct(product.getId());
// }
-// }
+ String brandingId = BrandingUtil.getCurrentBrandingId();
+ if (brandingId != null) {
+ introDescriptor = (IntroDescriptor) introRegistry
+ .getIntroForBranding(brandingId);
+ }
+ // ENDRAP
+ }
// TODO Correctly order service initialization
// there needs to be some serious consideration given to
@@ -3036,54 +3131,53 @@ public final class Workbench extends SessionSingletonEventManager implements IWo
private ActivityPersistanceHelper activityHelper;
-// RAP [rh] Intro mechanism not supported
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.IWorkbench#getIntroManager()
-// */
-// public IIntroManager getIntroManager() {
-// return getWorkbenchIntroManager();
-// }
-//
-// /**
-// * @return the workbench intro manager
-// */
-// /* package */WorkbenchIntroManager getWorkbenchIntroManager() {
-// if (introManager == null) {
-// introManager = new WorkbenchIntroManager(this);
-// }
-// return introManager;
-// }
-//
-// private WorkbenchIntroManager introManager;
-//
-// /**
-// * @return the intro extension for this workbench.
-// */
-// public IntroDescriptor getIntroDescriptor() {
-// return introDescriptor;
-// }
-//
-// /**
-// * This method exists as a test hook. This method should <strong>NEVER</strong>
-// * be called by clients.
-// *
-// * @param descriptor
-// * The intro descriptor to use.
-// */
-// public void setIntroDescriptor(IntroDescriptor descriptor) {
-// if (getIntroManager().getIntro() != null) {
-// getIntroManager().closeIntro(getIntroManager().getIntro());
-// }
-// introDescriptor = descriptor;
-// }
-//
-// /**
-// * The descriptor for the intro extension that is valid for this workspace,
-// * <code>null</code> if none.
-// */
-// private IntroDescriptor introDescriptor;
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbench#getIntroManager()
+ */
+ public IIntroManager getIntroManager() {
+ return getWorkbenchIntroManager();
+ }
+
+ /**
+ * @return the workbench intro manager
+ */
+ /* package */WorkbenchIntroManager getWorkbenchIntroManager() {
+ if (introManager == null) {
+ introManager = new WorkbenchIntroManager(this);
+ }
+ return introManager;
+ }
+
+ private WorkbenchIntroManager introManager;
+
+ /**
+ * @return the intro extension for this workbench.
+ */
+ public IntroDescriptor getIntroDescriptor() {
+ return introDescriptor;
+ }
+
+ /**
+ * This method exists as a test hook. This method should <strong>NEVER</strong>
+ * be called by clients.
+ *
+ * @param descriptor
+ * The intro descriptor to use.
+ */
+ public void setIntroDescriptor(IntroDescriptor descriptor) {
+ if (getIntroManager().getIntro() != null) {
+ getIntroManager().closeIntro(getIntroManager().getIntro());
+ }
+ introDescriptor = descriptor;
+ }
+
+ /**
+ * The descriptor for the intro extension that is valid for this workspace,
+ * <code>null</code> if none.
+ */
+ private IntroDescriptor introDescriptor;
private IExtensionTracker tracker;
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
index 3038d68288..44f8043ee0 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchIntroManager.java
@@ -1,302 +1,301 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 2007 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.eclipse.ui.internal;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.core.runtime.IExtension;
-//import org.eclipse.core.runtime.IStatus;
-//import org.eclipse.core.runtime.Status;
-//import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler;
-//import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
-//import org.eclipse.ui.IPerspectiveDescriptor;
-//import org.eclipse.ui.IViewPart;
-//import org.eclipse.ui.IViewReference;
-//import org.eclipse.ui.IWorkbenchPage;
-//import org.eclipse.ui.IWorkbenchWindow;
-//import org.eclipse.ui.PartInitException;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
-//import org.eclipse.ui.internal.intro.IntroDescriptor;
-//import org.eclipse.ui.internal.intro.IntroMessages;
-//import org.eclipse.ui.intro.IIntroManager;
-//import org.eclipse.ui.intro.IIntroPart;
-//import org.eclipse.ui.intro.IntroContentDetector;
-//
-///**
-// * Workbench implementation of the IIntroManager interface.
-// *
-// * @since 3.0
-// */
-//public class WorkbenchIntroManager implements IIntroManager {
-//
-// private final Workbench workbench;
-//
-// /**
-// * Create a new instance of the receiver.
-// *
-// * @param workbench the workbench instance
-// */
-// WorkbenchIntroManager(Workbench workbench) {
-// this.workbench = workbench;
-// workbench.getExtensionTracker().registerHandler(new IExtensionChangeHandler(){
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler#addExtension(org.eclipse.core.runtime.dynamicHelpers.IExtensionTracker, org.eclipse.core.runtime.IExtension)
-// */
-// public void addExtension(IExtensionTracker tracker,IExtension extension) {
-// //Do nothing
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler#removeExtension(org.eclipse.core.runtime.IExtension, java.lang.Object[])
-// */
-// public void removeExtension(IExtension source, Object[] objects) {
-// for (int i = 0; i < objects.length; i++) {
-// if (objects[i] instanceof IIntroPart) {
-// closeIntro((IIntroPart) objects[i]);
-// }
-// }
-//
-// }}, null);
-//
-// }
-//
-// /**
-// * The currently active introPart in this workspace, <code>null</code> if none.
-// */
-// private IIntroPart introPart;
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbench#closeIntro(org.eclipse.ui.intro.IIntroPart)
-// */
-// public boolean closeIntro(IIntroPart part) {
-// if (introPart == null || !introPart.equals(part)) {
-// return false;
-// }
-//
-// IViewPart introView = getViewIntroAdapterPart();
-// if (introView != null) {
-// //assumption is that there is only ever one intro per workbench
-// //if we ever support one per window then this will need revisiting
-// IWorkbenchPage page = introView.getSite().getPage();
-// IViewReference reference = page
-// .findViewReference(IIntroConstants.INTRO_VIEW_ID);
-// page.hideView(introView);
-// if (reference == null || reference.getPart(false) == null) {
-// introPart = null;
-// return true;
-// }
-// return false;
-// }
-//
-// // if there is no part then null our reference
-// introPart = null;
-//
-// return true;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbench#showIntro(org.eclipse.ui.IWorkbenchWindow)
-// */
-// public IIntroPart showIntro(IWorkbenchWindow preferredWindow,
-// boolean standby) {
-// if (preferredWindow == null) {
-// preferredWindow = this.workbench.getActiveWorkbenchWindow();
-// }
-//
-// if (preferredWindow == null) {
-// return null;
-// }
-//
-// ViewIntroAdapterPart viewPart = getViewIntroAdapterPart();
-// if (viewPart == null) {
-// createIntro(preferredWindow);
-// } else {
-// try {
-// IWorkbenchPage page = viewPart.getSite().getPage();
-// IWorkbenchWindow window = page.getWorkbenchWindow();
-// if (!window.equals(preferredWindow)) {
-// window.getShell().setActive();
-// }
-//
-// page.showView(IIntroConstants.INTRO_VIEW_ID);
-// } catch (PartInitException e) {
-// WorkbenchPlugin
-// .log(
-// "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$
-// }
-// }
-// setIntroStandby(introPart, standby);
-// return introPart;
-// }
-//
-// /**
-// * @param testWindow the window to test
-// * @return whether the intro exists in the given window
-// */
-// /*package*/boolean isIntroInWindow(IWorkbenchWindow testWindow) {
-// ViewIntroAdapterPart viewPart = getViewIntroAdapterPart();
-// if (viewPart == null) {
-// return false;
-// }
-//
-// IWorkbenchWindow window = viewPart.getSite().getWorkbenchWindow();
-// if (window.equals(testWindow)) {
-// return true;
-// }
-// return false;
-// }
-//
-// /**
-// * Create a new Intro area (a view, currently) in the provided window. If there is no intro
-// * descriptor for this workbench then no work is done.
-// *
-// * @param preferredWindow the window to create the intro in.
-// */
-// private void createIntro(IWorkbenchWindow preferredWindow) {
-// if (this.workbench.getIntroDescriptor() == null) {
-// return;
-// }
-//
-// IWorkbenchPage workbenchPage = preferredWindow.getActivePage();
-// if (workbenchPage == null) {
-// return;
-// }
-// try {
-// workbenchPage.showView(IIntroConstants.INTRO_VIEW_ID);
-// } catch (PartInitException e) {
-// WorkbenchPlugin
-// .log(
-// IntroMessages.Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.Intro_could_not_create_part, e));
-// }
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbench#setIntroStandby(org.eclipse.ui.intro.IIntroPart, boolean)
-// */
-// public void setIntroStandby(IIntroPart part, boolean standby) {
-// if (introPart == null || !introPart.equals(part)) {
-// return;
-// }
-//
-// ViewIntroAdapterPart viewIntroAdapterPart = getViewIntroAdapterPart();
-// if (viewIntroAdapterPart == null) {
-// return;
-// }
-//
-// PartPane pane = ((PartSite) viewIntroAdapterPart.getSite()).getPane();
-// if (standby == !pane.isZoomed()) {
-// // the zoom state is already correct - just update the part's state.
-// viewIntroAdapterPart.setStandby(standby);
-// return;
-// }
-//
-// viewIntroAdapterPart.getSite().getPage().toggleZoom(
-// pane.getPartReference());
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.IWorkbench#isIntroStandby(org.eclipse.ui.intro.IIntroPart)
-// */
-// public boolean isIntroStandby(IIntroPart part) {
-// if (introPart == null || !introPart.equals(part)) {
-// return false;
-// }
-//
-// ViewIntroAdapterPart viewIntroAdapterPart = getViewIntroAdapterPart();
-// if (viewIntroAdapterPart == null) {
-// return false;
-// }
-//
-// return !((PartSite) viewIntroAdapterPart.getSite()).getPane()
-// .isZoomed();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbench#findIntro()
-// */
-// public IIntroPart getIntro() {
-// return introPart;
-// }
-//
-// /**
-// * @return the <code>ViewIntroAdapterPart</code> for this workbench, <code>null</code> if it
-// * cannot be found.
-// */
-// /*package*/ViewIntroAdapterPart getViewIntroAdapterPart() {
-// IWorkbenchWindow[] windows = this.workbench.getWorkbenchWindows();
-// for (int i = 0; i < windows.length; i++) {
-// IWorkbenchWindow window = windows[i];
-// WorkbenchPage page = (WorkbenchPage) window.getActivePage();
-// if (page == null) {
-// continue;
-// }
-// IPerspectiveDescriptor[] perspDescs = page.getOpenPerspectives();
-// for (int j = 0; j < perspDescs.length; j++) {
-// IPerspectiveDescriptor descriptor = perspDescs[j];
-// IViewReference reference = page.findPerspective(descriptor)
-// .findView(IIntroConstants.INTRO_VIEW_ID);
-// if (reference != null) {
-// IViewPart part = reference.getView(false);
-// if (part != null && part instanceof ViewIntroAdapterPart) {
-// return (ViewIntroAdapterPart) part;
-// }
-// }
-// }
-// }
-// return null;
-// }
-//
-// /**
-// * @return a new IIntroPart. This has the side effect of setting the introPart field to the new
-// * value.
-// */
-// /*package*/IIntroPart createNewIntroPart() throws CoreException {
-// IntroDescriptor introDescriptor = workbench.getIntroDescriptor();
-// introPart = introDescriptor == null ? null
-// : introDescriptor.createIntro();
-// if (introPart != null) {
-// workbench.getExtensionTracker().registerObject(
-// introDescriptor.getConfigurationElement()
-// .getDeclaringExtension(), introPart,
-// IExtensionTracker.REF_WEAK);
-// }
-// return introPart;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IWorkbench#hasIntro()
-// */
-// public boolean hasIntro() {
-// return workbench.getIntroDescriptor() != null;
-// }
-//
-// public boolean isNewContentAvailable() {
-// IntroDescriptor introDescriptor = workbench.getIntroDescriptor();
-// if (introDescriptor == null) {
-// return false;
-// }
-// try {
-// IntroContentDetector contentDetector = introDescriptor
-// .getIntroContentDetector();
-// if (contentDetector != null) {
-// return contentDetector.isNewContentAvailable();
-// }
-// } catch (CoreException ex) {
-// WorkbenchPlugin.log(new Status(IStatus.WARNING,
-// WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING,
-// "Could not load intro content detector", ex)); //$NON-NLS-1$
-// }
-// return false;
-// }
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.eclipse.ui.internal;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler;
+import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IViewReference;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IntroDescriptor;
+import org.eclipse.ui.internal.intro.IntroMessages;
+import org.eclipse.ui.intro.IIntroManager;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.intro.IntroContentDetector;
+
+/**
+ * Workbench implementation of the IIntroManager interface.
+ *
+ * @since 1.2
+ */
+public class WorkbenchIntroManager implements IIntroManager {
+
+ private final Workbench workbench;
+
+ /**
+ * Create a new instance of the receiver.
+ *
+ * @param workbench the workbench instance
+ */
+ WorkbenchIntroManager(Workbench workbench) {
+ this.workbench = workbench;
+ workbench.getExtensionTracker().registerHandler(new IExtensionChangeHandler(){
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler#addExtension(org.eclipse.core.runtime.dynamicHelpers.IExtensionTracker, org.eclipse.core.runtime.IExtension)
+ */
+ public void addExtension(IExtensionTracker tracker,IExtension extension) {
+ //Do nothing
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.dynamicHelpers.IExtensionChangeHandler#removeExtension(org.eclipse.core.runtime.IExtension, java.lang.Object[])
+ */
+ public void removeExtension(IExtension source, Object[] objects) {
+ for (int i = 0; i < objects.length; i++) {
+ if (objects[i] instanceof IIntroPart) {
+ closeIntro((IIntroPart) objects[i]);
+ }
+ }
+
+ }}, null);
+
+ }
+
+ /**
+ * The currently active introPart in this workspace, <code>null</code> if none.
+ */
+ private IIntroPart introPart;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbench#closeIntro(org.eclipse.ui.intro.IIntroPart)
+ */
+ public boolean closeIntro(IIntroPart part) {
+ if (introPart == null || !introPart.equals(part)) {
+ return false;
+ }
+
+ IViewPart introView = getViewIntroAdapterPart();
+ if (introView != null) {
+ //assumption is that there is only ever one intro per workbench
+ //if we ever support one per window then this will need revisiting
+ IWorkbenchPage page = introView.getSite().getPage();
+ IViewReference reference = page
+ .findViewReference(IIntroConstants.INTRO_VIEW_ID);
+ page.hideView(introView);
+ if (reference == null || reference.getPart(false) == null) {
+ introPart = null;
+ return true;
+ }
+ return false;
+ }
+
+ // if there is no part then null our reference
+ introPart = null;
+
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbench#showIntro(org.eclipse.ui.IWorkbenchWindow)
+ */
+ public IIntroPart showIntro(IWorkbenchWindow preferredWindow,
+ boolean standby) {
+ if (preferredWindow == null) {
+ preferredWindow = this.workbench.getActiveWorkbenchWindow();
+ }
+
+ if (preferredWindow == null) {
+ return null;
+ }
+
+ ViewIntroAdapterPart viewPart = getViewIntroAdapterPart();
+ if (viewPart == null) {
+ createIntro(preferredWindow);
+ } else {
+ try {
+ IWorkbenchPage page = viewPart.getSite().getPage();
+ IWorkbenchWindow window = page.getWorkbenchWindow();
+ if (!window.equals(preferredWindow)) {
+ window.getShell().setActive();
+ }
+
+ page.showView(IIntroConstants.INTRO_VIEW_ID);
+ } catch (PartInitException e) {
+ WorkbenchPlugin
+ .log(
+ "Could not open intro", new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, "Could not open intro", e)); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ setIntroStandby(introPart, standby);
+ return introPart;
+ }
+
+ /**
+ * @param testWindow the window to test
+ * @return whether the intro exists in the given window
+ */
+ /*package*/boolean isIntroInWindow(IWorkbenchWindow testWindow) {
+ ViewIntroAdapterPart viewPart = getViewIntroAdapterPart();
+ if (viewPart == null) {
+ return false;
+ }
+
+ IWorkbenchWindow window = viewPart.getSite().getWorkbenchWindow();
+ if (window.equals(testWindow)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Create a new Intro area (a view, currently) in the provided window. If there is no intro
+ * descriptor for this workbench then no work is done.
+ *
+ * @param preferredWindow the window to create the intro in.
+ */
+ private void createIntro(IWorkbenchWindow preferredWindow) {
+ if (this.workbench.getIntroDescriptor() == null) {
+ return;
+ }
+
+ IWorkbenchPage workbenchPage = preferredWindow.getActivePage();
+ if (workbenchPage == null) {
+ return;
+ }
+ try {
+ workbenchPage.showView(IIntroConstants.INTRO_VIEW_ID);
+ } catch (PartInitException e) {
+ WorkbenchPlugin
+ .log(
+ IntroMessages.get().Intro_could_not_create_part, new Status(IStatus.ERROR, WorkbenchPlugin.PI_WORKBENCH, IStatus.ERROR, IntroMessages.get().Intro_could_not_create_part, e));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbench#setIntroStandby(org.eclipse.ui.intro.IIntroPart, boolean)
+ */
+ public void setIntroStandby(IIntroPart part, boolean standby) {
+ if (introPart == null || !introPart.equals(part)) {
+ return;
+ }
+
+ ViewIntroAdapterPart viewIntroAdapterPart = getViewIntroAdapterPart();
+ if (viewIntroAdapterPart == null) {
+ return;
+ }
+
+ PartPane pane = ((PartSite) viewIntroAdapterPart.getSite()).getPane();
+ if (standby == !pane.isZoomed()) {
+ // the zoom state is already correct - just update the part's state.
+ viewIntroAdapterPart.setStandby(standby);
+ return;
+ }
+
+ viewIntroAdapterPart.getSite().getPage().toggleZoom(
+ pane.getPartReference());
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbench#isIntroStandby(org.eclipse.ui.intro.IIntroPart)
+ */
+ public boolean isIntroStandby(IIntroPart part) {
+ if (introPart == null || !introPart.equals(part)) {
+ return false;
+ }
+
+ ViewIntroAdapterPart viewIntroAdapterPart = getViewIntroAdapterPart();
+ if (viewIntroAdapterPart == null) {
+ return false;
+ }
+
+ return !((PartSite) viewIntroAdapterPart.getSite()).getPane()
+ .isZoomed();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbench#findIntro()
+ */
+ public IIntroPart getIntro() {
+ return introPart;
+ }
+
+ /**
+ * @return the <code>ViewIntroAdapterPart</code> for this workbench, <code>null</code> if it
+ * cannot be found.
+ */
+ /*package*/ViewIntroAdapterPart getViewIntroAdapterPart() {
+ IWorkbenchWindow[] windows = this.workbench.getWorkbenchWindows();
+ for (int i = 0; i < windows.length; i++) {
+ IWorkbenchWindow window = windows[i];
+ WorkbenchPage page = (WorkbenchPage) window.getActivePage();
+ if (page == null) {
+ continue;
+ }
+ IPerspectiveDescriptor[] perspDescs = page.getOpenPerspectives();
+ for (int j = 0; j < perspDescs.length; j++) {
+ IPerspectiveDescriptor descriptor = perspDescs[j];
+ IViewReference reference = page.findPerspective(descriptor)
+ .findView(IIntroConstants.INTRO_VIEW_ID);
+ if (reference != null) {
+ IViewPart part = reference.getView(false);
+ if (part != null && part instanceof ViewIntroAdapterPart) {
+ return (ViewIntroAdapterPart) part;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ /**
+ * @return a new IIntroPart. This has the side effect of setting the introPart field to the new
+ * value.
+ */
+ /*package*/IIntroPart createNewIntroPart() throws CoreException {
+ IntroDescriptor introDescriptor = workbench.getIntroDescriptor();
+ introPart = introDescriptor == null ? null
+ : introDescriptor.createIntro();
+ if (introPart != null) {
+ workbench.getExtensionTracker().registerObject(
+ introDescriptor.getConfigurationElement()
+ .getDeclaringExtension(), introPart,
+ IExtensionTracker.REF_WEAK);
+ }
+ return introPart;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbench#hasIntro()
+ */
+ public boolean hasIntro() {
+ return workbench.getIntroDescriptor() != null;
+ }
+
+ public boolean isNewContentAvailable() {
+ IntroDescriptor introDescriptor = workbench.getIntroDescriptor();
+ if (introDescriptor == null) {
+ return false;
+ }
+ try {
+ IntroContentDetector contentDetector = introDescriptor
+ .getIntroContentDetector();
+ if (contentDetector != null) {
+ return contentDetector.isNewContentAvailable();
+ }
+ } catch (CoreException ex) {
+ WorkbenchPlugin.log(new Status(IStatus.WARNING,
+ WorkbenchPlugin.PI_WORKBENCH, IStatus.WARNING,
+ "Could not load intro content detector", ex)); //$NON-NLS-1$
+ }
+ return false;
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
index db959bbe8e..e384a92baa 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java
@@ -92,7 +92,7 @@ import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
import org.eclipse.ui.internal.contexts.ContextAuthority;
import org.eclipse.ui.internal.dialogs.CustomizePerspectiveDialog;
import org.eclipse.ui.internal.dnd.SwtUtil;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.internal.misc.UIListenerLogging;
import org.eclipse.ui.internal.misc.UIStats;
import org.eclipse.ui.internal.registry.ActionSetRegistry;
@@ -862,17 +862,15 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
*/
private void busyResetPerspective() {
-// RAP [rh] Intro mechanism not supported
-// ViewIntroAdapterPart introViewAdapter = ((WorkbenchIntroManager) getWorkbenchWindow()
-// .getWorkbench().getIntroManager()).getViewIntroAdapterPart();
-// PartPane introPane = null;
+ ViewIntroAdapterPart introViewAdapter = ((WorkbenchIntroManager) getWorkbenchWindow()
+ .getWorkbench().getIntroManager()).getViewIntroAdapterPart();
+ PartPane introPane = null;
boolean introFullScreen = false;
-// RAP [rh] Intro mechanism not supported
-// if (introViewAdapter != null) {
-// introPane = ((PartSite) introViewAdapter.getSite()).getPane();
-// introViewAdapter.setHandleZoomEvents(false);
-// introFullScreen = introPane.isZoomed();
-// }
+ if (introViewAdapter != null) {
+ introPane = ((PartSite) introViewAdapter.getSite()).getPane();
+ introViewAdapter.setHandleZoomEvents(false);
+ introFullScreen = introPane.isZoomed();
+ }
//try to prevent intro flicker.
if (introFullScreen) {
@@ -934,32 +932,30 @@ public class WorkbenchPage extends CompatibleWorkbenchPage implements
// Update the Coolbar layout.
resetToolBarLayout();
-// RAP [rh] Intro mechanism not supported
-// // restore the maximized intro
-// if (introViewAdapter != null) {
-// try {
-// // ensure that the intro is visible in the new perspective
-// showView(IIntroConstants.INTRO_VIEW_ID);
-// if (introFullScreen) {
-// toggleZoom(introPane.getPartReference());
-// }
-// } catch (PartInitException e) {
-// WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$
-// WorkbenchPlugin.getStatus(e));
-// } finally {
-// // we want the intro back to a normal state before we fire the event
-// introViewAdapter.setHandleZoomEvents(true);
-// }
-// }
+ // restore the maximized intro
+ if (introViewAdapter != null) {
+ try {
+ // ensure that the intro is visible in the new perspective
+ showView(IIntroConstants.INTRO_VIEW_ID);
+ if (introFullScreen) {
+ toggleZoom(introPane.getPartReference());
+ }
+ } catch (PartInitException e) {
+ WorkbenchPlugin.log("Could not restore intro", //$NON-NLS-1$
+ WorkbenchPlugin.getStatus(e));
+ } finally {
+ // we want the intro back to a normal state before we fire the event
+ introViewAdapter.setHandleZoomEvents(true);
+ }
+ }
// Notify listeners that we have completed our reset.
window.firePerspectiveChanged(this, desc, CHANGE_RESET_COMPLETE);
} finally {
-// RAP [rh] Intro mechanism not supported
-// // reset the handling of zoom events (possibly for the second time) in case there was
-// // an exception thrown
-// if (introViewAdapter != null) {
-// introViewAdapter.setHandleZoomEvents(true);
-// }
+ // reset the handling of zoom events (possibly for the second time) in case there was
+ // an exception thrown
+ if (introViewAdapter != null) {
+ introViewAdapter.setHandleZoomEvents(true);
+ }
if (introFullScreen) {
window.getShell().setRedraw(true);
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
index 2cd25b0944..ca41a0c75b 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPlugin.java
@@ -16,7 +16,13 @@ import java.io.OutputStream;
import java.util.Collection;
import java.util.HashSet;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
import org.eclipse.equinox.http.registry.HttpContextExtensionService;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceManager;
@@ -29,25 +35,49 @@ import org.eclipse.rap.ui.internal.servlet.HttpServiceTracker;
import org.eclipse.rwt.SessionSingletonBase;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.ui.*;
+import org.eclipse.ui.IEditorRegistry;
+import org.eclipse.ui.IElementFactory;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.StartupThreading.StartupRunnable;
import org.eclipse.ui.internal.decorators.DecoratorManager;
import org.eclipse.ui.internal.dialogs.WorkbenchPreferenceManager;
+import org.eclipse.ui.internal.intro.IIntroRegistry;
+import org.eclipse.ui.internal.intro.IntroRegistry;
import org.eclipse.ui.internal.misc.StatusUtil;
import org.eclipse.ui.internal.operations.WorkbenchOperationSupport;
import org.eclipse.ui.internal.progress.JobManagerAdapter;
import org.eclipse.ui.internal.progress.ProgressManager;
-import org.eclipse.ui.internal.registry.*;
-import org.eclipse.ui.internal.themes.*;
+import org.eclipse.ui.internal.registry.ActionSetRegistry;
+import org.eclipse.ui.internal.registry.EditorRegistry;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.internal.registry.PerspectiveRegistry;
+import org.eclipse.ui.internal.registry.PreferencePageRegistryReader;
+import org.eclipse.ui.internal.registry.ViewRegistry;
+import org.eclipse.ui.internal.registry.WorkingSetRegistry;
+import org.eclipse.ui.internal.themes.IThemeRegistry;
+import org.eclipse.ui.internal.themes.ThemeRegistry;
+import org.eclipse.ui.internal.themes.ThemeRegistryReader;
import org.eclipse.ui.internal.util.BundleUtility;
import org.eclipse.ui.internal.util.SWTResourceUtil;
-import org.eclipse.ui.internal.wizards.*;
+import org.eclipse.ui.internal.wizards.ExportWizardRegistry;
+import org.eclipse.ui.internal.wizards.ImportWizardRegistry;
+import org.eclipse.ui.internal.wizards.NewWizardRegistry;
import org.eclipse.ui.operations.IWorkbenchOperationSupport;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.ui.presentations.AbstractPresentationFactory;
import org.eclipse.ui.views.IViewRegistry;
import org.eclipse.ui.wizards.IWizardRegistry;
-import org.osgi.framework.*;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.framework.BundleListener;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+import org.osgi.framework.SynchronousBundleListener;
import org.osgi.util.tracker.ServiceTracker;
import com.ibm.icu.text.MessageFormat;
@@ -268,7 +298,7 @@ public class WorkbenchPlugin extends AbstractUIPlugin {
*/
private ProductInfo productInfo = null;
-// RAP [rh] Intro mechanism not supported
+ // RAP [bm]: not needed
// private IntroRegistry introRegistry;
private WorkbenchOperationSupport operationSupport;
@@ -329,7 +359,7 @@ public class WorkbenchPlugin extends AbstractUIPlugin {
sharedImages = null;
productInfo = null;
-// RAP [rh] Intro mechanism not supported
+ // RAP [bm]: not needed
// introRegistry = null;
if (operationSupport != null) {
@@ -738,19 +768,20 @@ public class WorkbenchPlugin extends AbstractUIPlugin {
return WorkingSetRegistryStore.getInstance().getWorkingSetRegistry();
}
-// RAP [rh] Intro mechanism not supported
-// /**
-// * Returns the introduction registry.
-// *
-// * @return the introduction registry.
-// * @since 1.1
-// */
-// public IIntroRegistry getIntroRegistry() {
+ /**
+ * Returns the introduction registry.
+ *
+ * @return the introduction registry.
+ * @since 1.2
+ */
+ public IIntroRegistry getIntroRegistry() {
+ // RAP [bm]: IntroRegistry must be a session-singleton
// if (introRegistry == null) {
// introRegistry = new IntroRegistry();
// }
// return introRegistry;
-// }
+ return (IIntroRegistry) SessionSingletonBase.getInstance(IntroRegistry.class);
+ }
/**
* Returns the operation support.
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
index ff0c5b7140..1c097b2ff8 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java
@@ -105,7 +105,7 @@ import org.eclipse.ui.internal.dialogs.CustomizePerspectiveDialog;
import org.eclipse.ui.internal.dnd.SwtUtil;
import org.eclipse.ui.internal.handlers.ActionCommandMappingService;
import org.eclipse.ui.internal.handlers.IActionCommandMappingService;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.internal.layout.CacheWrapper;
import org.eclipse.ui.internal.layout.ITrimManager;
import org.eclipse.ui.internal.layout.IWindowTrim;
@@ -733,8 +733,7 @@ public class WorkbenchWindow extends ApplicationWindow implements
showEmptyWindowContents();
}
fireWindowCreated();
-// RAP [rh] Intro mechanism not supported
-// getWindowAdvisor().openIntro();
+ getWindowAdvisor().openIntro();
int result = super.open();
// It's time for a layout ... to insure that if TrimLayout
@@ -2125,25 +2124,24 @@ public class WorkbenchWindow extends ApplicationWindow implements
}});
-// RAP [rh] Intro mechanism not supported
-// final IMemento introMem = memento.getChild(IWorkbenchConstants.TAG_INTRO);
-// if (introMem != null) {
-// StartupThreading.runWithoutExceptions(new StartupRunnable() {
-//
-// public void runWithException() throws Throwable {
-// getWorkbench()
-// .getIntroManager()
-// .showIntro(
-// WorkbenchWindow.this,
-// Boolean
-// .valueOf(
-// introMem
-// .getString(IWorkbenchConstants.TAG_STANDBY))
-// .booleanValue());
-// }
-// });
-//
-// }
+ final IMemento introMem = memento.getChild(IWorkbenchConstants.TAG_INTRO);
+ if (introMem != null) {
+ StartupThreading.runWithoutExceptions(new StartupRunnable() {
+
+ public void runWithException() throws Throwable {
+ getWorkbench()
+ .getIntroManager()
+ .showIntro(
+ WorkbenchWindow.this,
+ Boolean
+ .valueOf(
+ introMem
+ .getString(IWorkbenchConstants.TAG_STANDBY))
+ .booleanValue());
+ }
+ });
+
+ }
// Only restore the trim state if we're using the default layout
if (defaultLayout != null) {
@@ -2507,18 +2505,17 @@ public class WorkbenchWindow extends ApplicationWindow implements
memento.putInteger(IWorkbenchConstants.TAG_WIDTH, normalBounds.width);
memento.putInteger(IWorkbenchConstants.TAG_HEIGHT, normalBounds.height);
-// RAP [rh] Intro mechanism not supported
-// IWorkbenchPage activePage = getActivePage();
-// if (activePage != null
-// && activePage.findView(IIntroConstants.INTRO_VIEW_ID) != null) {
-// IMemento introMem = memento
-// .createChild(IWorkbenchConstants.TAG_INTRO);
-// boolean isStandby = getWorkbench()
-// .getIntroManager()
-// .isIntroStandby(getWorkbench().getIntroManager().getIntro());
-// introMem.putString(IWorkbenchConstants.TAG_STANDBY, String
-// .valueOf(isStandby));
-// }
+ IWorkbenchPage activePage = getActivePage();
+ if (activePage != null
+ && activePage.findView(IIntroConstants.INTRO_VIEW_ID) != null) {
+ IMemento introMem = memento
+ .createChild(IWorkbenchConstants.TAG_INTRO);
+ boolean isStandby = getWorkbench()
+ .getIntroManager()
+ .isIntroStandby(getWorkbench().getIntroManager().getIntro());
+ introMem.putString(IWorkbenchConstants.TAG_STANDBY, String
+ .valueOf(isStandby));
+ }
// save the width of the perspective bar
IMemento persBarMem = memento
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
index 3765e9bb6d..7cc51a1970 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/CustomizePerspectiveDialog.java
@@ -96,7 +96,7 @@ import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.WorkbenchWindow;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.internal.provisional.application.IActionBarConfigurer2;
import org.eclipse.ui.internal.registry.ActionSetDescriptor;
import org.eclipse.ui.internal.registry.ActionSetRegistry;
@@ -1653,10 +1653,9 @@ public class CustomizePerspectiveDialog extends TrayDialog {
if (views != null) {
for (int j = 0; j < views.length; j++) {
IViewDescriptor view = views[j];
-// RAP [rh] Intro mechanism not supported
-// if (view.getId().equals(IIntroConstants.INTRO_VIEW_ID)) {
-// continue;
-// }
+ if (view.getId().equals(IIntroConstants.INTRO_VIEW_ID)) {
+ continue;
+ }
if (WorkbenchActivityHelper.filterItem(view)) {
continue;
}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java
index 0c26cea79a..f56bf12602 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/ViewContentProvider.java
@@ -12,13 +12,13 @@ package org.eclipse.ui.internal.dialogs;
import java.util.ArrayList;
import java.util.HashMap;
-//import java.util.Iterator;
+import java.util.Iterator;
import java.util.Map;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.activities.WorkbenchActivityHelper;
-//import org.eclipse.ui.internal.intro.IIntroConstants;
+import org.eclipse.ui.internal.intro.IIntroConstants;
import org.eclipse.ui.views.IViewCategory;
import org.eclipse.ui.views.IViewDescriptor;
import org.eclipse.ui.views.IViewRegistry;
@@ -116,13 +116,12 @@ public class ViewContentProvider implements ITreeContentProvider {
* @return the modified list.
*/
private ArrayList removeIntroView(ArrayList list) {
-// RAP [rh] Intro mechanism not supported
-// for (Iterator i = list.iterator(); i.hasNext();) {
-// IViewDescriptor view = (IViewDescriptor) i.next();
-// if (view.getId().equals(IIntroConstants.INTRO_VIEW_ID)) {
-// i.remove();
-// }
-// }
+ for (Iterator i = list.iterator(); i.hasNext();) {
+ IViewDescriptor view = (IViewDescriptor) i.next();
+ if (view.getId().equals(IIntroConstants.INTRO_VIEW_ID)) {
+ i.remove();
+ }
+ }
return list;
}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java
index f6c1a9dc5a..6d95be5e9e 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroConstants.java
@@ -1,26 +1,23 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.internal.intro;
-//
-///**
-// * Contains constants used by the intro implementation
-// *
-// * @since 3.0
-// */
-//public interface IIntroConstants {
-//
-// /**
-// * The id of the view that is used as the intro host.
-// */
-// public static final String INTRO_VIEW_ID = "org.eclipse.ui.internal.introview"; //$NON-NLS-1$
-//
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.internal.intro;
+
+/**
+ * Contains constants used by the intro implementation
+ */
+public interface IIntroConstants {
+
+ /**
+ * The id of the view that is used as the intro host.
+ */
+ public static final String INTRO_VIEW_ID = "org.eclipse.ui.internal.introview"; //$NON-NLS-1$
+
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java
index 841fd4333d..3bd17c4ca1 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroDescriptor.java
@@ -1,52 +1,48 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.internal.intro;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.jface.resource.ImageDescriptor;
-//import org.eclipse.ui.intro.IIntroPart;
-//
-///**
-// * Describes an introduction extension.
-// *
-// * @since 3.0
-// */
-//public interface IIntroDescriptor {
-//
-// /**
-// * Creates an instance of the intro part defined in the descriptor.
-// */
-// IIntroPart createIntro() throws CoreException;
-//
-// /**
-// * Returns the part id.
-// *
-// * @return the id of the part
-// */
-// public String getId();
-//
-// /**
-// * Returns the descriptor of the image for this part.
-// *
-// * @return the descriptor of the image to display next to this part
-// */
-// public ImageDescriptor getImageDescriptor();
-//
-// /**
-// * Return the label override string for this part.
-// *
-// * @return the label override string or <code>null</code> if one has not
-// * been specified
-// * @since 3.2
-// */
-// public String getLabelOverride();
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.internal.intro;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.intro.IIntroPart;
+
+/**
+ * Describes an introduction extension.
+ */
+public interface IIntroDescriptor {
+
+ /**
+ * Creates an instance of the intro part defined in the descriptor.
+ */
+ IIntroPart createIntro() throws CoreException;
+
+ /**
+ * Returns the part id.
+ *
+ * @return the id of the part
+ */
+ public String getId();
+
+ /**
+ * Returns the descriptor of the image for this part.
+ *
+ * @return the descriptor of the image to display next to this part
+ */
+ public ImageDescriptor getImageDescriptor();
+
+ /**
+ * Return the label override string for this part.
+ *
+ * @return the label override string or <code>null</code> if one has not
+ * been specified
+ */
+ public String getLabelOverride();
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java
index a9b91bbf39..2995e6da96 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IIntroRegistry.java
@@ -1,37 +1,37 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.internal.intro;
-//
-///**
-// * Registry for introduction elements.
-// *
-// * @since 3.0
-// */
-//public interface IIntroRegistry {
-//
-// /**
-// * Return the number of introduction extensions known by this registry.
-// *
-// * @return the number of introduction extensions known by this registry
-// */
-// int getIntroCount();
-//
-// /**
-// * Return the introduction extensions known by this registry.
-// *
-// * @return the introduction extensions known by this registry
-// */
-// IIntroDescriptor[] getIntros();
-//
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.internal.intro;
+
+/**
+ * Registry for introduction elements.
+ *
+ * @since 1.2
+ */
+public interface IIntroRegistry {
+
+ /**
+ * Return the number of introduction extensions known by this registry.
+ *
+ * @return the number of introduction extensions known by this registry
+ */
+ int getIntroCount();
+
+ /**
+ * Return the introduction extensions known by this registry.
+ *
+ * @return the introduction extensions known by this registry
+ */
+ IIntroDescriptor[] getIntros();
+
+ // RAP [bm]: no product support - using branding instead
// /**
// * Return the introduction extension that is bound to the given product.
// *
@@ -40,12 +40,22 @@
// * or <code>null</code> if there is no such binding
// */
// IIntroDescriptor getIntroForProduct(String productId);
-//
-// /**
-// * Find an intro descriptor with the given identifier.
-// *
-// * @param id the id
-// * @return the intro descriptor, or <code>null</code>
-// */
-// IIntroDescriptor getIntro(String id);
-//}
+ /**
+ * Return the introduction extension that is bound to the given branding.
+ *
+ * @param brandingId the product identifier
+ * @return the introduction extension that is bound to the given branding,
+ * or <code>null</code> if there is no such binding
+ */
+ IIntroDescriptor getIntroForBranding(String brandingId);
+
+ // ENDRAP
+
+ /**
+ * Find an intro descriptor with the given identifier.
+ *
+ * @param id the id
+ * @return the intro descriptor, or <code>null</code>
+ */
+ IIntroDescriptor getIntro(String id);
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
index 3227f03b83..3d40c597e6 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroDescriptor.java
@@ -1,120 +1,119 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 2007 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.eclipse.ui.internal.intro;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.core.runtime.IConfigurationElement;
-//import org.eclipse.core.runtime.IStatus;
-//import org.eclipse.core.runtime.Status;
-//import org.eclipse.jface.resource.ImageDescriptor;
-//import org.eclipse.ui.IPluginContribution;
-//import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
-//import org.eclipse.ui.intro.IIntroPart;
-//import org.eclipse.ui.intro.IntroContentDetector;
-//import org.eclipse.ui.plugin.AbstractUIPlugin;
-//
-///**
-// * Describes an introduction extension.
-// *
-// * @since 3.0
-// */
-//public class IntroDescriptor implements IIntroDescriptor, IPluginContribution {
-//
-//
-// private IConfigurationElement element;
-//
-// private ImageDescriptor imageDescriptor;
-//
-// /**
-// * Create a new IntroDescriptor for an extension.
-// */
-// public IntroDescriptor(IConfigurationElement configElement)
-// throws CoreException {
-// element = configElement;
-//
-// if (configElement.getAttribute(IWorkbenchRegistryConstants.ATT_CLASS) == null) {
-// throw new CoreException(new Status(IStatus.ERROR, configElement
-// .getNamespace(), 0,
-// "Invalid extension (Missing class name): " + getId(), //$NON-NLS-1$
-// null));
-// }
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroDescriptor#createIntro()
-// */
-// public IIntroPart createIntro() throws CoreException {
-// return (IIntroPart) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS);
-// }
-//
-// public IntroContentDetector getIntroContentDetector() throws CoreException {
-// if (element.getAttribute(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR) == null) {
-// return null;
-// }
-// return (IntroContentDetector) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IIntroDescriptor#getId()
-// */
-// public String getId() {
-// return element.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IIntroDescriptor#getImageDescriptor()
-// */
-// public ImageDescriptor getImageDescriptor() {
-// if (imageDescriptor != null) {
-// return imageDescriptor;
-// }
-// String iconName = element.getAttribute(IWorkbenchRegistryConstants.ATT_ICON);
-// if (iconName == null) {
-// return null;
-// }
-//
-// imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element
-// .getNamespace(), iconName);
-// return imageDescriptor;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IPluginContribution#getLocalId()
-// */
-// public String getLocalId() {
-// return element.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.IPluginContribution#getPluginId()
-// */
-// public String getPluginId() {
-// return element.getNamespace();
-// }
-//
-// /**
-// * Returns the configuration element.
-// *
-// * @return the configuration element
-// * @since 3.1
-// */
-// public IConfigurationElement getConfigurationElement() {
-// return element;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.internal.intro.IIntroDescriptor#getLabelOverride()
-// */
-// public String getLabelOverride() {
-// return element.getAttribute(IWorkbenchRegistryConstants.ATT_LABEL);
-// }
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.eclipse.ui.internal.intro;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IPluginContribution;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.intro.IntroContentDetector;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * Describes an introduction extension.
+ *
+ * @since 1.2
+ */
+public class IntroDescriptor implements IIntroDescriptor, IPluginContribution {
+
+
+ private IConfigurationElement element;
+
+ private ImageDescriptor imageDescriptor;
+
+ /**
+ * Create a new IntroDescriptor for an extension.
+ */
+ public IntroDescriptor(IConfigurationElement configElement)
+ throws CoreException {
+ element = configElement;
+
+ if (configElement.getAttribute(IWorkbenchRegistryConstants.ATT_CLASS) == null) {
+ throw new CoreException(new Status(IStatus.ERROR, configElement
+ .getNamespace(), 0,
+ "Invalid extension (Missing class name): " + getId(), //$NON-NLS-1$
+ null));
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroDescriptor#createIntro()
+ */
+ public IIntroPart createIntro() throws CoreException {
+ return (IIntroPart) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CLASS);
+ }
+
+ public IntroContentDetector getIntroContentDetector() throws CoreException {
+ if (element.getAttribute(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR) == null) {
+ return null;
+ }
+ return (IntroContentDetector) element.createExecutableExtension(IWorkbenchRegistryConstants.ATT_CONTENT_DETECTOR);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IIntroDescriptor#getId()
+ */
+ public String getId() {
+ return element.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IIntroDescriptor#getImageDescriptor()
+ */
+ public ImageDescriptor getImageDescriptor() {
+ if (imageDescriptor != null) {
+ return imageDescriptor;
+ }
+ String iconName = element.getAttribute(IWorkbenchRegistryConstants.ATT_ICON);
+ if (iconName == null) {
+ return null;
+ }
+
+ imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(element
+ .getNamespace(), iconName);
+ return imageDescriptor;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPluginContribution#getLocalId()
+ */
+ public String getLocalId() {
+ return element.getAttribute(IWorkbenchRegistryConstants.ATT_ID);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPluginContribution#getPluginId()
+ */
+ public String getPluginId() {
+ return element.getNamespace();
+ }
+
+ /**
+ * Returns the configuration element.
+ *
+ * @return the configuration element
+ * @since 1.2
+ */
+ public IConfigurationElement getConfigurationElement() {
+ return element;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.internal.intro.IIntroDescriptor#getLabelOverride()
+ */
+ public String getLabelOverride() {
+ return element.getAttribute(IWorkbenchRegistryConstants.ATT_LABEL);
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java
index a53aac47b2..d868d2e7b0 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroMessages.java
@@ -1,25 +1,26 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2003, 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 - Initial API and implementation
-// *******************************************************************************/
-//package org.eclipse.ui.internal.intro;
-//
-//import org.eclipse.osgi.util.NLS;
-//
-//
-///**
-// * The IntroMessages are the messages used in the intro support.
-// */
+/*******************************************************************************
+ * Copyright (c) 2003, 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 - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.ui.internal.intro;
+
+import org.eclipse.rwt.RWT;
+
+
+/**
+ * The IntroMessages are the messages used in the intro support.
+ */
+public class IntroMessages {
//public class IntroMessages extends NLS {
-// private static final String BUNDLE_NAME = "org.eclipse.ui.internal.intro.intro";//$NON-NLS-1$
-//
+ private static final String BUNDLE_NAME = "org.eclipse.ui.internal.intro.intro";//$NON-NLS-1$
+
+ // RAP [bm]: I18n
// public static String Intro_could_not_create_part;
// public static String Intro_could_not_create_proxy;
// public static String Intro_could_not_create_descriptor;
@@ -27,9 +28,25 @@
// public static String Intro_default_title;
// public static String Intro_missing_product_title;
// public static String Intro_missing_product_message;
-//
-// static {
-// // load message values from bundle file
-// NLS.initializeMessages(BUNDLE_NAME, IntroMessages.class);
-// }
-//}
+
+ public String Intro_could_not_create_part;
+ public String Intro_could_not_create_proxy;
+ public String Intro_could_not_create_descriptor;
+ public String Intro_action_text;
+ public String Intro_default_title;
+ public String Intro_missing_product_title;
+ public String Intro_missing_product_message;
+ // ENDRAP
+
+
+ // RAP [bm]: different NLS due to multiple user/session capability
+// static {
+// // load message values from bundle file
+// NLS.initializeMessages(BUNDLE_NAME, IntroMessages.class);
+// }
+ public static IntroMessages get() {
+ Class clazz = IntroMessages.class;
+ Object result = RWT.NLS.getISO8859_1Encoded( BUNDLE_NAME, clazz );
+ return ( IntroMessages )result;
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
index 94dec55d06..5df1b8106d 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/internal/intro/IntroRegistry.java
@@ -1,99 +1,103 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 2007 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.eclipse.ui.internal.intro;
-//
-//import java.util.ArrayList;
-//
-//import org.eclipse.core.runtime.CoreException;
-//import org.eclipse.core.runtime.IConfigurationElement;
-//import org.eclipse.core.runtime.IExtension;
-//import org.eclipse.core.runtime.IExtensionPoint;
-//import org.eclipse.core.runtime.IStatus;
-//import org.eclipse.core.runtime.Platform;
-//import org.eclipse.core.runtime.Status;
-//import org.eclipse.ui.PlatformUI;
-//import org.eclipse.ui.internal.WorkbenchPlugin;
-//import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
-//import org.eclipse.ui.internal.registry.RegistryReader;
-//
-///**
-// * Registry for introduction elements.
-// *
-// * @since 3.0
-// */
-//public class IntroRegistry implements IIntroRegistry {
-// private static final String TAG_INTRO = "intro";//$NON-NLS-1$
-//
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.eclipse.ui.internal.intro;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.internal.registry.RegistryReader;
+
+/**
+ * Registry for introduction elements.
+ *
+ * @since 1.2
+ */
+public class IntroRegistry implements IIntroRegistry {
+ private static final String TAG_INTRO = "intro";//$NON-NLS-1$
+
+ // RAP [bm]: no product support - replaced with branding
// private static final String TAG_INTROPRODUCTBINDING = "introProductBinding";//$NON-NLS-1$
-//
-// private static final String ATT_INTROID = "introId"; //$NON-NLS-1$
-//
-// private static final String ATT_PRODUCTID = "productId"; //$NON-NLS-1$
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntroCount()
-// */
-// public int getIntroCount() {
-// return getIntros().length;
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntros()
-// */
-// public IIntroDescriptor[] getIntros() {
-// // RAP [bm]:
-//// IExtensionPoint point = Platform.getExtensionRegistry()
-//// .getExtensionPoint(PlatformUI.PLUGIN_ID,
-//// IWorkbenchRegistryConstants.PL_INTRO);
+ private static final String TAG_INTROBRANDINGBINDING = "introBrandingBinding";//$NON-NLS-1$
+
+ private static final String ATT_INTROID = "introId"; //$NON-NLS-1$
+
+ // RAP [bm]: no product support - replaced with branding
+// private static final String ATT_PRODUCTID = "productId"; //$NON-NLS-1$
+ private static final String ATT_BRANDINGID = "brandingId"; //$NON-NLS-1$
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntroCount()
+ */
+ public int getIntroCount() {
+ return getIntros().length;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntros()
+ */
+ public IIntroDescriptor[] getIntros() {
+ // RAP [bm]: replaced namespace
// IExtensionPoint point = Platform.getExtensionRegistry()
-// .getExtensionPoint(PlatformUI.PLUGIN_EXTENSION_NAME_SPACE,
-// IWorkbenchRegistryConstants.PL_INTRO);
-// // RAPEND: [bm]
-//
-// if (point == null) {
-// return new IIntroDescriptor[0];
-// }
-//
-// IExtension[] extensions = point.getExtensions();
-// extensions = RegistryReader.orderExtensions(extensions);
-//
-// ArrayList list = new ArrayList(extensions.length);
-// for (int i = 0; i < extensions.length; i++) {
-// IConfigurationElement[] elements = extensions[i]
-// .getConfigurationElements();
-// for (int j = 0; j < elements.length; j++) {
-// if (elements[j].getName().equals(TAG_INTRO)) {
-// try {
-// IIntroDescriptor descriptor = new IntroDescriptor(
-// elements[j]);
-// list.add(descriptor);
-// } catch (CoreException e) {
-// // log an error since its not safe to open a dialog here
-// WorkbenchPlugin
-// .log(
-// IntroMessages.Intro_could_not_create_descriptor, e.getStatus());
-// }
-// }
-// }
-// }
-//
-// return (IIntroDescriptor[]) list.toArray(new IIntroDescriptor[list
-// .size()]);
-// }
-//
+// .getExtensionPoint(PlatformUI.PLUGIN_ID,
+// IWorkbenchRegistryConstants.PL_INTRO);
+ IExtensionPoint point = Platform.getExtensionRegistry()
+ .getExtensionPoint(PlatformUI.PLUGIN_EXTENSION_NAME_SPACE,
+ IWorkbenchRegistryConstants.PL_INTRO);
+ // RAPEND: [bm]
+
+ if (point == null) {
+ return new IIntroDescriptor[0];
+ }
+
+ IExtension[] extensions = point.getExtensions();
+ extensions = RegistryReader.orderExtensions(extensions);
+
+ ArrayList list = new ArrayList(extensions.length);
+ for (int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i]
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ if (elements[j].getName().equals(TAG_INTRO)) {
+ try {
+ IIntroDescriptor descriptor = new IntroDescriptor(
+ elements[j]);
+ list.add(descriptor);
+ } catch (CoreException e) {
+ // log an error since its not safe to open a dialog here
+ WorkbenchPlugin
+ .log(
+ IntroMessages.get().Intro_could_not_create_descriptor, e.getStatus());
+ }
+ }
+ }
+ }
+
+ return (IIntroDescriptor[]) list.toArray(new IIntroDescriptor[list
+ .size()]);
+ }
+
+ // RAP [bm]: no product support - replaced with branding
// /*
// * (non-Javadoc)
// *
@@ -132,7 +136,47 @@
//
// return descriptor;
// }
-//
+// RAP [bm] same as getIntroForProduct() but with a branding
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntroForProduct(java.lang.String)
+ */
+ public IIntroDescriptor getIntroForBranding(String targetBrandingId) {
+ // RAP [bm]: replaced namespace
+// IExtensionPoint point = Platform.getExtensionRegistry()
+// .getExtensionPoint(PlatformUI.PLUGIN_ID,
+// IWorkbenchRegistryConstants.PL_INTRO);
+ IExtensionPoint point = Platform.getExtensionRegistry()
+ .getExtensionPoint(PlatformUI.PLUGIN_EXTENSION_NAME_SPACE,
+ IWorkbenchRegistryConstants.PL_INTRO);
+ // RAPEND: [bm]
+ if (point == null) {
+ return null;
+ }
+
+ IExtension[] extensions = point.getExtensions();
+ extensions = RegistryReader.orderExtensions(extensions);
+
+ String targetIntroId = getIntroForBranding(targetBrandingId, extensions);
+ if (targetIntroId == null) {
+ return null;
+ }
+
+ IIntroDescriptor descriptor = null;
+
+ IIntroDescriptor[] intros = getIntros();
+ for (int i = 0; i < intros.length; i++) {
+ if (intros[i].getId().equals(targetIntroId)) {
+ descriptor = intros[i];
+ break;
+ }
+ }
+
+ return descriptor;
+ }
+
+ // RAP [bm]: no product support - using branding instead
// /**
// * @param targetProductId
// * @param extensions
@@ -167,20 +211,56 @@
// }
// return null;
// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntro(java.lang.String)
-// */
-// public IIntroDescriptor getIntro(String id) {
-// IIntroDescriptor[] intros = getIntros();
-// for (int i = 0; i < intros.length; i++) {
-// IIntroDescriptor desc = intros[i];
-// if (desc.getId().equals(id)) {
-// return desc;
-// }
-// }
-// return null;
-// }
-//}
+ /**
+ * @param targetBrandingId
+ * @param extensions
+ * @return
+ */
+ private String getIntroForBranding(String targetBrandingId,
+ IExtension[] extensions) {
+ for (int i = 0; i < extensions.length; i++) {
+ IConfigurationElement[] elements = extensions[i]
+ .getConfigurationElements();
+ for (int j = 0; j < elements.length; j++) {
+ if (elements[j].getName().equals(TAG_INTROBRANDINGBINDING)) {
+ String introId = elements[j].getAttribute(ATT_INTROID);
+ String brandingId = elements[j].getAttribute(ATT_BRANDINGID);
+
+ if (introId == null || brandingId == null) {
+ IStatus status = new Status(
+ IStatus.ERROR,
+ elements[j].getDeclaringExtension()
+ .getNamespace(),
+ IStatus.ERROR,
+ "introId and brandingId must be defined.", new IllegalArgumentException()); //$NON-NLS-1$
+ WorkbenchPlugin.log("Invalid intro binding", status); //$NON-NLS-1$
+ continue;
+ }
+
+ if (targetBrandingId.equals(brandingId)) {
+ return introId;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ // ENDRAP
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.internal.intro.IIntroRegistry#getIntro(java.lang.String)
+ */
+ public IIntroDescriptor getIntro(String id) {
+ IIntroDescriptor[] intros = getIntros();
+ for (int i = 0; i < intros.length; i++) {
+ IIntroDescriptor desc = intros[i];
+ if (desc.getId().equals(id)) {
+ return desc;
+ }
+ }
+ return null;
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java
index a186973614..8f1434c649 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroManager.java
@@ -1,124 +1,122 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 2007 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.eclipse.ui.intro;
-//
-//import org.eclipse.ui.IWorkbenchWindow;
-//
-///**
-// * Manages the intro part that introduces the product to new users.
-// * The intro part is typically shown the first time a product is started up.
-// * <p>
-// * The initial behavior of the intro part is controlled by the application
-// * from via the {@link org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()}
-// * method.
-// * </p>
-// * <p>
-// * See {@link org.eclipse.ui.intro.IIntroPart} for details on where intro parts
-// * come from.
-// * </p>
-// * <p>
-// * This interface is not intended to be extended or implemented by clients.
-// * </p>
-// *
-// * @see org.eclipse.ui.IWorkbench#getIntroManager()
-// * @since 1.1
-// * @noimplement This interface is not intended to be implemented by clients.
-// */
-//public interface IIntroManager {
-//
-// /**
-// * Closes the given intro part.
-// *
-// * @param part the intro part
-// * @return <code>true</code> if the intro part was closed, and
-// * <code>false</code> otherwise. <code>false</code> is returned
-// * if part is <code>null</code> or it is not the intro part returned
-// * by {@link #getIntro()}.
-// */
-// public boolean closeIntro(IIntroPart part);
-//
-// /**
-// * Returns the intro part. Returns <code>null</code> if there is no intro
-// * part, if it has been previously closed via {@link #closeIntro(IIntroPart)}
-// * or if there is an intro part but {@link #showIntro(IWorkbenchWindow, boolean)}
-// * has not yet been called to create it.
-// *
-// * @return the intro part, or <code>null</code> if none is available
-// */
-// public IIntroPart getIntro();
-//
-// /**
-// * Return whether an intro is available. Note that this checks whether
-// * there is an applicable intro part that could be instantiated and shown
-// * to the user.
-// * Use {@link #getIntro()} to discover whether an intro part has already
-// * been created.
-// *
-// * @return <code>true</code> if there is an intro that could be shown, and
-// * <code>false</code> if there is no intro
-// */
-// public boolean hasIntro();
-//
-// /**
-// * Return the standby state of the given intro part.
-// *
-// * @param part the intro part
-// * @return <code>true</code> if the part in its partially
-// * visible standy mode, and <code>false</code> if in its fully visible state.
-// * <code>false</code> is returned if part is <code>null</code> or it is not
-// * the intro part returned by {@link #getIntro()}.
-// */
-// boolean isIntroStandby(IIntroPart part);
-//
-// /**
-// * Sets the standby state of the given intro part. Intro part usually should
-// * render themselves differently in the full and standby modes. In standby
-// * mode, the part should be partially visible to the user but otherwise
-// * allow them to work. In full mode, the part should be fully visible and
-// * be the center of the user's attention.
-// * <p>
-// * This method does nothing if the part is <code>null</code> or is not
-// * the intro part returned by {@link #getIntro()}.
-// * </p>
-// *
-// * @param part the intro part, or <code>null</code>
-// * @param standby <code>true</code> to put the part in its partially
-// * visible standy mode, and <code>false</code> to make it fully visible.
-// */
-// public void setIntroStandby(IIntroPart part, boolean standby);
-//
-// /**
-// * Shows the intro part in the given workbench window. If the intro part has
-// * not been created yet, one will be created. If the intro part is currently
-// * being shown in some workbench window, that other window is made active.
-// *
-// * @param preferredWindow the preferred workbench window, or
-// * <code>null</code> to indicate the currently active workbench window
-// * @param standby <code>true</code> to put the intro part in its partially
-// * visible standy mode, and <code>false</code> to make it fully visible
-// * @return the newly-created or existing intro part, or <code>null</code>
-// * if no intro part is available or if <code>preferredWindow</code> is
-// * <code>null</code> and there is no currently active workbench window
-// */
-// public IIntroPart showIntro(IWorkbenchWindow preferredWindow,
-// boolean standby);
-//
-// /**
-// * Returns <code>true</code> if there is an intro content detector and it
-// * reports that new intro content is available.
-// *
-// * @return <code>true</code> if new intro content is available
-// *
-// * @since 1.1
-// */
-// public boolean isNewContentAvailable();
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 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.eclipse.ui.intro;
+
+import org.eclipse.ui.IWorkbenchWindow;
+
+/**
+ * Manages the intro part that introduces the product to new users.
+ * The intro part is typically shown the first time a product is started up.
+ * <p>
+ * The initial behavior of the intro part is controlled by the application
+ * from via the {@link org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()}
+ * method.
+ * </p>
+ * <p>
+ * See {@link org.eclipse.ui.intro.IIntroPart} for details on where intro parts
+ * come from.
+ * </p>
+ * <p>
+ * This interface is not intended to be extended or implemented by clients.
+ * </p>
+ *
+ * @see org.eclipse.ui.IWorkbench#getIntroManager()
+ * @since 1.2
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IIntroManager {
+
+ /**
+ * Closes the given intro part.
+ *
+ * @param part the intro part
+ * @return <code>true</code> if the intro part was closed, and
+ * <code>false</code> otherwise. <code>false</code> is returned
+ * if part is <code>null</code> or it is not the intro part returned
+ * by {@link #getIntro()}.
+ */
+ public boolean closeIntro(IIntroPart part);
+
+ /**
+ * Returns the intro part. Returns <code>null</code> if there is no intro
+ * part, if it has been previously closed via {@link #closeIntro(IIntroPart)}
+ * or if there is an intro part but {@link #showIntro(IWorkbenchWindow, boolean)}
+ * has not yet been called to create it.
+ *
+ * @return the intro part, or <code>null</code> if none is available
+ */
+ public IIntroPart getIntro();
+
+ /**
+ * Return whether an intro is available. Note that this checks whether
+ * there is an applicable intro part that could be instantiated and shown
+ * to the user.
+ * Use {@link #getIntro()} to discover whether an intro part has already
+ * been created.
+ *
+ * @return <code>true</code> if there is an intro that could be shown, and
+ * <code>false</code> if there is no intro
+ */
+ public boolean hasIntro();
+
+ /**
+ * Return the standby state of the given intro part.
+ *
+ * @param part the intro part
+ * @return <code>true</code> if the part in its partially
+ * visible standy mode, and <code>false</code> if in its fully visible state.
+ * <code>false</code> is returned if part is <code>null</code> or it is not
+ * the intro part returned by {@link #getIntro()}.
+ */
+ boolean isIntroStandby(IIntroPart part);
+
+ /**
+ * Sets the standby state of the given intro part. Intro part usually should
+ * render themselves differently in the full and standby modes. In standby
+ * mode, the part should be partially visible to the user but otherwise
+ * allow them to work. In full mode, the part should be fully visible and
+ * be the center of the user's attention.
+ * <p>
+ * This method does nothing if the part is <code>null</code> or is not
+ * the intro part returned by {@link #getIntro()}.
+ * </p>
+ *
+ * @param part the intro part, or <code>null</code>
+ * @param standby <code>true</code> to put the part in its partially
+ * visible standy mode, and <code>false</code> to make it fully visible.
+ */
+ public void setIntroStandby(IIntroPart part, boolean standby);
+
+ /**
+ * Shows the intro part in the given workbench window. If the intro part has
+ * not been created yet, one will be created. If the intro part is currently
+ * being shown in some workbench window, that other window is made active.
+ *
+ * @param preferredWindow the preferred workbench window, or
+ * <code>null</code> to indicate the currently active workbench window
+ * @param standby <code>true</code> to put the intro part in its partially
+ * visible standy mode, and <code>false</code> to make it fully visible
+ * @return the newly-created or existing intro part, or <code>null</code>
+ * if no intro part is available or if <code>preferredWindow</code> is
+ * <code>null</code> and there is no currently active workbench window
+ */
+ public IIntroPart showIntro(IWorkbenchWindow preferredWindow,
+ boolean standby);
+
+ /**
+ * Returns <code>true</code> if there is an intro content detector and it
+ * reports that new intro content is available.
+ *
+ * @return <code>true</code> if new intro content is available
+ *
+ */
+ public boolean isNewContentAvailable();
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java
index d863fb5f0e..07ab2e9ed2 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroPart.java
@@ -1,210 +1,209 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.intro;
-//
-//import org.eclipse.core.runtime.IAdaptable;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.ui.IMemento;
-//import org.eclipse.ui.IPropertyListener;
-//import org.eclipse.ui.IWorkbenchPart;
-//import org.eclipse.ui.IWorkbenchWindow;
-//import org.eclipse.ui.PartInitException;
-//
-///**
-// * The intro part is a visual component within the workbench responsible for
-// * introducing the product to new users. The intro part is typically shown the
-// * first time a product is started up.
-// * <p>
-// * The intro part implementation is contributed to the workbench via the
-// * <code>org.eclipse.ui.intro</code> extension point. There can be several
-// * intro part implementations, and associations between intro part
-// * implementations and products. The workbench will only make use of the intro
-// * part implementation for the current product (as given by
-// * {@link org.eclipse.core.runtime.Platform#getProduct()}. There is at most one
-// * intro part instance in the entire workbench, and it resides in exactly one
-// * workbench window at a time.
-// * </p>
-// * <p>
-// * This interface in not intended to be directly implemented. Rather, clients
-// * providing a intro part implementation should subclass
-// * {@link org.eclipse.ui.part.IntroPart}.
-// * </p>
-// *
-// * @see org.eclipse.ui.intro.IIntroManager#showIntro(org.eclipse.ui.IWorkbenchWindow, boolean)
-// * @since 1.1
-// * @noimplement This interface is not intended to be implemented by clients.
-// */
-//public interface IIntroPart extends IAdaptable {
-//
-// /**
-// * The property id for <code>getTitleImage</code> and
-// * <code>getTitle</code>.
-// */
-// public static final int PROP_TITLE = IWorkbenchPart.PROP_TITLE;
-//
-// /**
-// * Returns the site for this intro part.
-// *
-// * @return the intro site
-// */
-// IIntroSite getIntroSite();
-//
-// /**
-// * Initializes this intro part with the given intro site. A memento is
-// * passed to the part which contains a snapshot of the part state from a
-// * previous session. Where possible, the part should try to recreate that
-// * state.
-// * <p>
-// * This method is automatically called by the workbench shortly after
-// * part construction. It marks the start of the intro's lifecycle. Clients
-// * must not call this method.
-// * </p>
-// *
-// * @param site the intro site
-// * @param memento the intro part state or <code>null</code> if there is no previous
-// * saved state
-// * @exception PartInitException if this part was not initialized
-// * successfully
-// */
-// public void init(IIntroSite site, IMemento memento)
-// throws PartInitException;
-//
-// /**
-// * Sets the standby state of this intro part. An intro part should render
-// * itself differently in the full and standby modes. In standby mode, the
-// * part should be partially visible to the user but otherwise allow them
-// * to work. In full mode, the part should be fully visible and be the center
-// * of the user's attention.
-// * <p>
-// * This method is automatically called by the workbench at appropriate
-// * times. Clients must not call this method directly (call
-// * {@link IIntroManager#setIntroStandby(IIntroPart, boolean)} instead.
-// * </p>
-// *
-// * @param standby <code>true</code> to put this part in its partially
-// * visible standy mode, and <code>false</code> to make it fully visible
-// */
-// public void standbyStateChanged(boolean standby);
-//
-// /**
-// * Saves the object state within a memento.
-// * <p>
-// * This method is automatically called by the workbench at appropriate
-// * times. Clients must not call this method directly.
-// * </p>
-// *
-// * @param memento a memento to receive the object state
-// */
-// public void saveState(IMemento memento);
-//
-// /**
-// * Adds a listener for changes to properties of this intro part.
-// * Has no effect if an identical listener is already registered.
-// * <p>
-// * The properties ids are as follows:
-// * <ul>
-// * <li><code>IIntroPart.PROP_TITLE</code> </li>
-// * </ul>
-// * </p>
-// *
-// * @param listener a property listener
-// */
-// public void addPropertyListener(IPropertyListener listener);
-//
-// /**
-// * Creates the SWT controls for this intro part.
-// * <p>
-// * Clients should not call this method (the workbench calls this method when
-// * it needs to, which may be never).
-// * </p>
-// * <p>
-// * For implementors this is a multi-step process:
-// * <ol>
-// * <li>Create one or more controls within the parent.</li>
-// * <li>Set the parent layout as needed.</li>
-// * <li>Register any global actions with the <code>IActionService</code>.</li>
-// * <li>Register any popup menus with the <code>IActionService</code>.</li>
-// * <li>Register a selection provider with the <code>ISelectionService</code>
-// * (optional). </li>
-// * </ol>
-// * </p>
-// *
-// * @param parent the parent control
-// */
-// public void createPartControl(Composite parent);
-//
-// /**
-// * Disposes of this intro part.
-// * <p>
-// * This is the last method called on the <code>IIntroPart</code>. At this
-// * point the part controls (if they were ever created) have been disposed as part
-// * of an SWT composite. There is no guarantee that createPartControl() has been
-// * called, so the part controls may never have been created.
-// * </p>
-// * <p>
-// * Within this method a part may release any resources, fonts, images, etc.&nbsp;
-// * held by this part. It is also very important to deregister all listeners
-// * from the workbench.
-// * </p>
-// * <p>
-// * Clients should not call this method (the workbench calls this method at
-// * appropriate times).
-// * </p>
-// */
-// public void dispose();
-//
-// /**
-// * Returns the title image of this intro part. If this value changes
-// * the part must fire a property listener event with
-// * {@link IIntroPart#PROP_TITLE}.
-// * <p>
-// * The title image is usually used to populate the title bar of this part's
-// * visual container. Since this image is managed by the part itself, callers
-// * must <b>not</b> dispose the returned image.
-// * </p>
-// *
-// * @return the title image
-// */
-// public Image getTitleImage();
-//
-// /**
-// * Returns the title of this intro part. If this value changes
-// * the part must fire a property listener event with
-// * {@link IIntroPart#PROP_TITLE}.
-// * <p>
-// * The title is used to populate the title bar of this part's visual
-// * container.
-// * </p>
-// *
-// * @return the intro part title (not <code>null</code>)
-// */
-// public String getTitle();
-//
-// /**
-// * Removes the given property listener from this intro part.
-// * Has no affect if an identical listener is not registered.
-// *
-// * @param listener a property listener
-// */
-// public void removePropertyListener(IPropertyListener listener);
-//
-// /**
-// * Asks this part to take focus within the workbench.
-// * <p>
-// * Clients should not call this method (the workbench calls this method at
-// * appropriate times). To have the workbench activate a part, use
-// * {@link IIntroManager#showIntro(IWorkbenchWindow, boolean)}.
-// * </p>
-// */
-// public void setFocus();
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.intro;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+/**
+ * The intro part is a visual component within the workbench responsible for
+ * introducing the product to new users. The intro part is typically shown the
+ * first time a product is started up.
+ * <p>
+ * The intro part implementation is contributed to the workbench via the
+ * <code>org.eclipse.ui.intro</code> extension point. There can be several
+ * intro part implementations, and associations between intro part
+ * implementations and products. The workbench will only make use of the intro
+ * part implementation for the current product (as given by
+ * {@link org.eclipse.core.runtime.Platform#getProduct()}. There is at most one
+ * intro part instance in the entire workbench, and it resides in exactly one
+ * workbench window at a time.
+ * </p>
+ * <p>
+ * This interface in not intended to be directly implemented. Rather, clients
+ * providing a intro part implementation should subclass
+ * {@link org.eclipse.ui.part.IntroPart}.
+ * </p>
+ *
+ * @see org.eclipse.ui.intro.IIntroManager#showIntro(org.eclipse.ui.IWorkbenchWindow, boolean)
+ * @since 1.2
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IIntroPart extends IAdaptable {
+
+ /**
+ * The property id for <code>getTitleImage</code> and
+ * <code>getTitle</code>.
+ */
+ public static final int PROP_TITLE = IWorkbenchPart.PROP_TITLE;
+
+ /**
+ * Returns the site for this intro part.
+ *
+ * @return the intro site
+ */
+ IIntroSite getIntroSite();
+
+ /**
+ * Initializes this intro part with the given intro site. A memento is
+ * passed to the part which contains a snapshot of the part state from a
+ * previous session. Where possible, the part should try to recreate that
+ * state.
+ * <p>
+ * This method is automatically called by the workbench shortly after
+ * part construction. It marks the start of the intro's lifecycle. Clients
+ * must not call this method.
+ * </p>
+ *
+ * @param site the intro site
+ * @param memento the intro part state or <code>null</code> if there is no previous
+ * saved state
+ * @exception PartInitException if this part was not initialized
+ * successfully
+ */
+ public void init(IIntroSite site, IMemento memento)
+ throws PartInitException;
+
+ /**
+ * Sets the standby state of this intro part. An intro part should render
+ * itself differently in the full and standby modes. In standby mode, the
+ * part should be partially visible to the user but otherwise allow them
+ * to work. In full mode, the part should be fully visible and be the center
+ * of the user's attention.
+ * <p>
+ * This method is automatically called by the workbench at appropriate
+ * times. Clients must not call this method directly (call
+ * {@link IIntroManager#setIntroStandby(IIntroPart, boolean)} instead.
+ * </p>
+ *
+ * @param standby <code>true</code> to put this part in its partially
+ * visible standy mode, and <code>false</code> to make it fully visible
+ */
+ public void standbyStateChanged(boolean standby);
+
+ /**
+ * Saves the object state within a memento.
+ * <p>
+ * This method is automatically called by the workbench at appropriate
+ * times. Clients must not call this method directly.
+ * </p>
+ *
+ * @param memento a memento to receive the object state
+ */
+ public void saveState(IMemento memento);
+
+ /**
+ * Adds a listener for changes to properties of this intro part.
+ * Has no effect if an identical listener is already registered.
+ * <p>
+ * The properties ids are as follows:
+ * <ul>
+ * <li><code>IIntroPart.PROP_TITLE</code> </li>
+ * </ul>
+ * </p>
+ *
+ * @param listener a property listener
+ */
+ public void addPropertyListener(IPropertyListener listener);
+
+ /**
+ * Creates the SWT controls for this intro part.
+ * <p>
+ * Clients should not call this method (the workbench calls this method when
+ * it needs to, which may be never).
+ * </p>
+ * <p>
+ * For implementors this is a multi-step process:
+ * <ol>
+ * <li>Create one or more controls within the parent.</li>
+ * <li>Set the parent layout as needed.</li>
+ * <li>Register any global actions with the <code>IActionService</code>.</li>
+ * <li>Register any popup menus with the <code>IActionService</code>.</li>
+ * <li>Register a selection provider with the <code>ISelectionService</code>
+ * (optional). </li>
+ * </ol>
+ * </p>
+ *
+ * @param parent the parent control
+ */
+ public void createPartControl(Composite parent);
+
+ /**
+ * Disposes of this intro part.
+ * <p>
+ * This is the last method called on the <code>IIntroPart</code>. At this
+ * point the part controls (if they were ever created) have been disposed as part
+ * of an SWT composite. There is no guarantee that createPartControl() has been
+ * called, so the part controls may never have been created.
+ * </p>
+ * <p>
+ * Within this method a part may release any resources, fonts, images, etc.&nbsp;
+ * held by this part. It is also very important to deregister all listeners
+ * from the workbench.
+ * </p>
+ * <p>
+ * Clients should not call this method (the workbench calls this method at
+ * appropriate times).
+ * </p>
+ */
+ public void dispose();
+
+ /**
+ * Returns the title image of this intro part. If this value changes
+ * the part must fire a property listener event with
+ * {@link IIntroPart#PROP_TITLE}.
+ * <p>
+ * The title image is usually used to populate the title bar of this part's
+ * visual container. Since this image is managed by the part itself, callers
+ * must <b>not</b> dispose the returned image.
+ * </p>
+ *
+ * @return the title image
+ */
+ public Image getTitleImage();
+
+ /**
+ * Returns the title of this intro part. If this value changes
+ * the part must fire a property listener event with
+ * {@link IIntroPart#PROP_TITLE}.
+ * <p>
+ * The title is used to populate the title bar of this part's visual
+ * container.
+ * </p>
+ *
+ * @return the intro part title (not <code>null</code>)
+ */
+ public String getTitle();
+
+ /**
+ * Removes the given property listener from this intro part.
+ * Has no affect if an identical listener is not registered.
+ *
+ * @param listener a property listener
+ */
+ public void removePropertyListener(IPropertyListener listener);
+
+ /**
+ * Asks this part to take focus within the workbench.
+ * <p>
+ * Clients should not call this method (the workbench calls this method at
+ * appropriate times). To have the workbench activate a part, use
+ * {@link IIntroManager#showIntro(IWorkbenchWindow, boolean)}.
+ * </p>
+ */
+ public void setFocus();
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java
index 6e906ea318..c481c75707 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/intro/IIntroSite.java
@@ -1,71 +1,70 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.intro;
-//
-//import org.eclipse.ui.IActionBars;
-////import org.eclipse.ui.IKeyBindingService;
-//import org.eclipse.ui.IWorkbenchSite;
-//
-///**
-// * The primary interface between an intro part and the workbench.
-// * <p>
-// * The workbench exposes its implemention of intro part sites via this
-// * interface, which is not intended to be implemented or extended by clients.
-// * </p>
-// *
-// * @since 1.1
-// * @noimplement This interface is not intended to be implemented by clients.
-// */
-//public interface IIntroSite extends IWorkbenchSite {
-//
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.intro;
+
+import org.eclipse.ui.IActionBars;
+//import org.eclipse.ui.IKeyBindingService;
+import org.eclipse.ui.IWorkbenchSite;
+
+/**
+ * The primary interface between an intro part and the workbench.
+ * <p>
+ * The workbench exposes its implemention of intro part sites via this
+ * interface, which is not intended to be implemented or extended by clients.
+ * </p>
+ *
+ * @since 1.2
+ * @noimplement This interface is not intended to be implemented by clients.
+ */
+public interface IIntroSite extends IWorkbenchSite {
+
+ /**
+ * Returns the part registry extension id for this intro site's part.
+ * <p>
+ * The name comes from the <code>id</code> attribute in the configuration
+ * element.
+ * </p>
+ *
+ * @return the registry extension id
+ */
+ public String getId();
+
+ /**
+ * Returns the unique identifier of the plug-in that defines this intro
+ * site's part.
+ *
+ * @return the unique identifier of the declaring plug-in
+ * @see org.eclipse.core.runtime.IPluginDescriptor#getUniqueIdentifier()
+ */
+ public String getPluginId();
+
+// RAP [rh] key bindings not available
// /**
-// * Returns the part registry extension id for this intro site's part.
+// * Returns the key binding service in use.
// * <p>
-// * The name comes from the <code>id</code> attribute in the configuration
-// * element.
+// * The part will access this service to register
+// * all of its actions, to set the active scope.
// * </p>
-// *
-// * @return the registry extension id
-// */
-// public String getId();
-//
-// /**
-// * Returns the unique identifier of the plug-in that defines this intro
-// * site's part.
-// *
-// * @return the unique identifier of the declaring plug-in
-// * @see org.eclipse.core.runtime.IPluginDescriptor#getUniqueIdentifier()
-// */
-// public String getPluginId();
-//
-//// RAP [rh] key bindings not available
-//// /**
-//// * Returns the key binding service in use.
-//// * <p>
-//// * The part will access this service to register
-//// * all of its actions, to set the active scope.
-//// * </p>
-//// *
-//// * @return the key binding service in use
-//// * @deprecated Use IServiceLocator#getService(*) to retrieve
-//// * IContextService and IHandlerService instead.
-//// */
-//// public IKeyBindingService getKeyBindingService();
-//
-// /**
-// * Returns the action bars for this part site.
-// * The intro part has exclusive use of its site's action bars.
// *
-// * @return the action bars
+// * @return the key binding service in use
+// * @deprecated Use IServiceLocator#getService(*) to retrieve
+// * IContextService and IHandlerService instead.
// */
-// public IActionBars getActionBars();
-//}
+// public IKeyBindingService getKeyBindingService();
+
+ /**
+ * Returns the action bars for this part site.
+ * The intro part has exclusive use of its site's action bars.
+ *
+ * @return the action bars
+ */
+ public IActionBars getActionBars();
+}
diff --git a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java
index 9c46f7986b..3df5b7a22a 100755
--- a/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java
+++ b/bundles/org.eclipse.rap.ui.workbench/Eclipse UI/org/eclipse/ui/part/IntroPart.java
@@ -1,328 +1,328 @@
-// RAP [rh] Intro mechanism not supported
-///*******************************************************************************
-// * Copyright (c) 2004, 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
-// *******************************************************************************/
-//package org.eclipse.ui.part;
-//
-//import org.eclipse.core.commands.common.EventManager;
-//import org.eclipse.core.runtime.Assert;
-//import org.eclipse.core.runtime.IConfigurationElement;
-//import org.eclipse.core.runtime.IExecutableExtension;
-//import org.eclipse.core.runtime.Platform;
-//import org.eclipse.jface.resource.ImageDescriptor;
-//import org.eclipse.jface.resource.JFaceResources;
-//import org.eclipse.jface.util.SafeRunnable;
-//import org.eclipse.swt.graphics.Image;
-//import org.eclipse.swt.widgets.Composite;
-//import org.eclipse.ui.IMemento;
-//import org.eclipse.ui.IPropertyListener;
-//import org.eclipse.ui.ISharedImages;
-//import org.eclipse.ui.PartInitException;
-//import org.eclipse.ui.PlatformUI;
-//import org.eclipse.ui.internal.intro.IntroMessages;
-//import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
-//import org.eclipse.ui.internal.util.Util;
-//import org.eclipse.ui.intro.IIntroPart;
-//import org.eclipse.ui.intro.IIntroSite;
-//import org.eclipse.ui.plugin.AbstractUIPlugin;
-//
-///**
-// * Abstract base implementation of an intro part.
-// * <p>
-// * Subclasses must implement the following methods:
-// * <ul>
-// * <li><code>createPartControl</code>- to create the intro part's controls
-// * </li>
-// * <li><code>setFocus</code>- to accept focus</li>
-// * <li><code>standbyStateChanged</code>- to change the standby mode</li>
-// * </ul>
-// * </p>
-// * <p>
-// * Subclasses may extend or reimplement the following methods as required:
-// * <ul>
-// * <li><code>setInitializationData</code>- extend to provide additional
-// * initialization when the intro extension is instantiated</li>
-// * <li><code>init(IIntroSite, IMemento)</code>- extend to provide additional
-// * initialization when intro is assigned its site</li>
-// * <li><code>dispose</code>- extend to provide additional cleanup</li>
-// * <li><code>getAdapter</code>- reimplement to make their intro adaptable
-// * </li>
-// * </ul>
-// * </p>
-// * @since 1.1
-// */
-//public abstract class IntroPart extends EventManager implements IIntroPart,
-// IExecutableExtension {
-//
-// private IConfigurationElement configElement;
-//
-// private ImageDescriptor imageDescriptor;
-//
-// private IIntroSite partSite;
-//
-// private Image titleImage;
-//
-// private String titleLabel;
-//
-// /**
-// * Creates a new intro part.
-// */
-// protected IntroPart() {
-// super();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
-// */
-// public void addPropertyListener(IPropertyListener l) {
-// addListenerObject(l);
-// }
-//
-// /*
-// * (non-Javadoc) Creates the SWT controls for this intro part. <p>
-// * Subclasses must implement this method. For a detailed description of the
-// * requirements see <code> IIntroPart </code></p>
-// *
-// * @param parent the parent control
-// *
-// * @see IIntroPart
-// */
-// public abstract void createPartControl(Composite parent);
-//
-// /**
-// * The <code>IntroPart</code> implementation of this
-// * <code>IIntroPart</code> method disposes the title image loaded by
-// * <code>setInitializationData</code>. Subclasses may extend.
-// */
-// public void dispose() {
-// if (titleImage != null) {
-// JFaceResources.getResources().destroyImage(imageDescriptor);
-// titleImage = null;
-// }
-//
-// // Clear out the property change listeners as we
-// // should not be notifying anyone after the part
-// // has been disposed.
-// clearListeners();
-// }
-//
-// /**
-// * Fires a property changed event.
-// *
-// * @param propertyId
-// * the id of the property that changed
-// */
-// protected void firePropertyChange(final int propertyId) {
-// Object[] array = getListeners();
-// for (int nX = 0; nX < array.length; nX++) {
-// final IPropertyListener l = (IPropertyListener) array[nX];
-// Platform.run(new SafeRunnable() {
-//
-// public void run() {
-// l.propertyChanged(this, propertyId);
-// }
-// });
-// }
-// }
-//
-// /**
-// * This implementation of the method declared by <code>IAdaptable</code>
-// * passes the request along to the platform's adapter manager; roughly
-// * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
-// * Subclasses may override this method (however, if they do so, they should
-// * invoke the method on their superclass to ensure that the Platform's
-// * adapter manager is consulted).
-// */
-// public Object getAdapter(Class adapter) {
-// return Platform.getAdapterManager().getAdapter(this, adapter);
-// }
-//
-// /**
-// * Returns the configuration element for this part. The configuration
-// * element comes from the plug-in registry entry for the extension defining
-// * this part.
-// *
-// * @return the configuration element for this part
-// */
-// protected IConfigurationElement getConfigurationElement() {
-// return configElement;
-// }
-//
-// /**
-// * Returns the default title image.
-// *
-// * @return the default image
-// */
-// protected Image getDefaultImage() {
-// return PlatformUI.getWorkbench().getSharedImages().getImage(
-// ISharedImages.IMG_DEF_VIEW);
-// }
-//
-// /*
-// * (non-Javadoc)
-// *
-// * @see org.eclipse.ui.intro.IIntroPart#getIntroSite()
-// */
-// public final IIntroSite getIntroSite() {
-// return partSite;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroPart#getTitleImage()
-// */
-// public Image getTitleImage() {
-// if (titleImage != null) {
-// return titleImage;
-// }
-// return getDefaultImage();
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroPart#getTitle()
-// */
-// public String getTitle() {
-// if (titleLabel != null) {
-// return titleLabel;
-// }
-// return getDefaultTitle();
-// }
-//
-// /**
-// * Return the default title string.
-// *
-// * @return the default title string
-// */
-// private String getDefaultTitle() {
-// return IntroMessages.Intro_default_title;
-// }
-//
-// /**
-// * The base implementation of this {@link org.eclipse.ui.intro.IIntroPart}method ignores the
-// * memento and initializes the part in a fresh state. Subclasses may extend
-// * to perform any state restoration, but must call the super method.
-// *
-// * @param site
-// * the intro site
-// * @param memento
-// * the intro part state or <code>null</code> if there is no
-// * previous saved state
-// * @exception PartInitException
-// * if this part was not initialized successfully
-// */
-// public void init(IIntroSite site, IMemento memento)
-// throws PartInitException {
-// setSite(site);
-// }
-//
-// /**
-// * Sets the part site.
-// * <p>
-// * Subclasses must invoke this method from {@link org.eclipse.ui.intro.IIntroPart#init(IIntroSite, IMemento)}.
-// * </p>
-// *
-// * @param site the intro part site
-// */
-// protected void setSite(IIntroSite site) {
-// this.partSite = site;
-// }
-//
-// /* (non-Javadoc)
-// * @see org.eclipse.ui.intro.IIntroPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
-// */
-// public void removePropertyListener(IPropertyListener l) {
-// removeListenerObject(l);
-// }
-//
-// /**
-// * The base implementation of this {@link org.eclipse.ui.intro.IIntroPart} method does nothing.
-// * Subclasses may override.
-// *
-// * @param memento
-// * a memento to receive the object state
-// */
-// public void saveState(IMemento memento) {
-// //no-op
-// }
-//
-// /*
-// * (non-Javadoc) Asks this part to take focus within the workbench.
-// * <p>
-// * Subclasses must implement this method. For a detailed description of the
-// * requirements see <code>IIntroPart</code>
-// * </p>
-// *
-// * @see IIntroPart
-// */
-// public abstract void setFocus();
-//
-// /**
-// * The <code>IntroPart</code> implementation of this
-// * <code>IExecutableExtension</code> records the configuration element in
-// * and internal state variable (accessible via <code>getConfigElement</code>).
-// * It also loads the title image, if one is specified in the configuration
-// * element. Subclasses may extend.
-// *
-// * Should not be called by clients. It is called by the core plugin when
-// * creating this executable extension.
-// */
-// public void setInitializationData(IConfigurationElement cfig,
-// String propertyName, Object data) {
-//
-// // Save config element.
-// configElement = cfig;
-//
-// titleLabel = cfig.getAttribute(IWorkbenchRegistryConstants.ATT_LABEL);
-//
-// // Icon.
-// String strIcon = cfig.getAttribute(IWorkbenchRegistryConstants.ATT_ICON);
-// if (strIcon == null) {
-// return;
-// }
-//
-// imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
-// configElement.getNamespace(), strIcon);
-//
-// if (imageDescriptor == null) {
-// return;
-// }
-//
-// Image image = JFaceResources.getResources().createImageWithDefault(imageDescriptor);
-// titleImage = image;
-// }
-//
-// /**
-// * Sets or clears the title image of this part.
-// *
-// * @param titleImage
-// * the title image, or <code>null</code> to clear
-// */
-// protected void setTitleImage(Image titleImage) {
-// Assert.isTrue(titleImage == null || !titleImage.isDisposed());
-// //Do not send changes if they are the same
-// if (this.titleImage == titleImage) {
-// return;
-// }
-// this.titleImage = titleImage;
-// firePropertyChange(IIntroPart.PROP_TITLE);
-// }
-//
-// /**
-// * Set the title string for this part.
-// *
-// * @param titleLabel the title string. Must not be <code>null</code>.
-// */
-// protected void setTitle(String titleLabel) {
-// Assert.isNotNull(titleLabel);
-// if (Util.equals(this.titleLabel, titleLabel))
-// return;
-// this.titleLabel = titleLabel;
-// firePropertyChange(IIntroPart.PROP_TITLE);
-// }
-//}
+/*******************************************************************************
+ * Copyright (c) 2004, 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
+ *******************************************************************************/
+package org.eclipse.ui.part;
+
+import org.eclipse.core.commands.common.EventManager;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.util.SafeRunnable;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPropertyListener;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.intro.IntroMessages;
+import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
+import org.eclipse.ui.internal.util.Util;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.ui.intro.IIntroSite;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+
+/**
+ * Abstract base implementation of an intro part.
+ * <p>
+ * Subclasses must implement the following methods:
+ * <ul>
+ * <li><code>createPartControl</code>- to create the intro part's controls
+ * </li>
+ * <li><code>setFocus</code>- to accept focus</li>
+ * <li><code>standbyStateChanged</code>- to change the standby mode</li>
+ * </ul>
+ * </p>
+ * <p>
+ * Subclasses may extend or reimplement the following methods as required:
+ * <ul>
+ * <li><code>setInitializationData</code>- extend to provide additional
+ * initialization when the intro extension is instantiated</li>
+ * <li><code>init(IIntroSite, IMemento)</code>- extend to provide additional
+ * initialization when intro is assigned its site</li>
+ * <li><code>dispose</code>- extend to provide additional cleanup</li>
+ * <li><code>getAdapter</code>- reimplement to make their intro adaptable
+ * </li>
+ * </ul>
+ * </p>
+ * @since 1.2
+ */
+public abstract class IntroPart extends EventManager implements IIntroPart,
+ IExecutableExtension {
+
+ private IConfigurationElement configElement;
+
+ private ImageDescriptor imageDescriptor;
+
+ private IIntroSite partSite;
+
+ private Image titleImage;
+
+ private String titleLabel;
+
+ /**
+ * Creates a new intro part.
+ */
+ protected IntroPart() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
+ */
+ public void addPropertyListener(IPropertyListener l) {
+ addListenerObject(l);
+ }
+
+ /*
+ * (non-Javadoc) Creates the SWT controls for this intro part. <p>
+ * Subclasses must implement this method. For a detailed description of the
+ * requirements see <code> IIntroPart </code></p>
+ *
+ * @param parent the parent control
+ *
+ * @see IIntroPart
+ */
+ public abstract void createPartControl(Composite parent);
+
+ /**
+ * The <code>IntroPart</code> implementation of this
+ * <code>IIntroPart</code> method disposes the title image loaded by
+ * <code>setInitializationData</code>. Subclasses may extend.
+ */
+ public void dispose() {
+ if (titleImage != null) {
+ JFaceResources.getResources().destroyImage(imageDescriptor);
+ titleImage = null;
+ }
+
+ // Clear out the property change listeners as we
+ // should not be notifying anyone after the part
+ // has been disposed.
+ clearListeners();
+ }
+
+ /**
+ * Fires a property changed event.
+ *
+ * @param propertyId
+ * the id of the property that changed
+ */
+ protected void firePropertyChange(final int propertyId) {
+ Object[] array = getListeners();
+ for (int nX = 0; nX < array.length; nX++) {
+ final IPropertyListener l = (IPropertyListener) array[nX];
+ Platform.run(new SafeRunnable() {
+
+ public void run() {
+ l.propertyChanged(this, propertyId);
+ }
+ });
+ }
+ }
+
+ /**
+ * This implementation of the method declared by <code>IAdaptable</code>
+ * passes the request along to the platform's adapter manager; roughly
+ * <code>Platform.getAdapterManager().getAdapter(this, adapter)</code>.
+ * Subclasses may override this method (however, if they do so, they should
+ * invoke the method on their superclass to ensure that the Platform's
+ * adapter manager is consulted).
+ */
+ public Object getAdapter(Class adapter) {
+ return Platform.getAdapterManager().getAdapter(this, adapter);
+ }
+
+ /**
+ * Returns the configuration element for this part. The configuration
+ * element comes from the plug-in registry entry for the extension defining
+ * this part.
+ *
+ * @return the configuration element for this part
+ */
+ protected IConfigurationElement getConfigurationElement() {
+ return configElement;
+ }
+
+ /**
+ * Returns the default title image.
+ *
+ * @return the default image
+ */
+ protected Image getDefaultImage() {
+ return PlatformUI.getWorkbench().getSharedImages().getImage(
+ ISharedImages.IMG_DEF_VIEW);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.intro.IIntroPart#getIntroSite()
+ */
+ public final IIntroSite getIntroSite() {
+ return partSite;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroPart#getTitleImage()
+ */
+ public Image getTitleImage() {
+ if (titleImage != null) {
+ return titleImage;
+ }
+ return getDefaultImage();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroPart#getTitle()
+ */
+ public String getTitle() {
+ if (titleLabel != null) {
+ return titleLabel;
+ }
+ return getDefaultTitle();
+ }
+
+ /**
+ * Return the default title string.
+ *
+ * @return the default title string
+ */
+ private String getDefaultTitle() {
+ return IntroMessages.get().Intro_default_title;
+ }
+
+ /**
+ * The base implementation of this {@link org.eclipse.ui.intro.IIntroPart}method ignores the
+ * memento and initializes the part in a fresh state. Subclasses may extend
+ * to perform any state restoration, but must call the super method.
+ *
+ * @param site
+ * the intro site
+ * @param memento
+ * the intro part state or <code>null</code> if there is no
+ * previous saved state
+ * @exception PartInitException
+ * if this part was not initialized successfully
+ */
+ public void init(IIntroSite site, IMemento memento)
+ throws PartInitException {
+ setSite(site);
+ }
+
+ /**
+ * Sets the part site.
+ * <p>
+ * Subclasses must invoke this method from {@link org.eclipse.ui.intro.IIntroPart#init(IIntroSite, IMemento)}.
+ * </p>
+ *
+ * @param site the intro part site
+ */
+ protected void setSite(IIntroSite site) {
+ this.partSite = site;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.intro.IIntroPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
+ */
+ public void removePropertyListener(IPropertyListener l) {
+ removeListenerObject(l);
+ }
+
+ /**
+ * The base implementation of this {@link org.eclipse.ui.intro.IIntroPart} method does nothing.
+ * Subclasses may override.
+ *
+ * @param memento
+ * a memento to receive the object state
+ */
+ public void saveState(IMemento memento) {
+ //no-op
+ }
+
+ /*
+ * (non-Javadoc) Asks this part to take focus within the workbench.
+ * <p>
+ * Subclasses must implement this method. For a detailed description of the
+ * requirements see <code>IIntroPart</code>
+ * </p>
+ *
+ * @see IIntroPart
+ */
+ public abstract void setFocus();
+
+ /**
+ * The <code>IntroPart</code> implementation of this
+ * <code>IExecutableExtension</code> records the configuration element in
+ * and internal state variable (accessible via <code>getConfigElement</code>).
+ * It also loads the title image, if one is specified in the configuration
+ * element. Subclasses may extend.
+ *
+ * Should not be called by clients. It is called by the core plugin when
+ * creating this executable extension.
+ */
+ public void setInitializationData(IConfigurationElement cfig,
+ String propertyName, Object data) {
+
+ // Save config element.
+ configElement = cfig;
+
+ titleLabel = cfig.getAttribute(IWorkbenchRegistryConstants.ATT_LABEL);
+
+ // Icon.
+ String strIcon = cfig.getAttribute(IWorkbenchRegistryConstants.ATT_ICON);
+ if (strIcon == null) {
+ return;
+ }
+
+ imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
+ configElement.getNamespace(), strIcon);
+
+ if (imageDescriptor == null) {
+ return;
+ }
+
+ Image image = JFaceResources.getResources().createImageWithDefault(imageDescriptor);
+ titleImage = image;
+ }
+
+ /**
+ * Sets or clears the title image of this part.
+ *
+ * @param titleImage
+ * the title image, or <code>null</code> to clear
+ */
+ protected void setTitleImage(Image titleImage) {
+ // RAP [bm] dispose
+ Assert.isTrue(titleImage == null /* || !titleImage.isDisposed() */);
+ //Do not send changes if they are the same
+ if (this.titleImage == titleImage) {
+ return;
+ }
+ this.titleImage = titleImage;
+ firePropertyChange(IIntroPart.PROP_TITLE);
+ }
+
+ /**
+ * Set the title string for this part.
+ *
+ * @param titleLabel the title string. Must not be <code>null</code>.
+ */
+ protected void setTitle(String titleLabel) {
+ Assert.isNotNull(titleLabel);
+ if (Util.equals(this.titleLabel, titleLabel))
+ return;
+ this.titleLabel = titleLabel;
+ firePropertyChange(IIntroPart.PROP_TITLE);
+ }
+}
diff --git a/bundles/org.eclipse.rap.ui/plugin.xml b/bundles/org.eclipse.rap.ui/plugin.xml
index 8888414147..2825b8e714 100755
--- a/bundles/org.eclipse.rap.ui/plugin.xml
+++ b/bundles/org.eclipse.rap.ui/plugin.xml
@@ -47,9 +47,7 @@
<extension-point id="org.eclipse.ui.helpSupport" name="%ExtPoint.helpSupport" schema="schema/helpSupport.exsd"/>
-->
<extension-point id="org.eclipse.ui.importWizards" name="%ExtPoint.importWizards" schema="schema/importWizards.exsd"/>
- <!-- RAP [rh] intro not supported as it is only useful in conjunction with product extension point
<extension-point id="org.eclipse.ui.intro" name="%ExtPoint.intro" schema="schema/intro.exsd"/>
- -->
<extension-point id="org.eclipse.ui.keywords" name="%ExtPoint.keywords" schema="schema/keywords.exsd"/>
<extension-point id="org.eclipse.ui.menus" name="%ExtPoint.menus" schema="schema/menus.exsd"/>
<extension-point id="org.eclipse.ui.newWizards" name="%ExtPoint.newWizards" schema="schema/newWizards.exsd"/>
diff --git a/bundles/org.eclipse.rap.ui/schema/intro.exsd b/bundles/org.eclipse.rap.ui/schema/intro.exsd
index 29ffa19d5a..d90bc4e216 100755
--- a/bundles/org.eclipse.rap.ui/schema/intro.exsd
+++ b/bundles/org.eclipse.rap.ui/schema/intro.exsd
@@ -27,7 +27,9 @@ The life cycle is as follows:
<complexType>
<sequence>
<element ref="intro" minOccurs="0" maxOccurs="unbounded"/>
- <element ref="introProductBinding" minOccurs="0" maxOccurs="unbounded"/>
+ <!-- RAP [bm]: replaced product with branding -->
+ <!--element ref="introProductBinding" minOccurs="0" maxOccurs="unbounded"/-->
+ <element ref="introBrandingBinding" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
<attribute name="point" type="string" use="required">
<annotation>
@@ -116,7 +118,8 @@ Since 3.2
</complexType>
</element>
- <element name="introProductBinding">
+ <!-- RAP [bm]: replaced product with branding -->
+ <!--element name="introProductBinding">
<annotation>
<documentation>
Specifies a binding between a product and an introduction. These bindings determine which introduction is appropriate for the current product (as defined by &lt;code&gt;org.eclipse.core.runtime.Platform.getProduct()&lt;/code&gt;).
@@ -138,6 +141,30 @@ Since 3.2
</annotation>
</attribute>
</complexType>
+ </element-->
+
+ <element name="introBrandingBinding">
+ <annotation>
+ <documentation>
+ Specifies a binding between a branding and an introduction. These bindings determine which introduction is appropriate for the current branding (as defined by &lt;code&gt;org.eclipse.rap.ui.branding&lt;/code&gt;).
+ </documentation>
+ </annotation>
+ <complexType>
+ <attribute name="brandingId" type="string" use="required">
+ <annotation>
+ <documentation>
+ unique id of a branding
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="introId" type="string" use="required">
+ <annotation>
+ <documentation>
+ unique id of an introduction
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
</element>
<annotation>
@@ -145,7 +172,7 @@ Since 3.2
<meta.section type="since"/>
</appInfo>
<documentation>
- 3.0
+ 1.2
</documentation>
</annotation>
diff --git a/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java b/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java
index d758133670..bea28a144d 100755
--- a/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java
+++ b/bundles/org.eclipse.rap.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java
@@ -87,8 +87,7 @@ public class UIPreferenceInitializer extends AbstractPreferenceInitializer {
IWorkbenchPreferenceConstants.BOTTOM);
// default to showing intro on startup
- // RAP [bm]: no intro
-// node.putBoolean(IWorkbenchPreferenceConstants.SHOW_INTRO, true);
+ node.putBoolean(IWorkbenchPreferenceConstants.SHOW_INTRO, true);
// Default to the standard key configuration.
// RAP [bm]: Bindings

Back to the top