diff options
Diffstat (limited to 'bundles/org.eclipse.rap.ui.views')
7 files changed, 72 insertions, 66 deletions
diff --git a/bundles/org.eclipse.rap.ui.views/META-INF/MANIFEST.MF b/bundles/org.eclipse.rap.ui.views/META-INF/MANIFEST.MF index 996d7608b6..f1d9b84468 100644 --- a/bundles/org.eclipse.rap.ui.views/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.rap.ui.views/META-INF/MANIFEST.MF @@ -15,6 +15,7 @@ Export-Package: org.eclipse.ui.internal.views;x-internal:=true, org.eclipse.ui.views.contentoutline, org.eclipse.ui.views.properties; ui.views="split"; mandatory:="ui.views" Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", - org.eclipse.rap.ui;bundle-version="[1.2.0,4.0.0)" + org.eclipse.rap.ui;bundle-version="[1.2.0,4.0.0)", + org.eclipse.rap.help;bundle-version="[1.3.0,4.0.0)" Bundle-RequiredExecutionEnvironment: J2SE-1.4 Eclipse-LazyStart: true diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutline.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutline.java index ffc86f7973..c5754f66c7 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutline.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/contentoutline/ContentOutline.java @@ -108,9 +108,8 @@ public class ContentOutline extends PageBookView implements ISelectionProvider, */ public void createPartControl(Composite parent) { super.createPartControl(parent); -// RAP [fappel]: helpsystem not yet support by RAP -// PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook(), -// CONTENT_OUTLINE_VIEW_HELP_CONTEXT_ID); + PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook(), + CONTENT_OUTLINE_VIEW_HELP_CONTEXT_ID); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/CategoriesAction.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/CategoriesAction.java index 38c7797e36..0538ab7b33 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/CategoriesAction.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/CategoriesAction.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.ui.views.properties; +import org.eclipse.ui.PlatformUI; + /** * This action hides or shows categories in the <code>PropertySheetViewer</code>. @@ -23,9 +25,8 @@ package org.eclipse.ui.views.properties; */ public CategoriesAction(PropertySheetViewer viewer, String name) { super(viewer, name); -// RAP [fappel]: helpsystem not yet support by RAP -// PlatformUI.getWorkbench().getHelpSystem() -// .setHelp(this, IPropertiesHelpContextIds.CATEGORIES_ACTION); + PlatformUI.getWorkbench().getHelpSystem() + .setHelp(this, IPropertiesHelpContextIds.CATEGORIES_ACTION); } /** diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/DefaultsAction.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/DefaultsAction.java index 4226e480f2..95f2bb8c7f 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/DefaultsAction.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/DefaultsAction.java @@ -11,6 +11,8 @@ package org.eclipse.ui.views.properties; +import org.eclipse.ui.PlatformUI; + /** * This action resets the <code>PropertySheetViewer</code> values back @@ -28,9 +30,8 @@ package org.eclipse.ui.views.properties; */ public DefaultsAction(PropertySheetViewer viewer, String name) { super(viewer, name); -// RAP [fappel]: helpsystem not supported -// PlatformUI.getWorkbench().getHelpSystem().setHelp(this, -// IPropertiesHelpContextIds.DEFAULTS_ACTION); + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, + IPropertiesHelpContextIds.DEFAULTS_ACTION); } /** diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/FilterAction.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/FilterAction.java index d94aeaebdb..e9fcaba51a 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/FilterAction.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/FilterAction.java @@ -11,6 +11,8 @@ package org.eclipse.ui.views.properties; +import org.eclipse.ui.PlatformUI; + /** * This action hides or shows expert properties in the <code>PropertySheetViewer</code>. @@ -25,9 +27,8 @@ package org.eclipse.ui.views.properties; */ public FilterAction(PropertySheetViewer viewer, String name) { super(viewer, name); -// RAP [fappel]: helpsystem not supported -// PlatformUI.getWorkbench().getHelpSystem().setHelp(this, -// IPropertiesHelpContextIds.FILTER_ACTION); + PlatformUI.getWorkbench().getHelpSystem().setHelp(this, + IPropertiesHelpContextIds.FILTER_ACTION); } /** diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java index 77d6b20d79..a00558e136 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheet.java @@ -97,10 +97,9 @@ public class PropertySheet extends PageBookView implements ISelectionListener { */ public void createPartControl(Composite parent) { super.createPartControl(parent); -// RAP [fappel]: helpsystem not supported -// getSite().getPage().getWorkbenchWindow().getWorkbench().getHelpSystem() -// .setHelp(getPageBook(), -// IPropertiesHelpContextIds.PROPERTY_SHEET_VIEW); + getSite().getPage().getWorkbenchWindow().getWorkbench().getHelpSystem() + .setHelp(getPageBook(), + IPropertiesHelpContextIds.PROPERTY_SHEET_VIEW); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheetPage.java b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheetPage.java index d8211aae78..333f7a61d6 100644 --- a/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheetPage.java +++ b/bundles/org.eclipse.rap.ui.views/src/org/eclipse/ui/views/properties/PropertySheetPage.java @@ -13,10 +13,15 @@ package org.eclipse.ui.views.properties; import org.eclipse.core.runtime.IAdaptable; +import org.eclipse.help.IContext; import org.eclipse.jface.action.*; import org.eclipse.jface.viewers.*; +import org.eclipse.swt.events.HelpEvent; +import org.eclipse.swt.events.HelpListener; import org.eclipse.swt.widgets.*; import org.eclipse.ui.*; +import org.eclipse.ui.help.IContextComputer; +import org.eclipse.ui.help.IWorkbenchHelpSystem; import org.eclipse.ui.internal.views.ViewsPlugin; import org.eclipse.ui.internal.views.properties.PropertiesMessages; import org.eclipse.ui.part.CellEditorActionHandler; @@ -160,55 +165,54 @@ public class PropertySheetPage extends Page implements IPropertySheetPage, IAdap viewer.getControl().setMenu(menu); // Set help on the viewer -// RAP [fappel]: Helpsystem not supported -// viewer.getControl().addHelpListener(new HelpListener() { -// /* -// * @see HelpListener#helpRequested(HelpEvent) -// */ -// public void helpRequested(HelpEvent e) { -// // Get the context for the selected item -// IStructuredSelection selection = (IStructuredSelection) viewer -// .getSelection(); -// if (!selection.isEmpty()) { -// IPropertySheetEntry entry = (IPropertySheetEntry) selection -// .getFirstElement(); -// Object helpContextId = entry.getHelpContextIds(); -// if (helpContextId != null) { -// if (helpContextId instanceof String) { -// PlatformUI.getWorkbench() -// .getHelpSystem().displayHelp( -// (String) helpContextId); -// return; -// } -// -// // Since 2.0 the only valid type for helpContextIds -// // is a String (a single id). -// // However for backward compatibility we have to handle -// // and array of contexts (Strings and/or IContexts) -// // or a context computer. -// Object[] contexts = null; -// if (helpContextId instanceof IContextComputer) { -// // get local contexts -// contexts = ((IContextComputer) helpContextId) -// .getLocalContexts(e); -// } else { -// contexts = (Object[]) helpContextId; -// } -// IWorkbenchHelpSystem help = PlatformUI.getWorkbench().getHelpSystem(); -// // Ignore all but the first element in the array -// if (contexts[0] instanceof IContext) { -// help.displayHelp((IContext) contexts[0]); -// } else { -// help.displayHelp((String) contexts[0]); -// } -// return; -// } -// } -// -// // No help for the selection so show page help -// PlatformUI.getWorkbench().getHelpSystem().displayHelp(HELP_CONTEXT_PROPERTY_SHEET_PAGE); -// } -// }); + viewer.getControl().addHelpListener(new HelpListener() { + /* + * @see HelpListener#helpRequested(HelpEvent) + */ + public void helpRequested(HelpEvent e) { + // Get the context for the selected item + IStructuredSelection selection = (IStructuredSelection) viewer + .getSelection(); + if (!selection.isEmpty()) { + IPropertySheetEntry entry = (IPropertySheetEntry) selection + .getFirstElement(); + Object helpContextId = entry.getHelpContextIds(); + if (helpContextId != null) { + if (helpContextId instanceof String) { + PlatformUI.getWorkbench() + .getHelpSystem().displayHelp( + (String) helpContextId); + return; + } + + // Since 2.0 the only valid type for helpContextIds + // is a String (a single id). + // However for backward compatibility we have to handle + // and array of contexts (Strings and/or IContexts) + // or a context computer. + Object[] contexts = null; + if (helpContextId instanceof IContextComputer) { + // get local contexts + contexts = ((IContextComputer) helpContextId) + .getLocalContexts(e); + } else { + contexts = (Object[]) helpContextId; + } + IWorkbenchHelpSystem help = PlatformUI.getWorkbench().getHelpSystem(); + // Ignore all but the first element in the array + if (contexts[0] instanceof IContext) { + help.displayHelp((IContext) contexts[0]); + } else { + help.displayHelp((String) contexts[0]); + } + return; + } + } + + // No help for the selection so show page help + PlatformUI.getWorkbench().getHelpSystem().displayHelp(HELP_CONTEXT_PROPERTY_SHEET_PAGE); + } + }); } /** |