diff options
author | Andrey Loskutov | 2017-01-04 18:15:03 +0000 |
---|---|---|
committer | Andrey Loskutov | 2017-01-04 18:24:07 +0000 |
commit | 8abfce119e3408a32d261fcce5da53387320e5c4 (patch) | |
tree | 5614a24a8b868c21f5d693910da26fdfe8426225 | |
parent | 680afa3b0b468c98737bb31e79cd9d2349cf508f (diff) | |
download | eclipse.platform.ua-8abfce119e3408a32d261fcce5da53387320e5c4.tar.gz eclipse.platform.ua-8abfce119e3408a32d261fcce5da53387320e5c4.tar.xz eclipse.platform.ua-8abfce119e3408a32d261fcce5da53387320e5c4.zip |
Bug 509946 - [clean up] fix trailing spaces in platform help once andY20170112-1300Y20170112-1000Y20170105-1040Y20170105-1000I20170112-0245I20170112-0200I20170111-2000I20170111-0200I20170110-2000I20170109-2000I20170108-2000I20170107-2000I20170106-2000I20170105-2000I20170105-0320I20170105-0230I20170104-2000
forever
Applied Cleanup-> Remove trailing spaces on all help projects. Only
those four projects had whitespace issues: org.eclipse.help.ui,
org.eclipse.ui.intro.quicklinks, org.eclipse.ui.intro.universal,
org.eclipse.ui.intro. Same four projects haven't automatic save actions
enabled, therefore I've updated the settings too.
Change-Id: If7f896ab4ceb6587af6f211057729f443fd016cb
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
191 files changed, 1875 insertions, 1702 deletions
diff --git a/org.eclipse.help.ui/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.help.ui/.settings/org.eclipse.jdt.ui.prefs index 0fb87bc39..eb4d0b3d9 100644 --- a/org.eclipse.help.ui/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.help.ui/.settings/org.eclipse.jdt.ui.prefs @@ -28,7 +28,7 @@ sp_cleanup.make_type_abstract_if_missing_method=false sp_cleanup.make_variable_declarations_final=false sp_cleanup.never_use_blocks=false sp_cleanup.never_use_parentheses_in_expressions=true -sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.on_save_use_additional_actions=true sp_cleanup.organize_imports=true sp_cleanup.qualify_static_field_accesses_with_declaring_class=false sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true @@ -37,12 +37,12 @@ sp_cleanup.qualify_static_member_accesses_with_declaring_class=false sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true sp_cleanup.remove_redundant_type_arguments=true -sp_cleanup.remove_trailing_whitespaces=false +sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false sp_cleanup.remove_unnecessary_casts=true sp_cleanup.remove_unnecessary_nls_tags=false -sp_cleanup.remove_unused_imports=false +sp_cleanup.remove_unused_imports=true sp_cleanup.remove_unused_local_variables=false sp_cleanup.remove_unused_private_fields=true sp_cleanup.remove_unused_private_members=false diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/IEngineDescriptor.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/IEngineDescriptor.java index 86ecf00f8..d17d32b9f 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/IEngineDescriptor.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/IEngineDescriptor.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -20,17 +20,17 @@ import java.util.Dictionary; * description changed. * <p> * This interface is not intended to be extended or implemented by clients. - * + * * @since 3.1 * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. - * + * */ public interface IEngineDescriptor { /** * Returns the unique identifier of this engine instance. - * + * * @return the unique engine identifier */ String getId(); @@ -38,14 +38,14 @@ public interface IEngineDescriptor { /** * Returns the unique identifier of the engine type of which this is an * instance. - * + * * @return the engine type identifier */ String getEngineTypeId(); /** * Returns the label of this engine for rendering in the UI. - * + * * @return the engine label */ String getLabel(); @@ -53,7 +53,7 @@ public interface IEngineDescriptor { /** * Changes the label of this engine. This method does nothing for engine * descriptors that are not user-defined. - * + * * @param label * the new engine label */ @@ -69,7 +69,7 @@ public interface IEngineDescriptor { /** * Changes the description of this engine. This method does nothing for * engine descriptors that are not user-defined. - * + * * @param desc * the new engine description */ @@ -78,7 +78,7 @@ public interface IEngineDescriptor { /** * Returns the parameters used to configure this engine according to the * valid parameters for the associated engine type. - * + * * @return the parameter dictionary */ Dictionary<String, Object> getParameters(); @@ -87,7 +87,7 @@ public interface IEngineDescriptor { * Tests whether this engine is provided as an extension point contribution * or is created by the user in the scope settings dialog. Only user-defined * engine instances can have their label and/or description changed. - * + * * @return <code>true</code> if the engine is user defined, or * <code>false</code> otherwise. */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopeFactory.java index 23ed7f773..3a1fd4c29 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopeFactory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopeFactory.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -22,7 +22,7 @@ import org.eclipse.jface.preference.IPreferenceStore; * engines. Search engine and scope factory are defined together in the same * extension point, hence the actual implementation of ISearchScope is up to the * contributor. - * + * * @since 3.1 */ public interface ISearchScopeFactory { @@ -35,7 +35,7 @@ public interface ISearchScopeFactory { * In cases where conflicting values can be found in the preference store * and parameters, preference store should win i.e. parameters should be * treated as default values only. - * + * * @param store * the preference store that holds the scope data * @param engineId diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopePage.java index b357e4b68..a8e965d05 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopePage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/ISearchScopePage.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -15,13 +15,13 @@ import org.eclipse.jface.preference.IPreferencePage; /** * Preference pages that are used for editing help search scope settings should * implement this interface. - * + * * @since 3.1 */ public interface ISearchScopePage extends IPreferencePage { /** * Initializes the search scope page. - * + * * @param ed * the descriptor of the engine associated with this page * @param scopeSetName diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java index a057b8e75..f5ce05196 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/RootScopePage.java @@ -4,10 +4,10 @@ * 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 - * Alex Blewitt - Bug 474070 + * Alex Blewitt - Bug 474070 *******************************************************************************/ package org.eclipse.help.ui; @@ -37,7 +37,7 @@ import org.eclipse.ui.PlatformUI; * engine name, image and description, as well as the master switch that turns * the engine on or off. When the engine master switch is set to false, all the * children in the client composite will be disabled. - * + * * @since 3.1 */ public abstract class RootScopePage extends PreferencePage implements @@ -74,7 +74,7 @@ public abstract class RootScopePage extends PreferencePage implements * Creates the initial contents of the page and allocates the area for the * clients. Classes that extend this class should implement * <code>createScopeContents(Composite)</code> instead. - * + * * @param parent * the page parent * @return the page client control @@ -89,7 +89,7 @@ public abstract class RootScopePage extends PreferencePage implements GridData gd; //if (ed.isUserDefined()) layout.numColumns = 2; - contentContainer.setLayout(layout); + contentContainer.setLayout(layout); if (isInPreferenceDialog()) { masterButton = new Button(contentContainer, SWT.CHECK); masterButton.setText(Messages.RootScopePage_masterButton); @@ -153,7 +153,7 @@ public abstract class RootScopePage extends PreferencePage implements * Called when the value of the master switch has changed. The default * implementation disables the scope contents control when the master switch * is off. Subclass can override this behaviour. - * + * * @param value * <code>true</code> if the master switch is on, * <code>false</code> otherwise. @@ -185,7 +185,7 @@ public abstract class RootScopePage extends PreferencePage implements /** * Returns the scope set name passed to the page during initialization. - * + * * @return the name of the current scope set */ @@ -195,7 +195,7 @@ public abstract class RootScopePage extends PreferencePage implements /** * Returns the descriptor of the engine associated with this page. - * + * * @return the engine descriptor */ @@ -206,7 +206,7 @@ public abstract class RootScopePage extends PreferencePage implements /** * Tests whether the search engine has been selected to participate in the * search. - * + * * @return <code>true</code> if the search engine is enabled, </code>false</code> * otherwise. */ @@ -221,7 +221,7 @@ public abstract class RootScopePage extends PreferencePage implements /** * Stores the value of the master switch in the preference store. Subclasses * may override but must call 'super'. - * + * * @return <code>true</code> if the wizard can be closed, * <code>false</code> otherwise. */ @@ -270,7 +270,7 @@ public abstract class RootScopePage extends PreferencePage implements /** * Initializes default values of the store to be used when the user presses * 'Defaults' button. Subclasses may override but must call 'super'. - * + * * @param store * the preference store */ @@ -293,7 +293,7 @@ public abstract class RootScopePage extends PreferencePage implements * need for themselves only. Clients that implement this method should * return the required number of columns so that the root page widgets can * be adjusted if more columns are needed than initially set. - * + * * @param parent * the page parent * @return number of columns required by the client content diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java index 1824266bd..9f92faa30 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/browser/LaunchURL.java @@ -81,7 +81,7 @@ public class LaunchURL implements IWorkbenchWindowActionDelegate, } catch (Exception e) { HelpUIPlugin.logError("Exception occurred when opening URL: " + url //$NON-NLS-1$ + ".", e); //$NON-NLS-1$ - ErrorUtil.displayErrorDialog(Messages.LaunchURL_exception); + ErrorUtil.displayErrorDialog(Messages.LaunchURL_exception); } } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java index 9b6621bc7..71fd47748 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/CloseHelpTrayHandler.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java index 4cbfde99b..a38bdaa97 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -86,7 +86,7 @@ public class ContextHelpDialog { /** * Constructor: - * + * * @param context * an array of String or an array of IContext * @param x @@ -167,7 +167,7 @@ public class ContextHelpDialog { // Correct x and y of the shell if it not contained within the screen int width = shell.getBounds().width; int height = shell.getBounds().height; - + Rectangle screen = display.getClientArea(); // check lower boundaries x = x >= screen.x ? x : screen.x; @@ -212,7 +212,7 @@ public class ContextHelpDialog { } return contents; } - + private Control createInfoArea(Composite parent) { // Create the text field. String styledText = null; @@ -222,7 +222,7 @@ public class ContextHelpDialog { if (styledText == null && context.getText() != null) { styledText = context.getText(); styledText= styledText.replaceAll("<b>","<@#\\$b>"); //$NON-NLS-1$ //$NON-NLS-2$ - styledText= styledText.replaceAll("</b>", "</@#\\$b>"); //$NON-NLS-1$ //$NON-NLS-2$ + styledText= styledText.replaceAll("</b>", "</@#\\$b>"); //$NON-NLS-1$ //$NON-NLS-2$ } if (styledText == null) { // no description found in context objects. styledText = Messages.ContextHelpPart_noDescription; @@ -256,7 +256,7 @@ public class ContextHelpDialog { /** * Measures the longest label of related links - * + * * @param text * @return */ @@ -343,7 +343,7 @@ public class ContextHelpDialog { // create link to the dynamic help createDynamicHelpLink(composite); } - + return composite; } @@ -388,7 +388,7 @@ public class ContextHelpDialog { && !Constants.OS_WIN32.equalsIgnoreCase(Platform .getOS())); } - + private void openDynamicHelp() { BusyIndicator.showWhile(shell.getDisplay(), () -> { close(); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java index d1355cc74..67a8abd07 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java @@ -4,9 +4,9 @@ * 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 + * + * Contributors: + * IBM Corporation - initial API and implementation * Sebastian Davids <sdavids@gmx.de> - bug 93374 **************************************************************************************************/ package org.eclipse.help.ui.internal; @@ -228,14 +228,14 @@ public class DefaultHelpUI extends AbstractHelpUI { } } } - + public static void showIndex() { HelpView helpView = getHelpView(); if (helpView != null) { helpView.showIndex(); } } - + private static HelpView getHelpView() { HelpView view = null; IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); @@ -251,7 +251,7 @@ public class DefaultHelpUI extends AbstractHelpUI { } } catch (PartInitException e) { } - } + } } return view; } @@ -285,7 +285,7 @@ public class DefaultHelpUI extends AbstractHelpUI { /** * Displays context-sensitive help for specified context - * + * * @param context * the context to display * @param x @@ -341,7 +341,7 @@ public class DefaultHelpUI extends AbstractHelpUI { if (isSingleChoiceWithoutDescription) { view.showHelp(topics[0].getHref()); } else { - view.displayContext(context, activePart, c); + view.displayContext(context, activePart, c); } } } @@ -373,7 +373,7 @@ public class DefaultHelpUI extends AbstractHelpUI { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.help.AbstractHelpUI#resolve(java.lang.String, boolean) */ private static Shell getActiveShell() { @@ -415,7 +415,7 @@ public class DefaultHelpUI extends AbstractHelpUI { private void displayContextAsHelpTray(Shell activeShell, IContext context) { Control controlInFocus = activeShell.getDisplay().getFocusControl(); TrayDialog dialog = (TrayDialog)activeShell.getData(); - + DialogTray tray = dialog.getTray(); if (tray == null) { tray = new HelpTray(); @@ -488,7 +488,7 @@ public class DefaultHelpUI extends AbstractHelpUI { } return false; } - + public static boolean showInWorkbenchBrowser(String url, boolean onlyInternal) { IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport(); if (!onlyInternal || support.isInternalWebBrowserAvailable()) { @@ -512,7 +512,7 @@ public class DefaultHelpUI extends AbstractHelpUI { /* * Used to indicate to the HelpView that we are about to pass in a context */ - + public static boolean isOpeningHelpView() { return openingHelpView; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java index 0f6e22d60..16dcad9af 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DynamicHelpAction.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java index b5b76aff3..8a03d1462 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ExecuteCommandAction.java @@ -28,7 +28,7 @@ import org.eclipse.ui.handlers.IHandlerService; * service. This class is intended to be called by the * <code>executeCommand</code> function in <code>livehelp.js</code> (defined * in <code>org.eclipse.help</code> plugin). - * + * * @since 3.2 */ public class ExecuteCommandAction implements ILiveHelpAction { @@ -51,7 +51,7 @@ public class ExecuteCommandAction implements ILiveHelpAction { // No command to execute! return; } - + // workaround problem described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=133694 // by making sure we can get the workbench before running the command. In standalone // help mode the attempt to get the workbench will fail and we will show an error dialog. @@ -74,7 +74,7 @@ public class ExecuteCommandAction implements ILiveHelpAction { }); } - + /** * This was introduced to work around the behavior described in * https://bugs.eclipse.org/bugs/show_bug.cgi?id=130206 @@ -125,7 +125,7 @@ public class ExecuteCommandAction implements ILiveHelpAction { } private IHandlerService getHandlerService() { - IWorkbench wb = PlatformUI.getWorkbench(); + IWorkbench wb = PlatformUI.getWorkbench(); if (wb != null) { Object serviceObject = wb.getAdapter(IHandlerService.class); if (serviceObject != null) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java index b93bc637e..aefe7d6b7 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpActivitySupport.java @@ -43,16 +43,16 @@ public class HelpActivitySupport implements IHelpActivitySupport { private boolean userCanToggleFiltering; private boolean filteringEnabled; private ActivityDescriptor activityDescriptor; - + class ActivityDescriptor { private IConfigurationElement config; private String documentMessage; private boolean needsLiveHelp; - + public ActivityDescriptor() { load(); } - + private void load() { IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.help.base.activitySupport");//$NON-NLS-1$ if (elements.length==1 && elements[0].getName().equals("support")) //$NON-NLS-1$ @@ -60,7 +60,7 @@ public class HelpActivitySupport implements IHelpActivitySupport { else if (elements.length>0) { IProduct product = Platform.getProduct(); if (product==null) return; - String productId = product.getId(); + String productId = product.getId(); for (int i=0; i<elements.length; i++) { IConfigurationElement element = elements[i]; if (element.getAttribute("productId").equals(productId)) { //$NON-NLS-1$ @@ -113,13 +113,13 @@ public class HelpActivitySupport implements IHelpActivitySupport { return "javascript:liveAction(\""+pluginId+"\", \""+className+"\",\""+evalue+"\")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ } } - + public HelpActivitySupport(IWorkbench workbench) { activitySupport = workbench.getActivitySupport(); activityDescriptor = new ActivityDescriptor(); - String showDisabledActivities = + String showDisabledActivities = Platform.getPreferencesService().getString(HelpBasePlugin.PLUGIN_ID, PREF_KEY_SHOW_DISABLED_ACTIVITIES, "", null); //$NON-NLS-1$ userCanToggleFiltering = SHOW_DISABLED_ACTIVITIES_OFF .equalsIgnoreCase(showDisabledActivities) @@ -185,7 +185,7 @@ public class HelpActivitySupport implements IHelpActivitySupport { * Checks whether topic belongs to a TOC that mathes enabled activity. * Enabled children TOCs are searched if linked by also enabled TOCs. * Additionally topic may match description topic of a root TOC. - * + * * @return true if topic belongs to an enabled TOC * @param href * @param locale diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java index 5f67a79d6..1efa79aeb 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIEvaluationContext.java @@ -23,9 +23,9 @@ public final class HelpUIEvaluationContext { private static final String VARIABLE_PLATFORM = "platform"; //$NON-NLS-1$ private static final String VARIABLE_WORKBENCH = "workbench"; //$NON-NLS-1$ - + private static EvaluationContext context; - + /* * Returns the evaluation context to use in help documents. */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java index 7379ce59a..10d2aaff1 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIPlugin.java @@ -60,7 +60,7 @@ public class HelpUIPlugin extends AbstractUIPlugin { /** * Provides access to singleton - * + * * @return HelpUIPlugin */ public static HelpUIPlugin getDefault() { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIResources.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIResources.java index 851ea0fa4..3bba3716a 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIResources.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HelpUIResources.java @@ -26,18 +26,18 @@ import org.osgi.framework.Bundle; * class needs to properly use the desired locale. */ public class HelpUIResources { - + private static final String LEAF = "_leaf"; //$NON-NLS-1$ private static final String CLOSED = "_closed"; //$NON-NLS-1$ private static final String OPEN = "_open"; //$NON-NLS-1$ - private static final String EXT_PT = "org.eclipse.help.toc"; //$NON-NLS-1$ + private static final String EXT_PT = "org.eclipse.help.toc"; //$NON-NLS-1$ private static final String TOC_ICON_ELEMENT = "tocIcon"; //$NON-NLS-1$ private static final String TOC_ICON_ID = "id"; //$NON-NLS-1$ private static final String OPEN_ICON_PATH = "openIcon"; //$NON-NLS-1$ private static final String CLOSED_ICON_PATH = "closedIcon"; //$NON-NLS-1$ private static final String LEAF_ICON_PATH= "leafIcon"; //$NON-NLS-1$ private static boolean iconsInitialized = false; - + /** * WorkbenchResources constructor comment. */ @@ -51,7 +51,7 @@ public class HelpUIResources { IPath path = new Path("$nl$/icons/").append(name); //$NON-NLS-1$ return FileLocator.find(HelpUIPlugin.getDefault().getBundle(), path, null); } - + /** * Returns an image descriptor from a property file * @param name simple image file name @@ -68,29 +68,29 @@ public class HelpUIResources { } return desc; } - + public static ImageDescriptor getImageDescriptor(String bundleId, String name) { - ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); + ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); ImageDescriptor desc = registry.getDescriptor(name); if (desc==null) { Bundle bundle = Platform.getBundle(bundleId); if (bundle==null) return null; - URL url = FileLocator.find(bundle, new Path(name), null); + URL url = FileLocator.find(bundle, new Path(name), null); desc = ImageDescriptor.createFromURL(url); registry.put(name, desc); } return desc; } - + public static ImageDescriptor getIconImageDescriptor(String bundleId, String path, String key) { - ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); - ImageDescriptor desc = registry.getDescriptor(key); + ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); + ImageDescriptor desc = registry.getDescriptor(key); if (desc==null) { Bundle bundle = Platform.getBundle(bundleId); if (bundle == null) return null; - URL url = FileLocator.find(bundle, new Path(path), null); + URL url = FileLocator.find(bundle, new Path(path), null); desc = ImageDescriptor.createFromURL(url); - registry.put(key, desc); + registry.put(key, desc); } return desc; } @@ -105,7 +105,7 @@ public class HelpUIResources { ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); return registry.get(key); } - + /** * Get the image for an icon based upon the id * @param iconId The id of the icon, may be null, if so a null image is returned @@ -120,7 +120,7 @@ public class HelpUIResources { initializeTocIcons(); String suffix; if (isOpen) { - suffix = OPEN; + suffix = OPEN; } else if (isLeaf) { suffix = LEAF; } else { @@ -132,13 +132,13 @@ public class HelpUIResources { } return lookupImage(iconId + OPEN); } - + private static Image lookupImage(String name) { ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); return registry.get(name); } - - private static void initializeTocIcons(){ + + private static void initializeTocIcons(){ if (iconsInitialized) { return; } @@ -147,29 +147,29 @@ public class HelpUIResources { IExtension[] extensionsFound = Platform.getExtensionRegistry().getExtensionPoint(EXT_PT).getExtensions(); for(int i=0; i < extensionsFound.length; i++){ - - IConfigurationElement[] configElements = extensionsFound[i].getConfigurationElements(); + + IConfigurationElement[] configElements = extensionsFound[i].getConfigurationElements(); for(int j=0; j < configElements.length; j++){ - if (configElements[j].getName().equals(TOC_ICON_ELEMENT)){ + if (configElements[j].getName().equals(TOC_ICON_ELEMENT)){ IConfigurationElement iconElem = configElements[j]; String attrs[] = iconElem.getAttributeNames(); String contributorID = iconElem.getContributor().getName(); - - for (int k=0; k < attrs.length; k++){ - if(attrs[k].equals(OPEN_ICON_PATH)) - HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(OPEN_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + OPEN); + + for (int k=0; k < attrs.length; k++){ + if(attrs[k].equals(OPEN_ICON_PATH)) + HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(OPEN_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + OPEN); if(attrs[k].equals(CLOSED_ICON_PATH)) - HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(CLOSED_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + CLOSED); + HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(CLOSED_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + CLOSED); if(attrs[k].equals(LEAF_ICON_PATH)) - HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(LEAF_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + LEAF); + HelpUIResources.getIconImageDescriptor(contributorID, iconElem.getAttribute(LEAF_ICON_PATH), iconElem.getAttribute(TOC_ICON_ID) + LEAF); } - + } - - } + + } } } - + /** * Returns an image from a property file * @param name simple image file name @@ -183,9 +183,9 @@ public class HelpUIResources { getImageDescriptor(name); return registry.get(name); } - + public static Image getImage(URL url) { - ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); + ImageRegistry registry = HelpUIPlugin.getDefault().getImageRegistry(); String name = url.toString(); ImageDescriptor desc = registry.getDescriptor(name); if (desc==null) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java index fdac10127..f23f2328d 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkHandler.java @@ -293,7 +293,7 @@ public class HyperlinkHandler /** * Sent when an event that the receiver has registered for occurs. - * + * * @param event * the event which occurred */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java index 40ba84027..69048f60f 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/HyperlinkLabel.java @@ -41,7 +41,7 @@ import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.TypedListener; /** - * + * * A canvas holding a hyperlink label. Need this to deal with focus selection. */ public class HyperlinkLabel extends Canvas { @@ -50,7 +50,7 @@ public class HyperlinkLabel extends Canvas { /** * Constructor for Hyperlink. - * + * * @param parent * @param style */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHelpUIConstants.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHelpUIConstants.java index dbeae8518..774f69e5f 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHelpUIConstants.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHelpUIConstants.java @@ -23,10 +23,10 @@ public interface IHelpUIConstants { + "prefPageHelpContent"; //$NON-NLS-1$ public static final String PREF_PAGE_CUSTOM_BROWSER_PATH = HELP_UI_PLUGIN_ID + "prefPageCustomBrowserPath"; //$NON-NLS-1$ - + public static final String IMAGE_FILE_F1TOPIC = "obj16/topic_small.gif"; //$NON-NLS-1$ public static final String IMAGE_COMMAND_F1TOPIC = "obj16/command_small.gif"; //$NON-NLS-1$ - + // Help view images public static final String IMAGE_CONTAINER = "obj16/container_obj.gif"; //$NON-NLS-1$ public static final String IMAGE_TOC_CLOSED= "obj16/toc_closed.gif"; //$NON-NLS-1$ @@ -36,7 +36,7 @@ public interface IHelpUIConstants { public static final String IMAGE_HELP_SEARCH = "etool16/helpsearch_co.gif"; //$NON-NLS-1$ public static final String IMAGE_HELP_PRINT = "etool16/print_topic.gif"; //$NON-NLS-1$ public static final String IMAGE_RELATED_TOPICS = "etool16/reltopics_co.gif"; //$NON-NLS-1$ - public static final String IMAGE_ALL_TOPICS = "etool16/alltopics_co.gif"; //$NON-NLS-1$ + public static final String IMAGE_ALL_TOPICS = "etool16/alltopics_co.gif"; //$NON-NLS-1$ public static final String IMAGE_INDEX = "etool16/index_co.gif"; //$NON-NLS-1$ public static final String IMAGE_HELP = "etool16/help.gif"; //$NON-NLS-1$ public static final String IMAGE_DHELP = "view16/help_view.gif"; //$NON-NLS-1$ @@ -51,7 +51,7 @@ public interface IHelpUIConstants { public static final String IMAGE_D_REDUCE = "dlcl16/reduce_font.gif"; //$NON-NLS-1$ public static final String IMAGE_COLLAPSE_ALL = "elcl16/collapseall.gif"; //$NON-NLS-1$ public static final String IMAGE_SYNC_TOC = "elcl16/synch_toc_nav.gif"; //$NON-NLS-1$ - public static final String IMAGE_SHOW_ALL = "elcl16/show_all.gif"; //$NON-NLS-1$ + public static final String IMAGE_SHOW_ALL = "elcl16/show_all.gif"; //$NON-NLS-1$ public static final String IMAGE_DOC_OVR = "ovr16/doc_co.gif"; //$NON-NLS-1$ public static final String IMAGE_SCOPE_SET = "obj16/scopeset_obj.gif"; //$NON-NLS-1$ public static final String IMAGE_SEARCH_WIZ = "wizban/newsearch_wiz.gif"; //$NON-NLS-1$ @@ -60,7 +60,7 @@ public interface IHelpUIConstants { public static final String HV_FSEARCH = "fsearch"; //$NON-NLS-1$ public static final String HV_SEARCH_RESULT = "search-result"; //$NON-NLS-1$ public static final String HV_FSEARCH_RESULT = "fsearch-result"; //$NON-NLS-1$ - + public static final String HV_TOPIC_TREE = "topic-tree"; //$NON-NLS-1$ public static final String HV_BOOKMARKS_TREE = "bookmarks-tree"; //$NON-NLS-1$ public static final String HV_BOOKMARKS_HEADER = "bookmarks-header"; //$NON-NLS-1$ @@ -74,7 +74,7 @@ public interface IHelpUIConstants { public static final String HV_RELATED_TOPICS = "related-topics"; //$NON-NLS-1$ public static final String HV_CONTEXT_HELP_PAGE = "context-help-page"; //$NON-NLS-1$ public static final String HV_MISSING_CONTENT = "missing-content"; //$NON-NLS-1$ - + public static final String HV_INDEX = "index"; //$NON-NLS-1$ public static final String HV_INDEX_TYPEIN = "index-typein"; //$NON-NLS-1$ public static final String HV_INDEX_PAGE = "index-page"; //$NON-NLS-1$ @@ -83,7 +83,7 @@ public interface IHelpUIConstants { static final String ENGINE_EXP_ID = "org.eclipse.help.ui.searchEngine"; //$NON-NLS-1$ static final String TAG_ENGINE = "engine"; //$NON-NLS-1$ static final String ATT_ID = "id"; //$NON-NLS-1$ - + static final String ATT_LABEL ="label"; //$NON-NLS-1$ static final String ATT_ICON = "icon";//$NON-NLS-1$ static final String ATT_CLASS = "class";//$NON-NLS-1$ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHyperlinkListener.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHyperlinkListener.java index d7f0472fa..ec023a24c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHyperlinkListener.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/IHyperlinkListener.java @@ -13,7 +13,7 @@ package org.eclipse.help.ui.internal; import org.eclipse.swt.widgets.*; /** - * + * */ public interface IHyperlinkListener { /** diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java index 3895dee84..caa199229 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/Messages.java @@ -124,11 +124,11 @@ public final class Messages extends NLS { public static String BrowserPart_reduceTooltip; public static String BrowserPart_highlightTooltip; public static String BrowserPart_printTooltip; - public static String BrowserPart_syncTocTooltip; + public static String BrowserPart_syncTocTooltip; public static String HelpPreferencePage_wlabel; public static String HelpPreferencePage_view; public static String HelpPreferencePage_helpBrowser; - public static String HelpPreferencePage_externalBrowser; + public static String HelpPreferencePage_externalBrowser; public static String HelpPreferencePage_dlabel; public static String HelpPreferencePage_tray; public static String HelpPreferencePage_search; @@ -150,7 +150,7 @@ public final class Messages extends NLS { public static String AskShowAll_dialogTitle; public static String AskShowAll_message; public static String AskShowAll_toggleMessage; - + public static String DefaultHelpUI_wtitle; public static String DefaultHelpUI_noPerspMessage; public static String ContextHelpDialog_showInDynamicHelp; @@ -165,7 +165,7 @@ public final class Messages extends NLS { public static String HelpPreferencePage_openInPlace; public static String HelpPreferencePage_openInEditor; public static String HelpPreferencePage_openInBrowser; - + public static String ReusableHelpPart_internalBrowserTitle; public static String ReusableHelpPart_internalWebBrowserError; public static String ScopeSet_errorLoading; @@ -174,13 +174,13 @@ public final class Messages extends NLS { public static String ScopeSet_selectWorkingSet; public static String IndexInstructions; public static String IndexButton; - + public static String NoWorkbenchForExecuteCommand_msg; - + public static String SearchEmbeddedHelpOnly; public static String SearchEmbeddedHelpFirst; public static String SearchEmbeddedHelpLast; - + // Remote Help Preferences public static String AddICDialog_10; @@ -197,7 +197,7 @@ public final class Messages extends NLS { public static String AddICDialog_7; public static String AddICDialog_8; - + public static String AddICDialog_9; public static String EditICDialog_10; @@ -209,7 +209,7 @@ public final class Messages extends NLS { public static String EditICDialog_13; public static String EditICDialog_14; - + public static String EditICDialog_15; public static String EditICDialog_7; @@ -255,7 +255,7 @@ public final class Messages extends NLS { public static String ViewICPropsDialog_13; public static String ViewICPropsDialog_14; - + public static String ViewICPropsDialog_19; public static String ViewICPropsDialog_20; @@ -277,6 +277,6 @@ public final class Messages extends NLS { public static String See; public static String SeeAlso; public static String SeeList; - + public static String AlternateQueries; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java index 1998ecdf1..cb829aa7c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/SearchAction.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java index cc35bbfd5..cd959ca5b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowCapabilitiesPreferenceAction.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java index 2164875bd..060fad9aa 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ShowInTocAction.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -23,7 +23,7 @@ import org.eclipse.help.ui.internal.views.ReusableHelpPart; public class ShowInTocAction implements ILiveHelpAction { private String path; - + @Override public void setInitializationString(String data) { path = data; @@ -43,7 +43,7 @@ public class ShowInTocAction implements ILiveHelpAction { }); } } - + private IHelpResource getHelpResource() { StringTokenizer tok = new StringTokenizer(path, "_"); //$NON-NLS-1$ int index = Integer.parseInt(tok.nextToken()); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java index e4300080c..32939cb78 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowser.java @@ -112,14 +112,14 @@ public class EmbeddedBrowser { HelpApplication.stopHelp(); } }); - + browser = new Browser(shell, SWT.NONE); browser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); initialize(browser); - + createStatusBar(shell); initializeStatusBar(browser); - + // use saved location and size x = Platform.getPreferencesService().getInt(HelpUIPlugin.PLUGIN_ID, BROWSER_X, 0, null); y = Platform.getPreferencesService().getInt(HelpUIPlugin.PLUGIN_ID, BROWSER_Y, 0, null); @@ -184,7 +184,7 @@ public class EmbeddedBrowser { /** * Constructor for derived help window It is either secondary browser or a * help dialog - * + * * @param event * @param parent * Shell or null @@ -237,7 +237,7 @@ public class EmbeddedBrowser { } } }); - + } private void initialize(Browser browser) { browser.addOpenWindowListener(event -> { @@ -298,7 +298,7 @@ public class EmbeddedBrowser { } }); } - + private void initializeStatusBar(Browser browser) { browser.addStatusTextListener(event -> { event.text = event.text.replaceAll("&", "&&"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -326,7 +326,7 @@ public class EmbeddedBrowser { } }); } - + private void createStatusBar(Composite parent) { statusBar = new Composite(parent, SWT.NONE); statusBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); @@ -357,7 +357,7 @@ public class EmbeddedBrowser { data.heightHint = Math.max(statusBarText.computeSize(SWT.DEFAULT, SWT.DEFAULT).y, statusBarProgress.computeSize(SWT.DEFAULT, SWT.DEFAULT).y); statusBarSeparator.setLayoutData(data); } - + public void displayUrl(String url) { browser.setUrl(url); shell.setMinimized(false); @@ -433,7 +433,7 @@ public class EmbeddedBrowser { } /** * Obtains URLs to product image - * + * * @return String[] with URLs as Strings or null */ private static String[] getProductImageURLs() { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java index f8617b1cc..932166217 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserAdapter.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -25,9 +25,9 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{ private UIThread2 secondThread; private String browserType; class UIThread2 extends Thread { - + Display d; - + boolean runEventLoop = true; public UIThread2() { @@ -103,7 +103,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{ } /** * Must be run on UI thread - * + * * @param url */ private void uiDisplayURL(final String url) { @@ -131,7 +131,7 @@ public class EmbeddedBrowserAdapter implements IBrowser, IBrowserCloseListener{ } } /** - * + * */ private EmbeddedBrowser getBrowser() { if (browser == null || browser.isDisposed()) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java index 9bdd1f99e..6ab797109 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/EmbeddedBrowserFactory.java @@ -59,7 +59,7 @@ public class EmbeddedBrowserFactory implements IBrowserFactory { /** * Must run on UI thread - * + * * @return */ private boolean test() { @@ -79,7 +79,7 @@ public class EmbeddedBrowserFactory implements IBrowserFactory { // Browser not implemented available = false; } else { - Status errorStatus = new Status(IStatus.WARNING, HelpUIPlugin.PLUGIN_ID, IStatus.OK, + Status errorStatus = new Status(IStatus.WARNING, HelpUIPlugin.PLUGIN_ID, IStatus.OK, "An error occurred during creation of embedded help browser.", new Exception(se)); //$NON-NLS-1$ HelpPlugin.getDefault().getLog().log(errorStatus); } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/IBrowserCloseListener.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/IBrowserCloseListener.java index 64eb9ee0d..869375857 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/IBrowserCloseListener.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/browser/embedded/IBrowserCloseListener.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java index 755389281..59295699b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/dynamic/FilterResolverExtension.java @@ -29,7 +29,7 @@ public class FilterResolverExtension implements Extension { public boolean isHandled(String name) { return (name.equals(NAME_ACTIVITY) || name.equals(NAME_CATEGORY)); } - + @Override public boolean isFiltered(String name, String value) { if (name.equals(NAME_ACTIVITY)) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java index 847349c90..e037777bc 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/OpenBundleResourceHandler.java @@ -44,15 +44,15 @@ public class OpenBundleResourceHandler extends AbstractHandler { if(pluginPath.startsWith("/")) //$NON-NLS-1$ pluginPath = pluginPath.substring(1); url = new URL(Platform.getInstanceLocation().getURL().toString()+pluginId+"/"+pluginPath); //$NON-NLS-1$ - workspaceFile = new File(url.getFile()); + workspaceFile = new File(url.getFile()); if(!workspaceFile.exists()) - { + { url = BaseHelpSystem.resolve("/" + pluginId + '/' + pluginPath , true); //$NON-NLS-1$ if (url == null) { errorMessage="file not found:" + pluginId+"/"+pluginPath; //$NON-NLS-1$ //$NON-NLS-2$ throw new ExecutionException(errorMessage); - } + } } } catch (Exception ex) { @@ -64,8 +64,8 @@ public class OpenBundleResourceHandler extends AbstractHandler { try { IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench() .getBrowserSupport(); - - IWebBrowser browser = browserSupport.createBrowser(browserId); + + IWebBrowser browser = browserSupport.createBrowser(browserId); browser.openURL(url); } catch (PartInitException ex) { throw new ExecutionException("error opening browser", ex); //$NON-NLS-1$ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java index 1c9ac4b1e..4dca72fe6 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/handlers/ShowIndexHandler.java @@ -26,34 +26,34 @@ import org.eclipse.ui.PlatformUI; */ public class ShowIndexHandler extends AbstractHandler { - + /* * Currently returns true, could be controlled by a preference * in the future */ private boolean isOpenInHelpView() { - boolean searchFromBrowser = + boolean searchFromBrowser = Platform.getPreferencesService().getBoolean(HelpBasePlugin.PLUGIN_ID,IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, false, null); return !searchFromBrowser; } - + @Override public Object execute(ExecutionEvent event) throws ExecutionException { - if (isOpenInHelpView()) { + if (isOpenInHelpView()) { openInHelpView(); } else { openInBrowser(); } return null; } - + private void openInBrowser() { PlatformUI.getWorkbench().getHelpSystem(); BaseHelpSystem.getHelpDisplay().displayHelpResource("tab=index", false); //$NON-NLS-1$ } - + private void openInHelpView() { - DefaultHelpUI.showIndex(); + DefaultHelpUI.showIndex(); } } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java index 322cd7e39..002e04f7a 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpContentPreferencePage.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -40,7 +40,7 @@ import org.eclipse.ui.PlatformUI; */ public class HelpContentPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - + private ICTable table; private ICButtons buttons; @@ -63,27 +63,27 @@ public class HelpContentPreferencePage extends PreferencePage implements { return table; } - + @Override protected Control createContents(Composite parent) { PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IHelpUIConstants.PREF_PAGE_HELP_CONTENT); initializeDialogUnits(parent); - + descLabel = new Label(parent, SWT.NONE); descLabel.setText(Messages.HelpContentPage_title); Dialog.applyDialogFont(descLabel); - + createSearchLocalHelpOnly(parent); createSearchLocalHelpFirst(parent); createSearchLocalHelpLast(parent); - + /* remoteICPage = new InfocenterDisplay(this); remoteICPage.createContents(parent); */ initializeTableEnablement(parent,searchLocalHelpOnly.getSelection()); - + return parent; } @@ -93,8 +93,8 @@ public class HelpContentPreferencePage extends PreferencePage implements List<IC> ics = ICPreferences.getDefaultICs(); table.setICs(ics); - - // Restore Defaults functionality here + + // Restore Defaults functionality here /* HelpContentBlock currentBlock=remoteICPage.getHelpContentBlock(); currentBlock.getRemoteICviewer().getRemoteICList().removeAllRemoteICs(currentBlock.getRemoteICList()); currentBlock.getRemoteICviewer().getRemoteICList().loadDefaultPreferences(); @@ -114,12 +114,12 @@ public class HelpContentPreferencePage extends PreferencePage implements IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID); /* * (non-Javadoc) - * + * * @see org.eclipse.jface.preference.PreferencePage#performOk() */ prefs.putBoolean(IHelpBaseConstants.P_KEY_REMOTE_HELP_ON, !(searchLocalHelpOnly.getSelection())); prefs.putBoolean(IHelpBaseConstants.P_KEY_REMOTE_HELP_PREFERRED, searchLocalHelpLast.getSelection()); - + List<IC> ics = table.getICs(); ICPreferences.setICs(ics); @@ -140,45 +140,45 @@ public class HelpContentPreferencePage extends PreferencePage implements boolean isRemoteOn = Platform.getPreferencesService().getBoolean (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_REMOTE_HELP_ON, false, null); - + searchLocalHelpOnly.setSelection(!isRemoteOn); - Dialog.applyDialogFont(searchLocalHelpOnly); + Dialog.applyDialogFont(searchLocalHelpOnly); } - + private void createSearchLocalHelpFirst(Composite parent) { searchLocalHelpFirst = new Button(parent, SWT.RADIO); searchLocalHelpFirst.setText(Messages.SearchEmbeddedHelpFirst); searchLocalHelpFirst.addListener(SWT.Selection, changeListener); - + boolean isRemoteOn = Platform.getPreferencesService().getBoolean (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_REMOTE_HELP_ON, false, null); boolean isRemotePreferred = Platform.getPreferencesService().getBoolean (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_REMOTE_HELP_PREFERRED, false, null); - + searchLocalHelpFirst.setSelection(isRemoteOn && !isRemotePreferred); Dialog.applyDialogFont(searchLocalHelpFirst); } - + private void createSearchLocalHelpLast(Composite parent) { searchLocalHelpLast = new Button(parent, SWT.RADIO); searchLocalHelpLast.setText(Messages.SearchEmbeddedHelpLast); searchLocalHelpLast.addListener(SWT.Selection, changeListener); - + boolean isRemoteOn = Platform.getPreferencesService().getBoolean (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_REMOTE_HELP_ON, false, null); boolean isRemotePreferred = Platform.getPreferencesService().getBoolean (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_REMOTE_HELP_PREFERRED, false, null); - + searchLocalHelpLast.setSelection(isRemoteOn && isRemotePreferred); Dialog.applyDialogFont(searchLocalHelpLast); } - + /* - * Initialize the table enablement with the current checkbox selection + * Initialize the table enablement with the current checkbox selection */ - + private void initializeTableEnablement(Composite parent, boolean isRemoteHelpDisabled) - { + { Composite top = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); @@ -191,7 +191,7 @@ public class HelpContentPreferencePage extends PreferencePage implements table = new ICTable(top); buttons = new ICButtons(top,this); - + changeListener.handleEvent(null); } @@ -202,10 +202,10 @@ public class HelpContentPreferencePage extends PreferencePage implements private Listener changeListener = event -> { boolean isRemoteHelpEnabled = !(searchLocalHelpOnly.getSelection()); - + // Disable/Enable table table.getTable().setEnabled(isRemoteHelpEnabled); buttons.setEnabled(isRemoteHelpEnabled); }; - + } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java index 4248efc9c..2df11b4bd 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/HelpPreferencePage.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -50,18 +50,18 @@ public class HelpPreferencePage extends PreferencePage implements private static final String WBROWSER_PAGE_ID = "org.eclipse.ui.browser.preferencePage";//$NON-NLS-1$ private Combo useExternalCombo; - + private Combo searchLocationCombo; - + private Combo openModeCombo; - + private Combo dialogHelpCombo; - + private Combo windowHelpCombo; /** * Creates preference page controls on demand. - * + * * @param parent * the parent for the preference page */ @@ -80,8 +80,8 @@ public class HelpPreferencePage extends PreferencePage implements mainComposite.setLayout(layout); Label description = new Label(mainComposite, SWT.NONE); description.setText(Messages.select_browser); - - createOpenModesPrefs(mainComposite); + + createOpenModesPrefs(mainComposite); createDynamicHelpArea(mainComposite); createSpacer(mainComposite); Dialog.applyDialogFont(mainComposite); @@ -96,7 +96,7 @@ public class HelpPreferencePage extends PreferencePage implements createSearchLocation(group); createHelpViewOpenPrefs(group); createOpenContents(group); - createLinkArea(group); + createLinkArea(group); } private void createDynamicHelpArea(Composite parent) { @@ -104,7 +104,7 @@ public class HelpPreferencePage extends PreferencePage implements GridLayout layout = new GridLayout(); group.setLayout(layout); group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); group.setText(Messages.HelpPreferencePage_contextHelpGroup); - + createWindowContextPrefs(group); createDialogContextPrefs(group); } @@ -126,7 +126,7 @@ public class HelpPreferencePage extends PreferencePage implements if (BrowserManager.getInstance().isEmbeddedBrowserPresent()) { Label isExternalLabel = new Label(mainComposite, SWT.NONE); isExternalLabel.setText(Messages.HelpPreferencePage_openContents); - isExternalLabel.setLayoutData(createLabelData()); + isExternalLabel.setLayoutData(createLabelData()); useExternalCombo = new Combo(mainComposite, SWT.READ_ONLY); useExternalCombo.add(Messages.HelpPreferencePage_helpBrowser); useExternalCombo.add(Messages.HelpPreferencePage_externalBrowser); @@ -165,7 +165,7 @@ public class HelpPreferencePage extends PreferencePage implements String openMode = Platform.getPreferencesService().getString (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_HELP_VIEW_OPEN_MODE, IHelpBaseConstants.P_IN_PLACE, null); - openModeCombo.setText(openModeToString(openMode)); + openModeCombo.setText(openModeToString(openMode)); } } @@ -186,7 +186,7 @@ public class HelpPreferencePage extends PreferencePage implements Label whelpDescription = new Label(group, SWT.NONE); whelpDescription.setText(Messages.HelpPreferencePage_wlabel); whelpDescription.setLayoutData(createLabelData()); - + windowHelpCombo = new Combo(group, SWT.READ_ONLY); windowHelpCombo.add(Messages.HelpPreferencePage_view); windowHelpCombo.add(Messages.HelpPreferencePage_infopop); @@ -195,13 +195,13 @@ public class HelpPreferencePage extends PreferencePage implements (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_WINDOW_INFOPOP, false, null); windowHelpCombo.setText(winfopop ? Messages.HelpPreferencePage_infopop : Messages.HelpPreferencePage_view); } - + private GridData createLabelData () { GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false); data.verticalIndent = 5; return data; } - + private IPreferenceNode getPreferenceNode(String pageId) { Iterator<IPreferenceNode> iterator = PlatformUI.getWorkbench().getPreferenceManager() .getElements(PreferenceManager.PRE_ORDER).iterator(); @@ -235,18 +235,18 @@ public class HelpPreferencePage extends PreferencePage implements if (useExternalCombo != null) { boolean useExternal = defaults.getBoolean( IHelpBaseConstants.P_KEY_ALWAYS_EXTERNAL_BROWSER, false); - useExternalCombo.setText(useExternal ? Messages.HelpPreferencePage_externalBrowser : Messages.HelpPreferencePage_helpBrowser); - } - + useExternalCombo.setText(useExternal ? Messages.HelpPreferencePage_externalBrowser : Messages.HelpPreferencePage_helpBrowser); + } + boolean searchFromBrowser = defaults.getBoolean(IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, false); searchLocationCombo.setText(searchFromBrowser ? Messages.HelpPreferencePage_openInBrowser : Messages.HelpPreferencePage_view); - + boolean winfopop = defaults.getBoolean(IHelpBaseConstants.P_KEY_WINDOW_INFOPOP, false); windowHelpCombo.setText(winfopop ? Messages.HelpPreferencePage_infopop : Messages.HelpPreferencePage_view); boolean dinfopop = defaults.getBoolean(IHelpBaseConstants.P_KEY_DIALOG_INFOPOP, false); dialogHelpCombo.setText(dinfopop ? Messages.HelpPreferencePage_infopop : Messages.HelpPreferencePage_tray); - + if (openModeCombo !=null) { String openMode = defaults.get( IHelpBaseConstants.P_KEY_HELP_VIEW_OPEN_MODE, IHelpBaseConstants.P_IN_PLACE); @@ -263,15 +263,15 @@ public class HelpPreferencePage extends PreferencePage implements public boolean performOk() { IEclipsePreferences pref = InstanceScope.INSTANCE.getNode(HelpBasePlugin.PLUGIN_ID); if (useExternalCombo != null) { - boolean isExternalBrowser = useExternalCombo.getText().equals(Messages.HelpPreferencePage_externalBrowser); + boolean isExternalBrowser = useExternalCombo.getText().equals(Messages.HelpPreferencePage_externalBrowser); pref.putBoolean(IHelpBaseConstants.P_KEY_ALWAYS_EXTERNAL_BROWSER, isExternalBrowser); BrowserManager.getInstance().setAlwaysUseExternal( isExternalBrowser); } - pref.putBoolean(IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, + pref.putBoolean(IHelpBaseConstants.P_KEY_SEARCH_FROM_BROWSER, searchLocationCombo.getText().equals(Messages.HelpPreferencePage_openInBrowser)); - + pref.putBoolean(IHelpBaseConstants.P_KEY_WINDOW_INFOPOP, windowHelpCombo.getText().equals(Messages.HelpPreferencePage_infopop)); @@ -280,7 +280,7 @@ public class HelpPreferencePage extends PreferencePage implements if (openModeCombo!=null) { pref.put(IHelpBaseConstants.P_KEY_HELP_VIEW_OPEN_MODE, openModeFromString(openModeCombo.getText())); } - + try { pref.flush(); } catch (BackingStoreException e) { @@ -299,7 +299,7 @@ public class HelpPreferencePage extends PreferencePage implements return Messages.HelpPreferencePage_openInPlace; } } - + private String openModeFromString(String openMode) { if (Messages.HelpPreferencePage_openInBrowser.equals(openMode)) { return IHelpBaseConstants.P_IN_BROWSER; @@ -312,7 +312,7 @@ public class HelpPreferencePage extends PreferencePage implements /** * Creates a horizontal spacer line that fills the width of its container. - * + * * @param parent * the parent control */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java index 80acb1fc2..ab3612e42 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/IC.java @@ -4,7 +4,7 @@ * 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
*******************************************************************************/
@@ -18,7 +18,7 @@ import java.net.UnknownHostException; /**
* Information Center (IC) - stores URL info.
- *
+ *
* @author chaustin
*
*/
@@ -31,7 +31,7 @@ public class IC { private String path;
private int port = -1;
-
+
public IC(String name,String href,boolean enabled) throws MalformedURLException
{
this.name = name;
@@ -43,10 +43,10 @@ public class IC { {
if (href.startsWith(":")) //$NON-NLS-1$
href = "http"+href; //$NON-NLS-1$
-
+
setHref(new URL(href));
}
-
+
public void setHref(URL url)
{
this.protocol = url.getProtocol();
@@ -61,7 +61,7 @@ public class IC { port = 443;
}
}
-
+
public String getHref()
{
String portString = ":"+port; //$NON-NLS-1$
@@ -69,17 +69,17 @@ public class IC { portString = ""; //$NON-NLS-1$
else if (port==443 && protocol.equals("https")) //$NON-NLS-1$
portString = ""; //$NON-NLS-1$
-
+
return protocol+"://"+host+portString+path; //$NON-NLS-1$
}
-
-
+
+
public String getName()
{
return name;
}
-
-
+
+
public boolean isEnabled()
{
return enabled;
@@ -133,16 +133,16 @@ public class IC { /**
* Tests to see if 2 ICs are equal. The state (enabled or disabled) is ignored
* during this operation.
- *
+ *
*/
@Override
public boolean equals(Object o)
{
if (!(o instanceof IC))
return false;
-
+
IC candidate = (IC)o;
-
+
if (getName().equals(candidate.getName())
&& getPath().equals(candidate.getPath())
&& getPort()==candidate.getPort()
@@ -151,7 +151,7 @@ public class IC { try {
InetAddress host1 = InetAddress.getByName(getHost());
InetAddress host2 = InetAddress.getByName(candidate.getHost());
-
+
if (host1.getHostAddress().equals(host2.getHostAddress()))
return true;
} catch (UnknownHostException e) {
@@ -159,7 +159,7 @@ public class IC { return true;
}
}
-
+
return false;
}
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java index 93389a1f3..23b8857f3 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICButtons.java @@ -4,7 +4,7 @@ * 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
*******************************************************************************/
@@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Table; public class ICButtons implements SelectionListener{
private HelpContentPreferencePage page;
-
+
private Button addIC;
private Button editIC;
private Button removeIC;
@@ -45,7 +45,7 @@ public class ICButtons implements SelectionListener{ public ICButtons(Composite parent,HelpContentPreferencePage page)
{
this.page = page;
-
+
Composite container = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
@@ -58,7 +58,7 @@ public class ICButtons implements SelectionListener{ editIC = createPushButton(container, Messages.HelpContentBlock_editICTitle);
removeIC = createPushButton(container, Messages.HelpContentBlock_removeICTitle);
testIC = createPushButton(container, Messages.HelpContentBlock_testConnectionTitle);
-
+
String enableTitle = Messages.HelpContentBlock_3.length() > Messages.HelpContentBlock_4.length() ?
Messages.HelpContentBlock_3 : Messages.HelpContentBlock_4;
enableIC = createPushButton(container, enableTitle);
@@ -66,17 +66,17 @@ public class ICButtons implements SelectionListener{ moveDown = createPushButton(container, Messages.HelpContentBlock_downTitle);
page.getTable().getTable().addSelectionListener(this);
-
-
+
+
updateButtonStates();
}
-
+
public void setEnabled(boolean enabled)
{
this.enabled = enabled;
updateButtonStates();
}
-
+
public Button createPushButton(Composite parent, String buttonText) {
Button button = new Button(parent, SWT.PUSH);
button.setFont(parent.getFont());
@@ -123,30 +123,30 @@ public class ICButtons implements SelectionListener{ updateButtonStates();
}
}
-
+
public void editIC()
{
IStructuredSelection selection = (IStructuredSelection)page.getTable().getSelection();
IC ic = (IC)selection.getFirstElement();
if (ic==null)
return;
-
+
ICDialog dialog = new ICDialog(page.getShell(),ic);
-
+
if (dialog.open() == Window.OK) {
page.getTable().editIC(dialog.getIC());
updateButtonStates();
}
}
-
+
public void removeIC()
{
IStructuredSelection selection = (IStructuredSelection)page.getTable().getSelection();
List<IC> ics = selection.toList();
String remove = ""; //$NON-NLS-1$
-
+
for (int i=0;i<ics.size();i++)
- {
+ {
remove+="\n"+ics.get(i); //$NON-NLS-1$
}
@@ -154,7 +154,7 @@ public class ICButtons implements SelectionListener{ MessageDialog.openQuestion(
page.getShell(),
NLS.bind(Messages.HelpContentBlock_rmvTitle ,""), //$NON-NLS-1$
- NLS.bind(Messages.HelpContentBlock_rmvLabel ,remove));
+ NLS.bind(Messages.HelpContentBlock_rmvLabel ,remove));
if (shouldRemove)
{
@@ -163,22 +163,22 @@ public class ICButtons implements SelectionListener{ updateButtonStates();
}
}
-
+
public void testIC()
- {
+ {
IStructuredSelection selection = (IStructuredSelection)page.getTable().getSelection();
IC ic = (IC)selection.getFirstElement();
if (ic==null)
return;
-
+
ICDialog dialog = new ICDialog(page.getShell(),ic,true);
-
+
if (dialog.open() == Window.OK) {
page.getTable().editIC(dialog.getIC());
updateButtonStates();
- }
-
-
+ }
+
+
/* boolean connected = TestConnectionUtility.testConnection(ic.getHost(),
ic.getPort()+"", ic.getPath(),ic.getProtocol());
TestICDialog dialog = new TestICDialog(page.getShell(),ic);
@@ -186,50 +186,50 @@ public class ICButtons implements SelectionListener{ dialog.open();
*/
}
-
+
public void enableIC()
{
int indexes[] = page.getTable().getTable().getSelectionIndices();
IStructuredSelection selection = (IStructuredSelection)page.getTable().getSelection();
List<IC> ics = selection.toList();
-
+
boolean enable = enableIC.getText().equals(Messages.HelpContentBlock_4);
-
+
for (int i=0;i<ics.size();i++)
{
ics.get(i).setEnabled(enable);
page.getTable().getTableViewer().replace(ics.get(i), indexes[i]);
}
page.getTable().refresh();
-
+
updateButtonStates();
}
-
+
public void move(int offset)
{
int index = page.getTable().getTable().getSelectionIndices()[0];
-
+
List<IC> ics = page.getTable().getICs();
IC x = ics.get(index);
IC y = ics.get(index + offset);
ics.set(index+offset,x);
ics.set(index,y);
-
+
page.getTable().getTableViewer().getContentProvider().inputChanged(
page.getTable().getTableViewer(), null, ics);
-
+
page.getTable().getTableViewer().replace(x,index+offset);
page.getTable().getTableViewer().replace(y,index);
page.getTable().refresh();
-
+
page.getTable().getTable().deselectAll();
page.getTable().getTable().select(index+offset);
updateButtonStates();
-
+
}
-
+
public void updateButtonStates()
{
if (!enabled)
@@ -243,9 +243,9 @@ public class ICButtons implements SelectionListener{ removeIC.setEnabled(false);
return;
}
-
+
addIC.setEnabled(true);
-
+
IC firstIC = (IC)(((IStructuredSelection)page.getTable().getSelection()).getFirstElement());
if (firstIC!=null)
{
@@ -260,7 +260,7 @@ public class ICButtons implements SelectionListener{ moveDown.setEnabled(index!=page.getTable().getICs().size()-1);
}
else
- {
+ {
editIC.setEnabled(false);
testIC.setEnabled(false);
moveUp.setEnabled(false);
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java index a873e6f1a..fe526d698 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICDialog.java @@ -43,7 +43,7 @@ import org.eclipse.ui.PlatformUI; public class ICDialog extends StatusDialog implements Listener, SelectionListener {
private IC ic = null;
-
+
private Text nameText;
private Text hrefText;
@@ -80,25 +80,25 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene topGroup.setLayout(layout);
topGroup.setFont(top.getFont());
topGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
-
+
Label label = new Label(topGroup, SWT.NONE);
label.setText(Messages.AddICDialog_4);
-
+
nameText = new Text(topGroup, SWT.BORDER);
nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
if (nameText.getOrientation() == SWT.RIGHT_TO_LEFT)
nameText.setOrientation(SWT.LEFT_TO_RIGHT);
nameText.addListener(SWT.Modify, this);
-
+
label = new Label(topGroup, SWT.NONE);
label.setText(Messages.InfoCenterPage_url);
-
+
hrefText = new Text(topGroup, SWT.BORDER);
hrefText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
if (hrefText.getOrientation() == SWT.RIGHT_TO_LEFT)
hrefText.setOrientation(SWT.LEFT_TO_RIGHT);
hrefText.addListener(SWT.Modify, this);
-
+
if (ic!=null)
{
@@ -108,9 +108,9 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene }
else
this.getShell().setText(Messages.AddICDialog_2);
-
- Dialog.applyDialogFont(top);
+
+ Dialog.applyDialogFont(top);
return top;
}
@@ -119,22 +119,22 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene protected void createButtonsForButtonBar(Composite parent) {
testButton = this.createButton(
- parent,
- IDialogConstants.CLIENT_ID,
- Messages.HelpContentBlock_testConnectionTitle,
+ parent,
+ IDialogConstants.CLIENT_ID,
+ Messages.HelpContentBlock_testConnectionTitle,
true);
testButton.addSelectionListener(this);
super.createButtonsForButtonBar(parent);
-
+
//Initialize validity
updateValidity();
-
+
if (testConnect)
testConnection();
}
-
-
+
+
@Override
public void initializeBounds() {
Point size = getInitialSize();
@@ -142,28 +142,28 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene this.getShell().setBounds(location.x, location.y,
size.x + 180, size.y);
}
-
+
@Override
public void okPressed() {
try {
String href = formalizeHref(hrefText.getText());
-
+
ic = new IC(nameText.getText(),href,true);
} catch (MalformedURLException e) {} // This should never happen since we test in updateValidity
this.setReturnCode(OK);
this.close();
}
-
+
public String formalizeHref(String href)
{
if (href.endsWith("/index.jsp")) //$NON-NLS-1$
href = href.substring(0,href.lastIndexOf("/index.jsp")); //$NON-NLS-1$
else if (href.endsWith("/site/site.xml")) //$NON-NLS-1$
href = href.substring(0,href.lastIndexOf("/site/site.xml")); //$NON-NLS-1$
-
+
return href;
}
-
+
/*
* Checks for errors in the user input and shows/clears the error message
* as appropriate.
@@ -182,18 +182,18 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene if (!href.matches(".*\\://.+/.+")) //$NON-NLS-1$
status = new Status(IStatus.ERROR,"org.eclipse.help.ui",Messages.InfoCenterPage_invalidURL); //$NON-NLS-1$
-
+
} catch (MalformedURLException e) {
status = new Status(IStatus.ERROR,"org.eclipse.help.ui",Messages.InfoCenterPage_invalidURL); //$NON-NLS-1$
}
}
-
+
// if (testButton!=null)
// testButton.setEnabled(status.isOK());
-
+
this.updateStatus(status);
}
-
+
private boolean areFieldsValid()
{
if (nameText!=null && nameText.getText().equals("")) //$NON-NLS-1$
@@ -206,14 +206,14 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene if (!href.matches(".*\\://.+/.+")) //$NON-NLS-1$
return false;
-
+
} catch (MalformedURLException e) {
return false;
}
- }
+ }
return true;
}
-
+
private void testConnection()
{
IC testIC;
@@ -222,13 +222,13 @@ public class ICDialog extends StatusDialog implements Listener, SelectionListene testIC = new IC(nameText.getText(),formalizeHref(hrefText.getText()),true);
boolean connected = TestConnectionUtility.testConnection(testIC.getHost(),
testIC.getPort()+"", testIC.getPath(),testIC.getProtocol()); //$NON-NLS-1$
-
+
if(connected)
status = new Status(IStatus.INFO,"org.eclipse.help.ui",Messages.TestConnectionDialog_12); //$NON-NLS-1$
else
status = new Status(IStatus.WARNING,"org.eclipse.help.ui",Messages.TestConnectionDialog_13); //$NON-NLS-1$
-
+
} catch (MalformedURLException e) {
status = new Status(IStatus.WARNING,"org.eclipse.help.ui",Messages.TestConnectionDialog_13); //$NON-NLS-1$
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java index cb427b97d..68878e6af 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICPreferences.java @@ -4,7 +4,7 @@ * 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
*******************************************************************************/
@@ -27,11 +27,11 @@ public class ICPreferences { public final static String DELIMITER = ","; //$NON-NLS-1$
-
+
public static void setICs(List<IC> ics)
{
- String name = "", host = "", path = "", protocol="", port = "", enabled = ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
-
+ String name = "", host = "", path = "", protocol="", port = "", enabled = ""; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
+
for (int i=0;i<ics.size();i++)
{
name += ics.get(i).getName() + DELIMITER;
@@ -41,7 +41,7 @@ public class ICPreferences { path += ics.get(i).getPath() + DELIMITER;
enabled += ics.get(i).isEnabled() + DELIMITER;
}
-
+
// Remove trailing commas
if(ics.size()!=0)
{
@@ -52,7 +52,7 @@ public class ICPreferences { path = path.substring(0,path.length()-1);
enabled = enabled.substring(0,enabled.length()-1);
}
-
+
set("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_NAME, name); //$NON-NLS-1$
set("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_HOST, host); //$NON-NLS-1$
set("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_PATH, path); //$NON-NLS-1$
@@ -62,7 +62,7 @@ public class ICPreferences { HelpPlugin.getTocManager().clearCache();
}
-
+
public static List<IC> getICs()
{
return prefsToICs(
@@ -73,15 +73,15 @@ public class ICPreferences { ICPreferences.get("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_PATH).split(DELIMITER), //$NON-NLS-1$
ICPreferences.get("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_ICEnabled).split(DELIMITER)); //$NON-NLS-1$
}
-
+
public static List<IC> prefsToICs(String names[],String protocols[],String hosts[],String ports[],String paths[],String states[])
{
List<IC> ics = new ArrayList<>();
-
+
for (int i=0;i<names.length;i++)
{
if (!names[i].equals("")) //$NON-NLS-1$
- {
+ {
try {
IC ic = new IC(
names[i],
@@ -99,11 +99,11 @@ public class ICPreferences { }
return ics;
}
-
-
+
+
public static List<IC> getDefaultICs()
- {
+ {
return prefsToICs(
getDefault("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_NAME).split(DELIMITER), //$NON-NLS-1$
getDefault("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_PROTOCOL).split(DELIMITER), //$NON-NLS-1$
@@ -112,11 +112,11 @@ public class ICPreferences { getDefault("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_PATH).split(DELIMITER), //$NON-NLS-1$
getDefault("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_ICEnabled).split(DELIMITER)); //$NON-NLS-1$
}
-
+
/**
* Returns a default preference for the given name
- *
+ *
* @param plugin - Name of the plugin containing this preference
* @param name - Name of the preference to retrieve
* @return value, or empty string if no preference found
@@ -125,22 +125,22 @@ public class ICPreferences { {
return getDefaultNode(plugin).get(name, ""); //$NON-NLS-1$
}
-
+
public static void setRemoteHelp(boolean enabled)
{
set("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_ON,enabled+""); //$NON-NLS-1$ //$NON-NLS-2$
HelpPlugin.getTocManager().clearCache();
}
-
+
public static void setRemoteHelpPreferred(boolean remotePreferred)
{
set("org.eclipse.help.base",IHelpBaseConstants.P_KEY_REMOTE_HELP_PREFERRED,remotePreferred+""); //$NON-NLS-1$ //$NON-NLS-2$
HelpPlugin.getTocManager().clearCache();
}
-
+
/**
* Sets a preference
- *
+ *
* @param plugin - Name of the plugin containing this preference
* @param name - Name of the preference
* @param value - Value to set
@@ -148,11 +148,11 @@ public class ICPreferences { public static void set(String plugin,String name,String value)
{
set(getNode(plugin),name,value);
- }
-
+ }
+
/**
* Set a preference in the given node.
- *
+ *
* @param node
* @param name
* @param value
@@ -163,11 +163,11 @@ public class ICPreferences { try {
node.flush();
} catch (BackingStoreException e) {} //Nothing we can do, move on
- }
-
+ }
+
/**
* Returns the preference found for the given name
- *
+ *
* @param plugin - Name of the plugin containing this preference
* @param name - Name of the preference to retrieve
* @return value, or empty string if no preference found
@@ -176,10 +176,10 @@ public class ICPreferences { {
return getNode(plugin).get(name, ""); //$NON-NLS-1$
}
-
+
/**
* Get the IEclipsePreferences node for the given plugin
- *
+ *
* @param plugin
* @return
*/
@@ -188,17 +188,17 @@ public class ICPreferences { IEclipsePreferences p = InstanceScope.INSTANCE.getNode(plugin);
return p;
}
-
+
/**
* Get the default IEclipsePreferences node for the given plugin
- *
+ *
* @param plugin
* @return
*/
public static IEclipsePreferences getDefaultNode(String plugin)
- {
+ {
IEclipsePreferences p = DefaultScope.INSTANCE.getNode(plugin);
return p;
- }
+ }
}
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java index f43b43796..866c22c3f 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/ICTable.java @@ -4,7 +4,7 @@ * 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
*******************************************************************************/
@@ -39,22 +39,22 @@ public class ICTable { private Table table;
private TableViewer viewer;
- private final String NAME_COLUMN = Messages.RemoteICViewer_Name;
- private final String LOCATION_COLUMN = Messages.RemoteICViewer_URL;
+ private final String NAME_COLUMN = Messages.RemoteICViewer_Name;
+ private final String LOCATION_COLUMN = Messages.RemoteICViewer_URL;
private final String STATUS_COLUMN = Messages.RemoteICViewer_Enabled;
// Set column names
private String[] columnNames = new String[] {NAME_COLUMN,
LOCATION_COLUMN, STATUS_COLUMN};
-
-
+
+
public ICTable(Composite parent) {
// Create the table
table = createTable(parent);
// Create and setup the TableViewer
viewer = createTableViewer();
-
+
loadPreferences();
}
@@ -88,32 +88,32 @@ public class ICTable { gridData.heightHint = table.getItemHeight();
gridData.horizontalSpan = 1;
table.setLayoutData(gridData);
-
-
+
+
ColumnLayoutData[] fTableColumnLayouts= {
new ColumnWeightData(85),
new ColumnWeightData(165),
new ColumnWeightData(60)
- };
-
+ };
+
TableColumn column;
-
+
tableLayout.addColumnData(fTableColumnLayouts[0]);
column = new TableColumn(table, SWT.NONE, 0);
column.setResizable(fTableColumnLayouts[0].resizable);
column.setText(NAME_COLUMN);
-
+
tableLayout.addColumnData(fTableColumnLayouts[1]);
column = new TableColumn(table, SWT.NONE, 1);
column.setResizable(fTableColumnLayouts[1].resizable);
- column.setText(LOCATION_COLUMN);
-
+ column.setText(LOCATION_COLUMN);
+
tableLayout.addColumnData(fTableColumnLayouts[2]);
column = new TableColumn(table, SWT.NONE, 2);
column.setResizable(fTableColumnLayouts[2].resizable);
- column.setText(STATUS_COLUMN);
-
+ column.setText(STATUS_COLUMN);
+
return table;
}
@@ -132,13 +132,13 @@ public class ICTable { /**
* Proxy for the the RemoteICList which provides content
- * for the Table. This class implements IRemoteHelpListViewer interface an
+ * for the Table. This class implements IRemoteHelpListViewer interface an
* registers itself with RemoteICList
*/
class ICContentProvider implements IStructuredContentProvider
{
private List<IC> content = new ArrayList<>();
-
+
@Override
public void dispose() {
content = null;
@@ -154,9 +154,9 @@ public class ICTable { public IC[] getElements(Object inputElement) {
return content.toArray(new IC[content.size()]);
}
-
+
}
-
+
public class ICLabelProvider extends LabelProvider implements ITableLabelProvider {
@Override
@@ -179,10 +179,10 @@ public class ICTable { }
}
-
-
-
-
+
+
+
+
/**
* @param rics the ordered remote InfoCenters
*/
@@ -190,17 +190,17 @@ public class ICTable { viewer.getContentProvider().inputChanged(viewer, null, ics);
refresh();
}
-
+
/**
- * Make sure the table viewer shows the latest copy of the ordered InfoCenters
+ * Make sure the table viewer shows the latest copy of the ordered InfoCenters
*/
public void refresh() {
viewer.refresh(getICs());
}
-
+
/**
* Return the column names in a collection
- *
+ *
* @return List containing column names
*/
public List<String> getColumnNames() {
@@ -213,7 +213,7 @@ public class ICTable { public ISelection getSelection() {
return viewer.getSelection();
}
-
+
/**
* Return the RemoteICList
*/
@@ -231,11 +231,11 @@ public class ICTable { List<IC> oldICs = getICs();
for (int o=0;o<oldICs.size();o++)
removeIC(oldICs.get(o));
-
+
for (int i=0;i<ics.size();i++)
addIC(ics.get(i));
}
-
+
public TableViewer getTableViewer()
{
return viewer;
@@ -250,7 +250,7 @@ public class ICTable { public Table getTable() {
return table;
}
-
+
public void addIC(IC ic)
{
List<IC> content = getICs();
@@ -260,9 +260,9 @@ public class ICTable { getTableViewer().add(ic);
refresh();
}
-
+
public void editIC(IC ic)
- {
+ {
List<IC> content = getICs();
content.set(getTable().getSelectionIndex(), ic);
getTableViewer().replace(ic,getTable().getSelectionIndex());
@@ -270,7 +270,7 @@ public class ICTable { getTableViewer(), null, content);
refresh();
}
-
+
public void removeIC(IC ic)
{
List<IC> content = getICs();
@@ -279,7 +279,7 @@ public class ICTable { getTableViewer().remove(ic);
refresh();
}
-
+
private void loadPreferences()
{
List<IC> ics = ICPreferences.getICs();
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java index 2be3ca33f..ec50107a5 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/preferences/TabFolderLayout.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -24,7 +24,7 @@ public class TabFolderLayout extends Layout { protected Point computeSize (Composite composite, int wHint, int hHint, boolean flushCache) { if (wHint != SWT.DEFAULT && hHint != SWT.DEFAULT) return new Point(wHint, hHint); - + Control [] children = composite.getChildren (); int count = children.length; int maxWidth = 0, maxHeight = 0; @@ -34,20 +34,20 @@ public class TabFolderLayout extends Layout { maxWidth = Math.max (maxWidth, pt.x); maxHeight = Math.max (maxHeight, pt.y); } - + if (wHint != SWT.DEFAULT) maxWidth= wHint; if (hHint != SWT.DEFAULT) maxHeight= hHint; - - return new Point(maxWidth, maxHeight); - + + return new Point(maxWidth, maxHeight); + } - + @Override protected void layout (Composite composite, boolean flushCache) { Rectangle rect= composite.getClientArea(); - + Control[] children = composite.getChildren(); for (int i = 0; i < children.length; i++) { children[i].setBounds(rect); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java index a51572ed0..d0d9c5672 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaContentProvider.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -18,7 +18,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; public class HelpCriteriaContentProvider implements ITreeContentProvider { - + public static final String UNCATEGORIZED = "Uncategorized"; //$NON-NLS-1$ public static class CriterionName{ @@ -26,14 +26,14 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { this.id = id; this.parent = parent; } - + private String id; private Object parent; - + public String getId() { return id; } - + public String getName() { return HelpPlugin.getCriteriaManager().getCriterionDisplayName(id, Platform.getNL()); } @@ -41,7 +41,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { public Object getParent() { return parent; } - + @Override public boolean equals(Object arg0) { if (arg0 instanceof CriterionName) { @@ -50,26 +50,26 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { } return false; } - + @Override public int hashCode() { return id.hashCode(); } } - + public static class CriterionValue{ public CriterionValue(String id, Object parent) { this.id = id; this.parent = parent; } - + private String id; private Object parent; - + public String getId() { return id; } - + public String getName() { if (id.equals(UNCATEGORIZED)) { return Messages.UncategorizedCriteria; @@ -81,7 +81,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { public Object getParent() { return parent; } - + @Override public boolean equals(Object arg0) { if (arg0 instanceof CriterionValue) { @@ -90,7 +90,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { } return false; } - + @Override public int hashCode() { return id.hashCode() + parent.hashCode(); @@ -118,7 +118,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { return criterionNames; } else if (parentElement instanceof CriterionName) { CriterionName parentCriterion = (CriterionName) parentElement; - + String[] values = BaseHelpSystem.getWorkingSetManager().getCriterionValueIds(parentCriterion.getId()); CriterionValue[] criterionValues = new CriterionValue[values.length]; for (int i = 0; i < values.length; i++) { @@ -139,7 +139,7 @@ public class HelpCriteriaContentProvider implements ITreeContentProvider { return ((CriterionName) element).getParent(); } else if (element instanceof CriterionValue) { return ((CriterionValue) element).getParent(); - } else + } else return null; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java index 82c3e54c4..19e204cbc 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpCriteriaLabelProvider.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -43,7 +43,7 @@ public class HelpCriteriaLabelProvider extends LabelProvider { } else if (element instanceof HelpCriteriaContentProvider.CriterionValue) { CriterionValue criterionValue = (HelpCriteriaContentProvider.CriterionValue)element; return criterionValue.getName(); - } + } return null; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java index 91a746e31..98f49a188 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetElementLabelProvider.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java index 4cc3f60a9..3ded9a445 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/HelpWorkingSetTreeContentProvider.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java index 125d214d2..cef402645 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterPage.java @@ -59,7 +59,7 @@ public class InfoCenterPage extends RootScopePage { //private boolean firstCheck; private RemoteWorkingSet workingSet; - + private boolean tocStale; class RemoteWorkingSet extends WorkingSet { @@ -121,14 +121,14 @@ public class InfoCenterPage extends RootScopePage { initializeDialogUnits(parent); Label label = new Label(parent, SWT.NULL); - label.setText(Messages.InfoCenterPage_url); + label.setText(Messages.InfoCenterPage_url); urlText = new Text(parent, SWT.BORDER); urlText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); urlText.setEditable(getEngineDescriptor().isUserDefined()); searchAll = new Button(parent, SWT.RADIO); - searchAll.setText(Messages.selectAll); + searchAll.setText(Messages.selectAll); GridData gd = new GridData(); gd.horizontalSpan = 2; searchAll.setLayoutData(gd); @@ -142,7 +142,7 @@ public class InfoCenterPage extends RootScopePage { }); searchSelected = new Button(parent, SWT.RADIO); - searchSelected.setText(Messages.selectWorkingSet); + searchSelected.setText(Messages.selectWorkingSet); gd = new GridData(); gd.horizontalSpan = 2; searchSelected.setLayoutData(gd); @@ -160,7 +160,7 @@ public class InfoCenterPage extends RootScopePage { label = new Label(parent, SWT.WRAP); label.setFont(font); - label.setText(Messages.WorkingSetContent); + label.setText(Messages.WorkingSetContent); gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); @@ -201,7 +201,7 @@ public class InfoCenterPage extends RootScopePage { () -> setSubtreeChecked(element, tree.getChecked(element), false)); } }); - + applyDialogFont(parent); // Set help for the page @@ -240,7 +240,7 @@ public class InfoCenterPage extends RootScopePage { } } } - + private void resetRemoteTocs() { remoteTocs = new AdaptableTocsArray(new IToc[0]); } @@ -338,7 +338,7 @@ public class InfoCenterPage extends RootScopePage { } }); } - + private void updateTocs() { //String url = urlText.getText(); //busyLoadTocs(url); @@ -355,14 +355,14 @@ public class InfoCenterPage extends RootScopePage { } }); } - + /* private void busyLoadTocs(final String url) { BusyIndicator.showWhile(urlText.getDisplay(), new Runnable() { public void run() { loadTocs(url); } - }); + }); } */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java index c0a515158..04317b090 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/InfoCenterSearchScopeFactory.java @@ -27,7 +27,7 @@ public class InfoCenterSearchScopeFactory implements ISearchScopeFactory { public static final String P_SEARCH_SELECTED = "searchSelected"; //$NON-NLS-1$ public static final String P_TOCS = "tocs"; //$NON-NLS-1$ public static final String TOC_SEPARATOR = ";"; //$NON-NLS-1$ - + @Override public ISearchScope createSearchScope(IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { @@ -50,7 +50,7 @@ public class InfoCenterSearchScopeFactory implements ISearchScopeFactory { } return new InfoCenter.Scope(url, searchSelected, tocs); } - + private String getProperty(String key, IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { // try the store first diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java index 0fd09e335..5505cea81 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalHelpPage.java @@ -54,7 +54,7 @@ public class LocalHelpPage extends RootScopePage { private ITreeContentProvider contentTreeContentProvider; private ILabelProvider contentTreeLabelProvider; - + private CheckboxTreeViewer criteriaTree; private ITreeContentProvider criteriaTreeContentProvider; @@ -86,7 +86,7 @@ public class LocalHelpPage extends RootScopePage { initializeDialogUnits(parent); searchAll = new Button(parent, SWT.RADIO); - searchAll.setText(Messages.selectAll); + searchAll.setText(Messages.selectAll); GridData gd = new GridData(); gd.horizontalSpan = 2; searchAll.setLayoutData(gd); @@ -102,7 +102,7 @@ public class LocalHelpPage extends RootScopePage { }); searchSelected = new Button(parent, SWT.RADIO); - searchSelected.setText(Messages.selectWorkingSet); + searchSelected.setText(Messages.selectWorkingSet); gd = new GridData(); gd.horizontalSpan = 2; searchSelected.setLayoutData(gd); @@ -125,7 +125,7 @@ public class LocalHelpPage extends RootScopePage { Label contentLabel = new Label(parent, SWT.WRAP); contentLabel.setFont(font); - contentLabel.setText(Messages.WorkingSetContent); + contentLabel.setText(Messages.WorkingSetContent); gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); @@ -133,11 +133,11 @@ public class LocalHelpPage extends RootScopePage { contentLabel.setLayoutData(gd); createContentTree(parent, font); - + if (HelpPlugin.getCriteriaManager().isCriteriaEnabled()) { Label criteriaLabel = new Label(parent, SWT.WRAP); criteriaLabel.setFont(font); - criteriaLabel.setText(Messages.WorkingSetCriteria); + criteriaLabel.setText(Messages.WorkingSetCriteria); gd = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); @@ -145,7 +145,7 @@ public class LocalHelpPage extends RootScopePage { criteriaLabel.setLayoutData(gd); createCriteriaTree(parent, font); } - + initializeCheckedState(); applyDialogFont(parent); @@ -201,7 +201,7 @@ public class LocalHelpPage extends RootScopePage { } return convertHeightInCharsToPixels(15); } - + protected void createCriteriaTree(Composite parent, Font font) { GridData gd; @@ -261,7 +261,7 @@ public class LocalHelpPage extends RootScopePage { return contentProvider.hasChildren(element); } - void updateParentState(Object child, boolean baseChildState, + void updateParentState(Object child, boolean baseChildState, CheckboxTreeViewer tree, ITreeContentProvider contentProvider) { if (child == null) return; @@ -289,7 +289,7 @@ public class LocalHelpPage extends RootScopePage { } void setSubtreeChecked(Object parent, boolean state, - boolean checkExpandedState, + boolean checkExpandedState, CheckboxTreeViewer tree, ITreeContentProvider contentProvider) { Object[] children = contentProvider.getChildren(parent); @@ -306,7 +306,7 @@ public class LocalHelpPage extends RootScopePage { } @SuppressWarnings({ "unchecked", "rawtypes" }) - private void findCheckedElements(java.util.List checkedResources, Object parent, + private void findCheckedElements(java.util.List checkedResources, Object parent, CheckboxTreeViewer tree, ITreeContentProvider contentProvider) { Object[] children = contentProvider.getChildren(parent); for (int i = 0; i < children.length; i++) { @@ -316,8 +316,8 @@ public class LocalHelpPage extends RootScopePage { checkedResources.add(children[i]); } } - - private CriterionResource[] findCheckedCriteria(Object parent, + + private CriterionResource[] findCheckedCriteria(Object parent, CheckboxTreeViewer tree, ITreeContentProvider contentProvider) { Object[] children = contentProvider.getChildren(parent); List<CriterionResource> resources = new ArrayList<>(); @@ -339,7 +339,7 @@ public class LocalHelpPage extends RootScopePage { return resources.toArray(new CriterionResource[resources.size()]); } - void handleCheckStateChange(final CheckStateChangedEvent event, + void handleCheckStateChange(final CheckStateChangedEvent event, final CheckboxTreeViewer tree, final ITreeContentProvider contentProvider) { BusyIndicator.showWhile(getShell().getDisplay(), () -> { Object element = event.getElement(); @@ -361,8 +361,8 @@ public class LocalHelpPage extends RootScopePage { criteria = new CriterionResource[0]; } else { criteria = findCheckedCriteria( - criteriaTree.getInput(), - criteriaTree, + criteriaTree.getInput(), + criteriaTree, criteriaTreeContentProvider); } findCheckedElements(elements, contentTree.getInput(), contentTree, contentTreeContentProvider); @@ -426,7 +426,7 @@ public class LocalHelpPage extends RootScopePage { } } } - + @Override protected void performDefaults() { searchAll.setSelection(true); @@ -437,7 +437,7 @@ public class LocalHelpPage extends RootScopePage { } super.performDefaults(); } - + @Override protected Label createDescriptionLabel(Composite parent) { if ( getContainer() == null ) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java index da7acdfb2..f15c8ee8b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/LocalSearchScopeFactory.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -25,7 +25,7 @@ import org.eclipse.jface.preference.IPreferenceStore; public class LocalSearchScopeFactory implements ISearchScopeFactory { public final static String P_WORKING_SET = "workingSet"; //$NON-NLS-1$ public final static String P_CAPABILITY_FILTERING = "capabilityFiltering"; //$NON-NLS-1$ - + @Override public ISearchScope createSearchScope(IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java index 0cfda2656..5c0195f3d 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchPage.java @@ -38,7 +38,7 @@ public class WebSearchPage extends RootScopePage { initializeDialogUnits(parent); Label label = new Label(parent, SWT.NULL); - label.setText(Messages.WebSearchPage_label); + label.setText(Messages.WebSearchPage_label); GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING); label.setLayoutData(gd); urlText = new Text(parent, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL @@ -51,7 +51,7 @@ public class WebSearchPage extends RootScopePage { urlText.setEditable(getEngineDescriptor().isUserDefined()); new Label(parent, SWT.NULL); label = new Label(parent, SWT.WRAP); - label.setText(Messages.WebSearchPage_info); + label.setText(Messages.WebSearchPage_info); gd = new GridData(GridData.FILL_HORIZONTAL); gd.widthHint = 100; label.setLayoutData(gd); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java index b2929c82a..1cebaf1d1 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/search/WebSearchScopeFactory.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -22,14 +22,14 @@ import org.eclipse.jface.preference.IPreferenceStore; */ public class WebSearchScopeFactory implements ISearchScopeFactory { public final static String P_URL = "url"; //$NON-NLS-1$ - + @Override public ISearchScope createSearchScope(IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { String urlTemplate = getProperty(store, engineId, parameters); return new WebSearch.Scope(urlTemplate); } - + private String getProperty(IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { // try the store first diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java index 3edae8bec..ccd525936 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/AbstractOverlayIcon.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java index e2a279c78..7b53d9a60 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/ErrorUtil.java @@ -38,7 +38,7 @@ public class ErrorUtil implements IErrorUtil { /** * Immediately displays error dialog with a given string - * + * * @param msg * error message to display and log. */ @@ -56,7 +56,7 @@ public class ErrorUtil implements IErrorUtil { /** * Immediately displays an Information dialog with a given string - * + * * @param msg * error message to display. */ @@ -74,7 +74,7 @@ public class ErrorUtil implements IErrorUtil { /** * Immediately displays a Question dialog with a given string (question). - * + * * @return which button(Yes/No) was pressed by user */ public static boolean displayQuestionDialog(String msg) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java index 1114c6a16..66e18a753 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/EscapeUtils.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -27,7 +27,7 @@ public class EscapeUtils { public static String escapeSpecialChars(String value) { return escapeSpecialChars(value, false); } - + /** * Replace every occurrence of &, <, >, ', " by an escape character * but allow <b> and </b> through @@ -38,11 +38,11 @@ public class EscapeUtils { public static String escapeSpecialCharsLeavinggBold(String value) { return escapeSpecialChars(value, true); } - + public static String escapeAmpersand(String value) { return value.replaceAll("&", "&"); //$NON-NLS-1$ //$NON-NLS-2$ } - + /** * Escape any ampersands used in a label **/ @@ -52,7 +52,7 @@ public class EscapeUtils { if (message.indexOf('&') < 0) { return message; } - + int next = 0; StringBuffer result = new StringBuffer(); int index = message.indexOf('&'); @@ -108,7 +108,7 @@ public class EscapeUtils { buf.append("<br/>"); //$NON-NLS-1$ i+= 3; continue; - } + } } if (i + 2 < length) { String tag = value.substring(i, i + 3); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/FontUtils.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/FontUtils.java index 644f6557c..5362bd42c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/FontUtils.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/FontUtils.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -16,7 +16,7 @@ import org.eclipse.osgi.service.environment.Constants; import org.eclipse.swt.widgets.Display; public class FontUtils { - + private static final int TRAY_FONT_HEIGHT_LIMIT = 17; /* @@ -31,7 +31,7 @@ public class FontUtils { return true; } } - + /* * Get a sequence of JavaScript which will scale the embedded browser contents * @param percent The percentage scaling relative to the default size @@ -46,7 +46,7 @@ public class FontUtils { } return null; // No rescale in Mozilla browsers } - + /* * Function to determine whether the browser in the help view supports a zoom command */ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java index 9ba4cc6f2..52b1202b2 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/util/OverlayIcon.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java index d0679e459..761e26617 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/AllTopicsPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -98,15 +98,15 @@ public class AllTopicsPart extends HyperlinkTreePart { boolean expandable = treeViewer.isExpandable(obj); if (obj instanceof Toc){ Toc toc = (Toc) obj; - Image icon = HelpUIResources.getImageFromId(toc.getIcon(), expanded, !expandable); + Image icon = HelpUIResources.getImageFromId(toc.getIcon(), expanded, !expandable); if (icon != null) { return icon; - } + } } - + if (obj instanceof Topic) { - Topic topic = (Topic) obj; - Image icon = HelpUIResources.getImageFromId(topic.getIcon(), expanded, !expandable); + Topic topic = (Topic) obj; + Image icon = HelpUIResources.getImageFromId(topic.getIcon(), expanded, !expandable); if (icon != null) { return icon; } @@ -250,7 +250,7 @@ public class AllTopicsPart extends HyperlinkTreePart { } } } - + public void selectReveal(IHelpResource res) { treeViewer.setSelection(new StructuredSelection(res), true); treeViewer.expandToLevel(res, 1); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java index 0ad25df0f..0402f3917 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarkHeaderPart.java @@ -30,7 +30,7 @@ public class BookmarkHeaderPart extends AbstractFormPart implements IHelpPart { private Composite container; private String id; - public BookmarkHeaderPart(Composite parent, FormToolkit toolkit) { + public BookmarkHeaderPart(Composite parent, FormToolkit toolkit) { container = toolkit.createComposite(parent); Composite inner = toolkit.createComposite(container); GridLayout layout = new GridLayout(); @@ -40,7 +40,7 @@ public class BookmarkHeaderPart extends AbstractFormPart implements IHelpPart { data.heightHint = 2; inner.setLayoutData(data); } - + @Override public void init(ReusableHelpPart parent, String id, IMemento memento) { this.id = id; @@ -82,17 +82,17 @@ public class BookmarkHeaderPart extends AbstractFormPart implements IHelpPart { @Override public void stop() { - + } @Override public void toggleRoleFilter() { - + } @Override public void refilter() { - + } - + } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java index f465af0d6..b85bcb4e0 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BookmarksPart.java @@ -80,7 +80,7 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer { @Override public String getText(Object obj) { if (obj instanceof BookmarkManager) - return Messages.BookmarksPart_savedTopics; + return Messages.BookmarksPart_savedTopics; if (obj instanceof IHelpResource) return ((IHelpResource) obj).getLabel(); return super.getText(obj); @@ -131,10 +131,10 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer { } } }; - deleteAction.setText(Messages.BookmarksPart_delete); + deleteAction.setText(Messages.BookmarksPart_delete); deleteAction.setEnabled(false); } - + @Override protected void handleSelectionChanged(IStructuredSelection sel) { Object obj = sel.getFirstElement(); @@ -165,7 +165,7 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer { () -> BaseHelpSystem.getBookmarkManager().removeAllBookmarks()); } }; - action.setText(Messages.BookmarksPart_deleteAll); + action.setText(Messages.BookmarksPart_deleteAll); manager.add(action); value=true; } @@ -189,7 +189,7 @@ public class BookmarksPart extends HyperlinkTreePart implements Observer { parent.showURL(res.getHref()); } } - + @Override public void update(final Observable o, final Object arg) { treeViewer.getControl().getDisplay().asyncExec(() -> asyncUpdate(o, arg)); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java index f4a81fd5c..98d418299 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/BrowserPart.java @@ -54,7 +54,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { private final static String HIGHLIGHT_ON = "highlight-on"; //$NON-NLS-1$ private final static String HELP_VIEW_SCALE = "help_view_scale"; //$NON-NLS-1$ private final static String EMPTY_PAGE = "<html><head></head><body></body></html>"; //$NON-NLS-1$ - + private ReusableHelpPart parent; private Browser browser; @@ -64,11 +64,11 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { private int lastProgress = -1; private static final int SCALE_MAX = 250; - + private static final int SCALE_MIN = 50; - + private static final int SCALE_INCREMENT = 10; - + private int fontScalePercentage = 100; private String url; @@ -76,15 +76,15 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { private Action showExternalAction; private Action syncTocAction; - + private Action highlightAction; private Action bookmarkAction; private Action printAction; - + private Action magnifyAction; - + private Action reduceAction; private String statusURL; @@ -242,12 +242,12 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { bookmarkAction.setToolTipText(Messages.BrowserPart_bookmarkTooltip); bookmarkAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_ADD_BOOKMARK)); - + highlightAction = new Action() { @Override public void run() { - IScopeContext instanceScope = InstanceScope.INSTANCE; + IScopeContext instanceScope = InstanceScope.INSTANCE; IEclipsePreferences prefs = instanceScope.getNode(HelpBasePlugin.PLUGIN_ID); prefs.putBoolean(HIGHLIGHT_ON, highlightAction.isChecked()); if (browser.getUrl().indexOf("resultof")!=-1) browser.execute("setHighlight(" +highlightAction.isChecked()+");"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ @@ -257,7 +257,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { highlightAction.setToolTipText(Messages.BrowserPart_highlightTooltip); highlightAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_HIGHLIGHT)); - + printAction = new Action(ActionFactory.PRINT.getId()) { @Override @@ -268,7 +268,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { printAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_HELP_PRINT)); printAction.setToolTipText(Messages.BrowserPart_printTooltip); - + tbm.insertBefore("back", showExternalAction); //$NON-NLS-1$ tbm.insertBefore("back", syncTocAction); //$NON-NLS-1$ tbm.insertBefore("back", printAction); //$NON-NLS-1$ @@ -277,13 +277,13 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { tbm.insertBefore("back", new Separator()); //$NON-NLS-1$ enableButtons(); } - + private void contributeToMenu(IMenuManager menuManager) { if (FontUtils.canRescaleHelpView()) { fontScalePercentage = Platform.getPreferencesService().getInt(HelpBasePlugin.PLUGIN_ID, HELP_VIEW_SCALE, 100, null); if (menuManager != null) { - addMenuActions(menuManager); + addMenuActions(menuManager); } } } @@ -360,7 +360,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { browser.setUrl(url); } } - + public void clearBrowser() { if (browser != null) { browser.setText(EMPTY_PAGE); @@ -456,17 +456,17 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { return printAction; return null; } - + private void enableButtons() { if (magnifyAction != null) { magnifyAction.setEnabled(fontScalePercentage < SCALE_MAX); - reduceAction.setEnabled(fontScalePercentage > SCALE_MIN); + reduceAction.setEnabled(fontScalePercentage > SCALE_MIN); } } private void doMagnify(int percent) { fontScalePercentage += percent; - IScopeContext instanceScope = InstanceScope.INSTANCE; + IScopeContext instanceScope = InstanceScope.INSTANCE; IEclipsePreferences prefs = instanceScope.getNode(HelpBasePlugin.PLUGIN_ID); prefs.putInt(HELP_VIEW_SCALE, fontScalePercentage); try { @@ -477,7 +477,7 @@ public class BrowserPart extends AbstractFormPart implements IHelpPart { } public void rescale() { - browser.execute(FontUtils.getRescaleScript(fontScalePercentage)); + browser.execute(FontUtils.getRescaleScript(fontScalePercentage)); enableButtons(); } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java index d99f9450e..a382abfbe 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/Chevron.java @@ -24,7 +24,7 @@ public final class Chevron extends ToggleHyperlink { /** * Creates a control in a provided composite. - * + * * @param parent * the parent * @param style diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ComboPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ComboPart.java index 17cd277de..4c97c7e10 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ComboPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ComboPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -23,7 +23,7 @@ public class ComboPart { public ComboPart() { } - + public ComboPart(Composite parent, FormToolkit toolkit, int style) { createControl(parent, toolkit, style); } @@ -34,20 +34,20 @@ public class ComboPart { else ((CCombo) combo).addSelectionListener(listener); } - + public void addModifyListener(ModifyListener listener) { if (combo instanceof Combo) ((Combo) combo).addModifyListener(listener); else ((CCombo) combo).addModifyListener(listener); - } - + } + public void addKeyListener(KeyListener listener) { if (combo instanceof Combo) ((Combo) combo).addKeyListener(listener); else ((CCombo) combo).addKeyListener(listener); - } + } public void createControl(Composite parent, FormToolkit toolkit, int style) { if (toolkit.getBorderStyle() == SWT.BORDER) diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java index e37a24540..df697e977 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -80,7 +80,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { private ReusableHelpPart parent; private static final String HELP_KEY = "org.eclipse.ui.help"; //$NON-NLS-1$ - + private static final String MORE_HREF = "__more__"; //$NON-NLS-1$ private FormText text; @@ -96,7 +96,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { private String defaultText = ""; //$NON-NLS-1$ private String id; - + private Font codeFont; private String savedDescription; @@ -171,8 +171,8 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { public void getName(AccessibleEvent e) { if (e.childID == ACC.CHILDID_SELF) { String currentName = e.result; - e.result = Messages.ReusableHelpPart_contextHelpPage_name - + ' ' + getSection().getText()+ ' ' +currentName; + e.result = Messages.ReusableHelpPart_contextHelpPage_name + + ' ' + getSection().getText()+ ' ' +currentName; } } }); @@ -186,12 +186,12 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } return style; } - + private static Font createCodeFont(Display display, Font regularFont, Font textFont) { FontData[] rfontData = regularFont.getFontData(); FontData[] tfontData = textFont.getFontData(); int height = 0; - + for (int i=0; i<rfontData.length; i++) { FontData data = rfontData[i]; height = Math.max(height, data.getHeight()); @@ -201,7 +201,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } return new Font(display, tfontData); } - + @Override public void dispose() { if (codeFont!=null) @@ -258,7 +258,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { parent.showURL(sHref); } } - + private void doRunCommand(String serialization) { ExecuteCommandAction action = new ExecuteCommandAction(); action.setInitializationString(serialization); @@ -333,11 +333,11 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { updateDynamicHelp(); } } - + private long lastUpdate = 0; private String[] searchTerms; - + /* * If F1 was pressed within the last half second and this is a context change do not * update dynamic help solely due to a focus change, Bug 159450 @@ -394,7 +394,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { searchTerms = new String[] { expression }; } } - + private void updateDynamicHelp() { RelatedTopicsPart part = (RelatedTopicsPart) parent .findPart(IHelpUIConstants.HV_RELATED_TOPICS); @@ -419,9 +419,9 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } return buff.length() > 0 ? buff.toString().trim() : null; } - + private class SearchTerms { - + private List<String> terms = new ArrayList<>(); private Set<String> termSet = new HashSet<>(); public void add(String term) { @@ -433,7 +433,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { terms.add(term); } } - + public String[] toArray() { return terms.toArray(new String[terms.size()]); } @@ -518,7 +518,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } return null; } - + private String stripMnemonic(String name) { int loc = name.indexOf('&'); if (loc!= -1) @@ -563,12 +563,12 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { sbuf.append("<p>"); //$NON-NLS-1$ sbuf.append(decodeContextBoldTags(context)); sbuf.append("</p>"); //$NON-NLS-1$ - + ICommandLink[] commands = null; if (context instanceof IContext3) { commands = ((IContext3)context).getRelatedCommands(); } - + String category = new String(); if (commands != null && commands.length > 0) { for (int i=0;i<commands.length;++i) { @@ -589,7 +589,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { } } } - + IHelpResource[] links = context.getRelatedTopics(); if (links != null && context instanceof IContext2) { ContextHelpSorter sorter = new ContextHelpSorter((IContext2)context); @@ -676,7 +676,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { /** * Make sure to support the Help system bold tag. The help system returns a * regular string for getText(). Use internal apis for now to get bold. - * + * * @param context * @return */ @@ -749,7 +749,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart { @Override public void saveState(IMemento memento) { } - + private void doMore(String moreText) { int index = Integer.parseInt(moreText); parent.startSearch(searchTerms[index]); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpProviderInput.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpProviderInput.java index c3f1a4f00..d1af30b08 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpProviderInput.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpProviderInput.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -28,7 +28,7 @@ public class ContextHelpProviderInput { this.part = part; this.explicitRequest = explicitRequest; } - + public IContextProvider getProvider() { return provider; } @@ -41,7 +41,7 @@ public class ContextHelpProviderInput { public IWorkbenchPart getPart() { return part; } - + public boolean isExplicitRequest() { return explicitRequest; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java index daea69229..3cc783597 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpSorter.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -20,13 +20,13 @@ import org.eclipse.jface.viewers.ViewerComparator; public class ContextHelpSorter extends ViewerComparator { private IContext2 context; private LinkedList<String> list; - + public ContextHelpSorter(IContext2 context) { super(ReusableHelpPart.SHARED_COLLATOR); list = new LinkedList<>(); this.context = context; } - + @Override public void sort(Viewer viewer, Object[] elements) { for (int i = 0; i < elements.length; i++) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java index 742ee940f..eec77dd4e 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/DynamicHelpPart.java @@ -91,7 +91,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { | Section.TITLE_BAR); // configure section Section section = getSection(); - section.setText(Messages.SearchPart_title); + section.setText(Messages.SearchPart_title); section.marginWidth = 5; section.addExpansionListener(new ExpansionAdapter() { @@ -117,7 +117,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { } }); section.setTextClient(clearLink); - */ + */ resultSorter = new SorterByScore(); searchResults = toolkit.createFormText(section, false); section.setClient(searchResults); @@ -134,7 +134,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { @Override public void linkActivated(HyperlinkEvent e) { Object href = e.getHref(); - if (href.equals(CANCEL_HREF)) { + if (href.equals(CANCEL_HREF)) { if (runningJob != null) { runningJob.cancel(); runningJob = null; @@ -167,19 +167,19 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { stop(); super.dispose(); } - + @Override public void setFocus() { if (searchResults!=null) searchResults.setFocus(); } - + @Override public void stop () { if (runningJob!=null) { runningJob.cancel(); runningJob=null; - } + } } @Override @@ -212,7 +212,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { searchResults.setText("", false, false); //$NON-NLS-1$ getManagedForm().reflow(true); } - + public void startSearch(String newPhrase, IContext excludeContext) { if (phrase!=null && phrase.equals(newPhrase)) return; @@ -221,10 +221,10 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { if (getSection().isExpanded()) startInPlaceSearch(phrase, excludeContext); } - + private void startInPlaceSearch(final String phrase, final IContext excludeContext) { - Job job = new Job(Messages.SearchPart_dynamicJob) { + Job job = new Job(Messages.SearchPart_dynamicJob) { @Override protected IStatus run(IProgressMonitor monitor) { @@ -246,7 +246,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { job.setSystem(true); scheduleSearch(job); } - + private void performSearch(String phrase, IContext excludeContext, IProgressMonitor monitor) { SearchQuery searchQuery = new SearchQuery(); @@ -275,12 +275,12 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { buff.append("<p><span color=\""); //$NON-NLS-1$ buff.append(IFormColors.TITLE); buff.append("\">"); //$NON-NLS-1$ - buff.append(Messages.SearchResultsPart_progress); + buff.append(Messages.SearchResultsPart_progress); buff.append("</span>"); //$NON-NLS-1$ buff.append("<a href=\""); //$NON-NLS-1$ buff.append(CANCEL_HREF); buff.append("\">"); //$NON-NLS-1$ - buff.append(Messages.SearchResultsPart_cancel); + buff.append(Messages.SearchResultsPart_cancel); buff.append("</a></p>"); //$NON-NLS-1$ buff.append("</form>"); //$NON-NLS-1$ searchResults.setText(buff.toString(), true, false); @@ -288,14 +288,14 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { runningJob = job; job.schedule(); } - + private void updateResults(final String phrase, final IContext excludeContext, final StringBuffer buffer, final SearchHit[] hits) { if (getSection().isDisposed()) return; getSection().getDisplay().asyncExec(() -> doUpdateResults(phrase, excludeContext, buffer, hits)); - } + } private void doUpdateResults(String phrase, IContext excludeContext, StringBuffer buff, SearchHit[] hits) { if (runningJob != null) { @@ -308,7 +308,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { buff.append("<p><span color=\""); //$NON-NLS-1$ buff.append(IFormColors.TITLE); buff.append("\">"); //$NON-NLS-1$ - buff.append(NLS.bind(Messages.SearchResultsPart_label, phrase)); + buff.append(NLS.bind(Messages.SearchResultsPart_label, phrase)); buff.append("</span></p>"); //$NON-NLS-1$ resultSorter.sort(null, hits); IHelpResource [] excludedTopics = excludeContext!=null?excludeContext.getRelatedTopics():null; @@ -345,7 +345,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { buff.append(" <a href=\""); //$NON-NLS-1$ buff.append(MORE_HREF); buff.append("\">"); //$NON-NLS-1$ - buff.append(Messages.SearchResultsPart_moreResults); + buff.append(Messages.SearchResultsPart_moreResults); buff.append("</a></p>"); //$NON-NLS-1$ } buff.append("</form>"); //$NON-NLS-1$ @@ -353,11 +353,11 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { searchResults.setText(buff.toString(), true, false); } else if (!searchResults.isDisposed()) - searchResults.setText(NLS.bind(Messages.SearchResultsPart_noHits, phrase) , false, false); + searchResults.setText(NLS.bind(Messages.SearchResultsPart_noHits, phrase) , false, false); if (!searchResults.isDisposed()) getManagedForm().reflow(true); } - + private boolean isExcluded(String href, IHelpResource [] excludedTopics) { if (excludedTopics==null) return false; for (int i=0; i<excludedTopics.length; i++) { @@ -409,7 +409,7 @@ public class DynamicHelpPart extends SectionPart implements IHelpPart { @Override public void refilter() { if (phrase!=null && phrase.length() > 0) - startInPlaceSearch(phrase, context); + startInPlaceSearch(phrase, context); } @Override diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java index f81f3093d..79c02832c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptor.java @@ -32,7 +32,7 @@ public class EngineDescriptor implements IEngineDescriptor { private ISearchEngine engine; private IConfigurationElement config; - + private EngineDescriptorManager manager; private EngineTypeDescriptor etdesc; @@ -52,12 +52,12 @@ public class EngineDescriptor implements IEngineDescriptor { private boolean userDefined; /** - * + * */ public EngineDescriptor(IConfigurationElement config) { this.config = config; } - + public EngineDescriptor(EngineDescriptorManager manager) { this.manager = manager; } @@ -65,7 +65,7 @@ public class EngineDescriptor implements IEngineDescriptor { public void setEngineType(EngineTypeDescriptor etdesc) { this.etdesc = etdesc; } - + public void setEngineDescriptorManager(EngineDescriptorManager manager) { this.manager = manager; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptorManager.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptorManager.java index 45e195c5f..a90956b4b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptorManager.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineDescriptorManager.java @@ -48,7 +48,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta private static final String USER_FILE = "userSearches.xml"; //$NON-NLS-1$ private static final String ATT_ENGINE_TYPE_ID = "engineTypeId"; //$NON-NLS-1$ - + public static class DescriptorEvent { private EngineDescriptor desc; private int kind; @@ -68,7 +68,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta descriptors = new ArrayList<>(); load(); } - + public void add(EngineDescriptor desc) { descriptors.add(desc); this.setChanged(); @@ -85,11 +85,11 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta this.setChanged(); this.notifyObservers(new DescriptorEvent(desc, CHANGE)); } - + public EngineDescriptor[] getDescriptors() { return descriptors.toArray(new EngineDescriptor[descriptors.size()]); } - + public EngineDescriptor findEngine(String engineId) { for (int i=0; i<descriptors.size(); i++) { EngineDescriptor desc = descriptors.get(i); @@ -124,7 +124,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta writer.flush(); } catch (IOException e) { - HelpUIPlugin.logError(Messages.EngineDescriptorManager_errorSaving, e); + HelpUIPlugin.logError(Messages.EngineDescriptorManager_errorSaving, e); } finally { if (osw!=null) { @@ -152,7 +152,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta load(fileName); } catch (IOException e) { - HelpUIPlugin.logError(Messages.EngineDescriptorManager_errorLoading, e); + HelpUIPlugin.logError(Messages.EngineDescriptorManager_errorLoading, e); } } @@ -162,7 +162,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta Hashtable<String, EngineTypeDescriptor> engineTypes = loadEngineTypes(elements); for (int i = 0; i < elements.length; i++) { IConfigurationElement element = elements[i]; - if (element.getName().equals(TAG_ENGINE)) { + if (element.getName().equals(TAG_ENGINE)) { EngineDescriptor desc = new EngineDescriptor(element); String engineId = desc.getEngineTypeId(); if (engineId != null) { @@ -279,7 +279,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta } return typeId; } - + private boolean isUsed(int value, ArrayList<Integer> used) { for (int i=0; i<used.size(); i++) { Integer iv = used.get(i); @@ -304,7 +304,7 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta } return null; } - + private void save(PrintWriter writer, EngineDescriptor desc) { String indent = " "; //$NON-NLS-1$ String attIndent = indent + indent; @@ -318,14 +318,14 @@ public class EngineDescriptorManager extends Observable implements IHelpUIConsta writer.print(indent); writer.println("</engine>"); //$NON-NLS-1$ } - + private String getAttribute(Node node, String name) { Node att = node.getAttributes().getNamedItem(name); if (att!=null) return att.getNodeValue(); return null; } - + private void saveAttribute(PrintWriter writer, String indent, String name, String value) { if (value==null) return; diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeDescriptor.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeDescriptor.java index 61d8f7b41..c85b21ab9 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeDescriptor.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeDescriptor.java @@ -33,7 +33,7 @@ public class EngineTypeDescriptor { private Image image; private ISearchScopeFactory factory; /** - * + * */ public EngineTypeDescriptor(IConfigurationElement config) { this.config = config; @@ -44,9 +44,9 @@ public class EngineTypeDescriptor { public IConfigurationElement [] getPages() { return config.getChildren("subpage"); //$NON-NLS-1$ } - + public String getLabel() { - return config.getAttribute(IHelpUIConstants.ATT_LABEL); + return config.getAttribute(IHelpUIConstants.ATT_LABEL); } public String getId() { return config.getAttribute(IHelpUIConstants.ATT_ID); @@ -64,15 +64,15 @@ public class EngineTypeDescriptor { image = HelpUIResources.getImage(IHelpUIConstants.IMAGE_HELP_SEARCH); return image; } - + public String getDescription() { String desc = null; IConfigurationElement [] children = config.getChildren(IHelpUIConstants.TAG_DESC); - if (children.length==1) + if (children.length==1) desc = children[0].getValue(); return desc; } - + public ImageDescriptor getImageDescriptor() { ImageDescriptor desc=null; String icon = config.getAttribute(IHelpUIConstants.ATT_ICON); @@ -110,7 +110,7 @@ public class EngineTypeDescriptor { } return null; } - + public ISearchScope createSearchScope(IPreferenceStore store, String engineId, Dictionary<String, Object> parameters) { if (factory==null) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java index d00d819b7..e106422e1 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/EngineTypeWizardPage.java @@ -31,7 +31,7 @@ public class EngineTypeWizardPage extends WizardPage { private TableViewer tableViewer; private EngineTypeDescriptor [] engineTypes; private EngineTypeDescriptor selection; - + class EngineContentProvider implements IStructuredContentProvider { @Override @@ -47,7 +47,7 @@ public class EngineTypeWizardPage extends WizardPage { public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } - + class EngineLabelProvider extends LabelProvider implements ITableLabelProvider { @Override @@ -75,8 +75,8 @@ public class EngineTypeWizardPage extends WizardPage { public EngineTypeWizardPage(EngineTypeDescriptor[] engineTypes) { super("engineType"); //$NON-NLS-1$ - setTitle(Messages.EngineTypeWizardPage_title); - setDescription(Messages.EngineTypeWizardPage_desc); + setTitle(Messages.EngineTypeWizardPage_title); + setDescription(Messages.EngineTypeWizardPage_desc); this.engineTypes = engineTypes; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java index 4af3f2569..c4bf00a6c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/FederatedSearchSorter.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -19,7 +19,7 @@ public class FederatedSearchSorter extends ViewerComparator { public FederatedSearchSorter() { super(ReusableHelpPart.SHARED_COLLATOR); } - + @Override public int category(Object element) { if (element instanceof ISearchEngineResult) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java index 290f18635..93e5130cd 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java @@ -50,20 +50,20 @@ import org.eclipse.ui.forms.widgets.FormToolkit; * help or a cheat sheet follows the user into a dialog. */ public class HelpTray extends DialogTray implements IPageChangedListener { - + public static final int MINIMUM_HEIGHT = 450; private static final int DEFAULT_WIDTH = 210; - + private int originalHeight; private int heightAdded; - + private FormToolkit toolkit; private ReusableHelpPart helpPart; private Shell shell; private IContributionItem closeAction; private Image normal; private Image hover; - + /** * Creates any actions needed by the tray. */ @@ -85,17 +85,17 @@ public class HelpTray extends DialogTray implements IPageChangedListener { } }; } - + /** * Creates the contents of the tray. - * + * * @param parent the parent composite that will contain the tray */ @Override protected Control createContents(Composite parent) { // if the dialog is too short, make it taller ensureMinimumHeight(parent.getShell()); - + toolkit = new FormToolkit(parent.getDisplay()); toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkGroup.UNDERLINE_HOVER); toolkit.getColors().initializeSectionToolBarColors(); @@ -105,7 +105,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { layout.verticalSpacing = 0; container.setLayout(layout); container.addListener(SWT.Dispose, event -> dispose()); - + ToolBarManager tbm = new ToolBarManager(SWT.FLAT); tbm.createControl(container); GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END); @@ -122,14 +122,14 @@ public class HelpTray extends DialogTray implements IPageChangedListener { gd = new GridData(GridData.FILL_BOTH); gd.widthHint = DEFAULT_WIDTH; helpPart.getControl().setLayoutData(gd); - + createActions(); tbm.add(closeAction); - + shell = parent.getShell(); hookPageChangeListener(shell); helpPart.getControl().addListener(SWT.Dispose, event -> unhookPageChangeListener(shell)); - + return container; } @@ -138,13 +138,13 @@ public class HelpTray extends DialogTray implements IPageChangedListener { */ private void createImages() { Display display = Display.getCurrent(); - int[] shape = new int[] { - 3, 3, 5, 3, 7, 5, 8, 5, 10, 3, 12, 3, + int[] shape = new int[] { + 3, 3, 5, 3, 7, 5, 8, 5, 10, 3, 12, 3, 12, 5, 10, 7, 10, 8, 12,10, 12,12, 10,12, 8, 10, 7, 10, 5, 12, 3, 12, 3, 10, 5, 8, 5, 7, 3, 5 }; - + /* * Use magenta as transparency color since it is used infrequently. */ @@ -174,7 +174,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { gc.setForeground(border); gc.drawPolygon(shape); gc.dispose(); - + backgroundHot.dispose(); } @@ -186,7 +186,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { hover.dispose(); toolkit.dispose(); helpPart.dispose(); - + /* * Shell is about to be closed. Add a one-time-only listener * that will return the dialog height back to original. @@ -209,7 +209,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { * Ensures that the dialog's height is sufficient to contain the help tray. * If the dialog is too short, its height is increased. When closing the tray, * the height is returned to original (see dispose()). - * + * * @param shell the dialog's shell */ private void ensureMinimumHeight(Shell shell) { @@ -224,20 +224,20 @@ public class HelpTray extends DialogTray implements IPageChangedListener { heightAdded = 0; } } - + /** * Returns the ReusableHelpPart contained in the tray. - * + * * @return the tray's ReusableHelpPart */ public ReusableHelpPart getHelpPart() { return helpPart; } - + /** * Add the listener that gets notified of page changes (to automatically * update context help). - * + * * @param parent the Composite to hook the listener to */ private void hookPageChangeListener(Composite parent) { @@ -251,7 +251,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { * Returns whether or not the help tray can handle the given shell. In some * cases the help tray is not appropriate for shells that are too short and * not resizable. In these cases infopops are used. - * + * * @param shell the shell to check * @return whether or not the help tray is appropriate for the hsell */ @@ -266,7 +266,7 @@ public class HelpTray extends DialogTray implements IPageChangedListener { /** * Called whenever the dialog we're inside has changed pages. This updates * the context help page if it is visible. - * + * * @param event the page change event */ @Override @@ -287,11 +287,11 @@ public class HelpTray extends DialogTray implements IPageChangedListener { } helpPart.update(null, null, null, c, false); } - + /** * Remove the listener that gets notified of page changes (to automatically * update context help). - * + * * @param parent the Composite that had the listener */ private void unhookPageChangeListener(Composite parent) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java index 24870ac52..b28cd37df 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpView.java @@ -44,7 +44,7 @@ import org.eclipse.ui.part.ViewPart; public class HelpView extends ViewPart implements IPartListener2, ISelectionChangedListener, IPageChangedListener { private FormToolkit toolkit; - + private String firstPageId; private ReusableHelpPart reusableHelpPart; @@ -56,7 +56,7 @@ public class HelpView extends ViewPart implements IPartListener2, private boolean visible; /** - * + * */ public HelpView() { } @@ -69,7 +69,7 @@ public class HelpView extends ViewPart implements IPartListener2, // toolkit.setBackground(toolkit.getColors().createNoContentBackground()); toolkit.getColors().initializeSectionToolBarColors(); reusableHelpPart.createControl(parent, toolkit); - reusableHelpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); + reusableHelpPart.setDefaultContextHelpText(Messages.HelpView_defaultText); reusableHelpPart.showPage(getFirstPage()); PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.eclipse.help.ui.helpView"); //$NON-NLS-1$ @@ -118,7 +118,7 @@ public class HelpView extends ViewPart implements IPartListener2, IPartService service = window.getPartService(); service.addPartListener(this); } - + @Override public void saveState(IMemento memento) { if (reusableHelpPart!=null && memento!=null) { @@ -154,7 +154,7 @@ public class HelpView extends ViewPart implements IPartListener2, } else { if (HelpPlugin.DEBUG_CONTEXT) { if (c == null) { - System.out.println("Context: focus control is null " ); //$NON-NLS-1$ + System.out.println("Context: focus control is null " ); //$NON-NLS-1$ } if (!c.isVisible()) { System.out.println("Context: focus control not visible " ); //$NON-NLS-1$ @@ -168,7 +168,7 @@ public class HelpView extends ViewPart implements IPartListener2, ((IPageChangeProvider)part).addPageChangedListener(this); monitoredPart = part; } - + private void uninstallPageListener(IWorkbenchPart part) { if (part instanceof IPageChangeProvider) ((IPageChangeProvider)part).removePageChangedListener(this); @@ -313,7 +313,7 @@ public class HelpView extends ViewPart implements IPartListener2, /* * (non-Javadoc) - * + * * @see org.eclipse.help.ui.internal.views.BaseHelpView#getFirstPage() */ protected String getFirstPage() { @@ -348,7 +348,7 @@ public class HelpView extends ViewPart implements IPartListener2, /* * (non-Javadoc) - * + * * @see org.eclipse.help.ui.internal.views.BaseHelpView#getHelpPartStyle() */ protected int getHelpPartStyle() { @@ -365,17 +365,17 @@ public class HelpView extends ViewPart implements IPartListener2, if (reusableHelpPart != null) reusableHelpPart.startSearch(phrase); } - + public void showIndex() { if (reusableHelpPart != null) reusableHelpPart.showPage(IHelpUIConstants.HV_INDEX_PAGE, true); } - + public void showHelp(String href) { if (reusableHelpPart != null) reusableHelpPart.showURL(href); } - + public void showDynamicHelp(IWorkbenchPart part, Control c) { if (reusableHelpPart != null) reusableHelpPart.showDynamicHelp(part, c); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpviewProtocol.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpviewProtocol.java index 6869af147..68bccbd49 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpviewProtocol.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpviewProtocol.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -20,7 +20,7 @@ public class HelpviewProtocol { public static final String HELPVIEW_PROTOCOL = "helpview:"; //$NON-NLS-1$ public static final String CHECK_REMOTE_STATUS = "checkremote"; //$NON-NLS-1$ public static final String IGNORE_MISSING_BOOKS = "ignoreMissingBooks"; //$NON-NLS-1$ - + public static void handleProtocolCall(String url, ReusableHelpPart part) { int index = url.indexOf(HELPVIEW_PROTOCOL); if (index == -1) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryEntry.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryEntry.java index 676bb5d04..6de685601 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryEntry.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryEntry.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -17,7 +17,7 @@ public class HistoryEntry { private String target; private Object data; /** - * + * */ public HistoryEntry(int type, String target, Object data) { this.type = type; diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java index ba5fde352..a0f2828c4 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HistoryScopeSet.java @@ -30,7 +30,7 @@ public class HistoryScopeSet extends ScopeSet { super(set, set.getName()); setExpression(set.getExpression()); } - + @Override public void copyFrom(ScopeSet set) { String expression = getExpression(); @@ -42,16 +42,16 @@ public class HistoryScopeSet extends ScopeSet { IPreferenceStore store = getPreferenceStore(); return store.getString(KEY_EXPRESSION); } - + @Override public boolean isImplicit() { return true; - } - + } + @Override protected String getExtension() { return EXT; - } + } @Override protected String encodeFileName(String name) { @@ -72,6 +72,6 @@ public class HistoryScopeSet extends ScopeSet { public void setExpression(String expression) { IPreferenceStore store = getPreferenceStore(); - store.setValue(KEY_EXPRESSION, expression); + store.setValue(KEY_EXPRESSION, expression); } } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java index a302fd916..94662a7e3 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HyperlinkTreePart.java @@ -57,7 +57,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit; public abstract class HyperlinkTreePart extends AbstractFormPart implements IHelpPart { - + public class ScopeObserver implements Observer { @Override @@ -67,13 +67,13 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements } } } - + private class ScopeFilter extends ViewerFilter { - + public ScopeFilter(AbstractHelpScope scope) { this.scope = scope; } - + AbstractHelpScope scope; @Override @@ -92,7 +92,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements } return true; } - + } protected ReusableHelpPart parent; @@ -235,7 +235,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements } treeViewer.getTree().setCursor(null); }); - contributeToToolBar(tbm); + contributeToToolBar(tbm); scopeObserver = new ScopeObserver(); ScopeState.getInstance().getScopeSetManager().addObserver(scopeObserver); } @@ -266,7 +266,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements collapseAllAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_COLLAPSE_ALL)); collapseAllAction - .setToolTipText(Messages.AllTopicsPart_collapseAll_tooltip); + .setToolTipText(Messages.AllTopicsPart_collapseAll_tooltip); tbm.insertBefore("back", collapseAllAction); //$NON-NLS-1$ tbm.insertBefore("back", new Separator()); //$NON-NLS-1$ } @@ -395,7 +395,7 @@ public abstract class HyperlinkTreePart extends AbstractFormPart implements if (lastItem != null && lastItem.isDisposed()) lastItem = null; } - + @Override public void refilter() { ScopeSetManager manager = ScopeState.getInstance().getScopeSetManager(); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPart.java index fed97250e..a8c1b4471 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPartPage.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPartPage.java index 34c36cbb6..d9ea33ec9 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPartPage.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IHelpPartPage.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java index bf6fd0506..3d74930d0 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexPart.java @@ -4,12 +4,12 @@ * 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: * Intel Corporation - initial API and implementation * IBM Corporation - 163558 Dynamic content support for all UA * IBM Corporation - Support for see elements - * Andreas Meissner - Fix Bug 351272 + * Andreas Meissner - Fix Bug 351272 *******************************************************************************/ package org.eclipse.help.ui.internal.views; @@ -87,7 +87,7 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants { if (obj instanceof IndexSee) { IndexSee see = (IndexSee) obj; return getSeeString(see); - } + } return super.getText(obj); } @@ -96,7 +96,7 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants { return super.getImage(obj); } } - + public String getSeeString(IIndexSee see) { String seeText = see.isSeeAlso() ? Messages.SeeAlso : Messages.See; String message = NLS.bind(seeText, see.getKeyword()); @@ -215,16 +215,16 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants { private Object[] getChildren(IIndexEntry entry) { /* * Index entry has two types of children: topics and subentries. - * + * * The method returns topics among children only if number of the topics * more than 1. - * + * * In case when the entry owns only one topic, this topic is not returned * as child because the entry will represent this topic by its keyword. */ IHelpResource[] topics = entry.getTopics(); IIndexEntry[] subentries = entry.getSubentries(); - IIndexSee[] sees = entry instanceof IIndexEntry2 ? ((IIndexEntry2)entry).getSees() : + IIndexSee[] sees = entry instanceof IIndexEntry2 ? ((IIndexEntry2)entry).getSees() : new IIndexSee[0]; if (topics.length <= 1 && subentries.length == 0 && sees.length == 0) { @@ -244,9 +244,9 @@ public class IndexPart extends HyperlinkTreePart implements IHelpUIConstants { System.arraycopy(sees, 0, children, topics.length + subentries.length, sees.length); } - return children; + return children; } - + protected Tree getTreeWidget() { return treeViewer.getTree(); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java index 1ac4d8f25..932dff13c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/IndexTypeinPart.java @@ -4,7 +4,7 @@ * 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: * Intel Corporation - initial API and implementation * IBM Corporation 2008 - Bug 248079 [Help][Index] unicode sort issue in index view @@ -120,7 +120,7 @@ public class IndexTypeinPart extends AbstractFormPart implements IHelpPart, IHel return; } } - TreeItem item = indexTree.getItem(index); + TreeItem item = indexTree.getItem(index); indexTree.setSelection(new TreeItem[] { item }); String text = item.getText(); indexText.setText(text); @@ -139,7 +139,7 @@ public class IndexTypeinPart extends AbstractFormPart implements IHelpPart, IHel return; } } - TreeItem item = indexTree.getItem(index); + TreeItem item = indexTree.getItem(index); indexTree.setSelection(new TreeItem[] { item }); String text = item.getText(); indexText.setText(text); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java index e72881e21..564f7b932 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/LocalScopeDialog.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -36,12 +36,12 @@ public class LocalScopeDialog extends TrayDialog { this.preferenceStore = set.getPreferenceStore(); this.scopeSet = set; } - + @Override protected boolean isResizable() { return true; } - + @Override protected Control createDialogArea(Composite parent) { EngineDescriptor localSearchDesc = null; @@ -62,7 +62,7 @@ public class LocalScopeDialog extends TrayDialog { helpPageControl.setLayoutData(layoutData); return helpPageControl; } - + @Override protected void okPressed() { localHelpPage.performOk(); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java index 74537dcb7..f8c4af900 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/MissingContentPart.java @@ -39,8 +39,8 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { private ImageHyperlink statusLink; private boolean wasRemoteHelpUnavailable = false; private boolean wasUnresolvedPlaceholders = false; - - public MissingContentPart(Composite parent, FormToolkit toolkit) { + + public MissingContentPart(Composite parent, FormToolkit toolkit) { container = toolkit.createComposite(parent, SWT.NULL); container.setBackgroundMode(SWT.INHERIT_DEFAULT); GridLayout layout = new GridLayout(); @@ -66,15 +66,15 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { wasUnresolvedPlaceholders = isUnresolvedPlaceholders; FormToolkit toolkit = new FormToolkit(container.getDisplay()); if ( isRemoteHelpUnavailable ) { - createHelpMissingLink(container, toolkit, Dialog.DLG_IMG_MESSAGE_WARNING, Messages.remoteHelpUnavailable, + createHelpMissingLink(container, toolkit, Dialog.DLG_IMG_MESSAGE_WARNING, Messages.remoteHelpUnavailable, MissingContentManager.getInstance().getRemoteHelpUnavailablePage(true), true); } else if ( isUnresolvedPlaceholders) { - createHelpMissingLink(container, toolkit, Dialog.DLG_IMG_MESSAGE_INFO, Messages.ReusableHelpPart_missingContent, + createHelpMissingLink(container, toolkit, Dialog.DLG_IMG_MESSAGE_INFO, Messages.ReusableHelpPart_missingContent, MissingContentManager.getInstance().getHelpMissingPage(true), false); } toolkit.dispose(); } - + private void createHelpMissingLink(Composite container, FormToolkit toolkit, String imageKey, String linkText, String linkTarget, boolean isRemoteUnavailableLink) { final String target = linkTarget; final boolean isRemote = isRemoteUnavailableLink; @@ -83,7 +83,7 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { paddingData.heightHint = 2; padding.setLayoutData(paddingData); toolkit.adapt(padding); - Image warningImage = JFaceResources.getImage(imageKey); + Image warningImage = JFaceResources.getImage(imageKey); statusLink = toolkit.createImageHyperlink(container, SWT.NULL); statusLink.setText(linkText); statusLink.setImage(warningImage); @@ -91,7 +91,7 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { @Override public void linkActivated(HyperlinkEvent e) { - helpPart.showURL(target); + helpPart.showURL(target); if ( isRemote ) { helpPart.checkRemoteStatus(); } else { @@ -102,17 +102,17 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { GridData statusData = new GridData(GridData.BEGINNING, GridData.CENTER, false, false); statusLink.setLayoutData(statusData); } - + private void disposeLink() { if (statusLink != null) { statusLink.dispose(); } statusLink = null; } - + public void setSubsequentPage(String subsequentPage) { - - } + + } @Override public void init(ReusableHelpPart parent, String id, IMemento memento) { @@ -158,22 +158,22 @@ public class MissingContentPart extends AbstractFormPart implements IHelpPart { @Override public void stop() { - + } @Override public void toggleRoleFilter() { - + } @Override public void refilter() { - + } - + @Override public void dispose() { disposeLink(); } - + } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java index c6b5a675a..521b3bb09 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/NewEngineWizard.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java index 3cab7b791..1268c2835 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RelatedTopicsPart.java @@ -44,7 +44,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart { private String id; private int VSPACE = 10; - + private static boolean dynamicHelpPreferenceRead = false; private static boolean useDynamicHelp = false; @@ -55,7 +55,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart { boolean flushCache) { Point topSize = contextHelpPart.getControl().computeSize(wHint, hHint, flushCache); - + Point botSize = dynamicHelpPart == null ? new Point(0, 0) : dynamicHelpPart.getControl().computeSize(wHint, hHint, flushCache); @@ -87,7 +87,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart { int bot = dynamicHelpPart == null ? 0 : computeMinimumWidth(dynamicHelpPart, parent, changed); return Math.max(top, bot); } - + private int computeMinimumWidth(IHelpPart part, Composite parent, boolean changed) { ILayoutExtension le = (ILayoutExtension)((Composite)part.getControl()).getLayout(); return le.computeMinimumWidth(parent, changed); @@ -123,22 +123,22 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart { contextHelpPart.init(parent, IHelpUIConstants.HV_CONTEXT_HELP, memento); mform.addPart(contextHelpPart); if (isUseDynamicHelp()) { - dynamicHelpPart.init(parent, IHelpUIConstants.HV_SEARCH_RESULT, memento); + dynamicHelpPart.init(parent, IHelpUIConstants.HV_SEARCH_RESULT, memento); mform.addPart(dynamicHelpPart); } mform.initialize(); } - + @Override public void dispose() { mform.dispose(); } - + public void handleActivation(Control c, IWorkbenchPart wpart) { IContextProvider provider = (wpart == null) ? null : (IContextProvider) wpart.getAdapter(IContextProvider.class); contextHelpPart.handleActivation(provider, null, c, wpart, false); } - + public void setDefaultText(String defaultText) { contextHelpPart.setDefaultText(defaultText); } @@ -227,7 +227,7 @@ public class RelatedTopicsPart extends AbstractFormPart implements IHelpPart { // Preference created in case anyone complains about the removal of // the dynamic help section. This is not API, not documented and may // be removed in a future release. - useDynamicHelp = + useDynamicHelp = Platform.getPreferencesService().getBoolean(HelpBasePlugin.PLUGIN_ID, "show_dynamic_help", false, null); //$NON-NLS-1$ } return useDynamicHelp; diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java index 764f5d7e1..0781498ff 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/RenameDialog.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -35,7 +35,7 @@ public class RenameDialog extends SelectionStatusDialog { private Text text; private IStatus status; private boolean isCaseSensitive; - + /** * Create a new rename dialog instance for the given window. * @param shell The parent of the dialog @@ -47,7 +47,7 @@ public class RenameDialog extends SelectionStatusDialog { initialize(); setOldName(oldName); } - + /** * Create a new rename dialog instance for the given window. * @param shell The parent of the dialog @@ -65,7 +65,7 @@ public class RenameDialog extends SelectionStatusDialog { } setOldName(oldName); } - + public void initialize(){ oldNames = new ArrayList<>(); setStatusLineAboveButtons(true); @@ -74,15 +74,15 @@ public class RenameDialog extends SelectionStatusDialog { public void addOldName(String oldName){ if (!oldNames.contains(oldName)) oldNames.add(oldName); - + } public void setOldName(String oldName) { this.oldName = oldName; - if (text!=null) + if (text!=null) text.setText(oldName); this.newName = oldName; } - + @Override protected Control createDialogArea(Composite parent) { Composite container = new Composite(parent, SWT.NULL); @@ -90,13 +90,13 @@ public class RenameDialog extends SelectionStatusDialog { layout.numColumns = 2; layout.marginHeight = layout.marginWidth = 9; container.setLayout(layout); - + GridData gd = new GridData(GridData.FILL_BOTH); container.setLayoutData(gd); - + Label label = new Label(container, SWT.NULL); - label.setText(Messages.RenameDialog_label); - + label.setText(Messages.RenameDialog_label); + text = new Text(container, SWT.SINGLE|SWT.BORDER); text.addModifyListener(e -> textChanged(text.getText(), true)); gd = new GridData(GridData.FILL_HORIZONTAL); @@ -105,7 +105,7 @@ public class RenameDialog extends SelectionStatusDialog { applyDialogFont(container); return container; } - + @Override public int open() { text.setText(oldName); @@ -114,7 +114,7 @@ public class RenameDialog extends SelectionStatusDialog { textChanged(oldName, false); return super.open(); } - + private void textChanged(String text, boolean setStatus) { Button okButton = getButton(IDialogConstants.OK_ID); for (int i=0; i<oldNames.size(); i++){ @@ -145,7 +145,7 @@ public class RenameDialog extends SelectionStatusDialog { IStatus.ERROR, HelpUIPlugin.PLUGIN_ID, IStatus.ERROR, - errorMessage, + errorMessage, null); updateStatus(status); } @@ -159,7 +159,7 @@ public class RenameDialog extends SelectionStatusDialog { null); updateStatus(status); } - + public String getNewName() { return newName; } @@ -173,7 +173,7 @@ public class RenameDialog extends SelectionStatusDialog { @Override protected void computeResult() { } - + @Override public void setTitle(String title) { getShell().setText(title); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java index 4649ffd1a..856328b3b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -122,7 +122,7 @@ public class ReusableHelpPart implements IHelpUIConstants, private static final int STATE_LT_B = 3; private static final int STATE_LT_BR = 4; - + /* * Used as a bridge from live help actions back (e.g. breadcrumb links) * to the originating help part. @@ -178,7 +178,7 @@ public class ReusableHelpPart implements IHelpUIConstants, private IStatusLineManager statusLineManager; private IActionBars actionBars; - + private EngineDescriptorManager engineManager; public IMenuManager menuManager; @@ -304,7 +304,7 @@ public class ReusableHelpPart implements IHelpUIConstants, private SubActionBars bars; private IToolBarManager subToolBarManager; - + private IMenuManager subMenuManager; protected ArrayList<PartRec> partRecs; @@ -328,7 +328,7 @@ public class ReusableHelpPart implements IHelpUIConstants, subMenuManager = new SubMenuManager( ReusableHelpPart.this.menuManager); } else { - subMenuManager = null; + subMenuManager = null; } } } @@ -345,7 +345,7 @@ public class ReusableHelpPart implements IHelpUIConstants, bars = null; subToolBarManager = null; subMenuManager = null; - } else { + } else { try { ((SubToolBarManager) subToolBarManager).disposeManager(); if (subMenuManager != null) { @@ -413,13 +413,13 @@ public class ReusableHelpPart implements IHelpUIConstants, public PartRec[] getParts() { return partRecs.toArray(new PartRec[partRecs.size()]); } - + public void refreshPage() { PartRec parts[] = getParts(); if (parts==null) return; - + for (int p=0;p<parts.length;p++) if (parts[p]!=null && parts[p].part!=null && parts[p].part.isStale()) parts[p].part.refresh(); @@ -460,7 +460,7 @@ public class ReusableHelpPart implements IHelpUIConstants, rec.part.stop(); } } - + @Override public void saveState(IMemento memento) { for (int i = 0; i < partRecs.size(); i++) { @@ -522,7 +522,7 @@ public class ReusableHelpPart implements IHelpUIConstants, if (pageAction != null) pageAction.setChecked(visible); } - + if (bars != null) { if (visible) bars.activate(); @@ -537,7 +537,7 @@ public class ReusableHelpPart implements IHelpUIConstants, ReusableHelpPart.this.toolBarManager.update(true); getControl().getParent().layout(); } - + } private void hookGlobalAction(String id, IHelpPart part) { @@ -570,7 +570,7 @@ public class ReusableHelpPart implements IHelpUIConstants, for (int focusPart = 0; focusPart < partRecs.size(); focusPart++) { PartRec rec = partRecs.get(focusPart); String partId = rec.part.getId(); - if ( partId != IHelpUIConstants.HV_SEE_ALSO && partId != IHelpUIConstants.HV_MISSING_CONTENT) { + if ( partId != IHelpUIConstants.HV_SEE_ALSO && partId != IHelpUIConstants.HV_MISSING_CONTENT) { rec.part.setFocus(); return; } @@ -693,7 +693,7 @@ public class ReusableHelpPart implements IHelpUIConstants, return HelpBasePlugin.getActivitySupport().isEnabled(href); } } - + class UAFilter extends ViewerFilter { @Override @@ -723,7 +723,7 @@ public class ReusableHelpPart implements IHelpUIConstants, public static ReusableHelpPart getLastActiveInstance() { return lastActiveInstance; } - + private void ensureHelpIndexed() { // make sure we have the index but // don't schedule the indexer job if one is @@ -734,20 +734,20 @@ public class ReusableHelpPart implements IHelpUIConstants, indexerJob.schedule(); } } - + /** * Adds the given page to this part. - * + * * @param page the page to add */ public void addPage(IHelpPartPage page) { - pages.add(page); + pages.add(page); } - + /** * Adds the given part to this one. The part can then be used inside * any page and referred to by id. - * + * * @param id the part's unique id * @param part the part to add */ @@ -755,10 +755,10 @@ public class ReusableHelpPart implements IHelpUIConstants, part.init(this, id, memento); mform.addPart(part); } - + /** * Creates a new page for this part. - * + * * @param id the page's unique id * @param text the page's heading, or null for none * @param iconId the page's icon @@ -767,7 +767,7 @@ public class ReusableHelpPart implements IHelpUIConstants, public IHelpPartPage createPage(String id, String text, String iconId) { return new HelpPartPage(id, text, iconId); } - + private void definePages() { pages = new ArrayList<>(); // federated search page @@ -784,7 +784,7 @@ public class ReusableHelpPart implements IHelpUIConstants, // all topics page page = new HelpPartPage(HV_ALL_TOPICS_PAGE, Messages.ReusableHelpPart_allTopicsPage_name, - IHelpUIConstants.IMAGE_ALL_TOPICS); + IHelpUIConstants.IMAGE_ALL_TOPICS); page.setVerticalSpacing(0); page.setHorizontalMargin(0); page.addPart(HV_SEE_ALSO, false); @@ -795,8 +795,8 @@ public class ReusableHelpPart implements IHelpUIConstants, // bookmarks page page = new HelpPartPage(HV_BOOKMARKS_PAGE, - Messages.ReusableHelpPart_bookmarksPage_name, - IHelpUIConstants.IMAGE_BOOKMARKS); + Messages.ReusableHelpPart_bookmarksPage_name, + IHelpUIConstants.IMAGE_BOOKMARKS); page.setVerticalSpacing(0); page.setHorizontalMargin(0); page.addPart(HV_SEE_ALSO, false); @@ -813,7 +813,7 @@ public class ReusableHelpPart implements IHelpUIConstants, // context help page page = new HelpPartPage(HV_CONTEXT_HELP_PAGE, Messages.ReusableHelpPart_contextHelpPage_name, - IHelpUIConstants.IMAGE_RELATED_TOPICS); + IHelpUIConstants.IMAGE_RELATED_TOPICS); // page.addPart(HV_CONTEXT_HELP, false); // page.addPart(HV_SEARCH_RESULT, false, true); page.setVerticalSpacing(0); @@ -826,7 +826,7 @@ public class ReusableHelpPart implements IHelpUIConstants, // index page page = new HelpPartPage(HV_INDEX_PAGE, Messages.ReusableHelpPart_indexPage_name, - IHelpUIConstants.IMAGE_INDEX); + IHelpUIConstants.IMAGE_INDEX); page.setVerticalSpacing(0); page.addPart(HV_SEE_ALSO, false); page.addPart(HV_MISSING_CONTENT, false); @@ -862,8 +862,8 @@ public class ReusableHelpPart implements IHelpUIConstants, .getSharedImages().getImageDescriptor( ISharedImages.IMG_TOOL_BACK_DISABLED)); backAction.setEnabled(false); - backAction.setText(Messages.ReusableHelpPart_back_label); - backAction.setToolTipText(Messages.ReusableHelpPart_back_tooltip); + backAction.setText(Messages.ReusableHelpPart_back_label); + backAction.setToolTipText(Messages.ReusableHelpPart_back_tooltip); backAction.setId("back"); //$NON-NLS-1$ nextAction = new Action("next") { //$NON-NLS-1$ @@ -873,7 +873,7 @@ public class ReusableHelpPart implements IHelpUIConstants, doNext(); } }; - nextAction.setText(Messages.ReusableHelpPart_forward_label); + nextAction.setText(Messages.ReusableHelpPart_forward_label); nextAction.setImageDescriptor(PlatformUI.getWorkbench() .getSharedImages().getImageDescriptor( ISharedImages.IMG_TOOL_FORWARD)); @@ -881,7 +881,7 @@ public class ReusableHelpPart implements IHelpUIConstants, .getSharedImages().getImageDescriptor( ISharedImages.IMG_TOOL_FORWARD_DISABLED)); nextAction.setEnabled(false); - nextAction.setToolTipText(Messages.ReusableHelpPart_forward_tooltip); + nextAction.setToolTipText(Messages.ReusableHelpPart_forward_tooltip); nextAction.setId("next"); //$NON-NLS-1$ toolBarManager.add(backAction); toolBarManager.add(nextAction); @@ -894,7 +894,7 @@ public class ReusableHelpPart implements IHelpUIConstants, } }; openInfoCenterAction - .setText(Messages.ReusableHelpPart_openInfoCenterAction_label); + .setText(Messages.ReusableHelpPart_openInfoCenterAction_label); openAction = new OpenHrefAction("open") { //$NON-NLS-1$ @Override @@ -902,7 +902,7 @@ public class ReusableHelpPart implements IHelpUIConstants, doOpen(getTarget(), getShowDocumentsInPlace()); } }; - openAction.setText(Messages.ReusableHelpPart_openAction_label); + openAction.setText(Messages.ReusableHelpPart_openAction_label); openInHelpAction = new OpenHrefAction("") {//$NON-NLS-1$ @Override @@ -911,9 +911,9 @@ public class ReusableHelpPart implements IHelpUIConstants, } }; openInHelpAction - .setText(Messages.ReusableHelpPart_openInHelpContentsAction_label); + .setText(Messages.ReusableHelpPart_openInHelpContentsAction_label); copyAction = new CopyAction(); - copyAction.setText(Messages.ReusableHelpPart_copyAction_label); + copyAction.setText(Messages.ReusableHelpPart_copyAction_label); bookmarkAction = new OpenHrefAction("bookmark") { //$NON-NLS-1$ @Override @@ -921,12 +921,12 @@ public class ReusableHelpPart implements IHelpUIConstants, doBookmark(getTarget()); } }; - bookmarkAction.setText(Messages.ReusableHelpPart_bookmarkAction_label); + bookmarkAction.setText(Messages.ReusableHelpPart_bookmarkAction_label); bookmarkAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_ADD_BOOKMARK)); if (actionBars != null && actionBars.getMenuManager() != null) contributeToDropDownMenu(actionBars.getMenuManager()); - + roleFilter = new RoleFilter(); uaFilter = new UAFilter(); if (HelpBasePlugin.getActivitySupport().isUserCanToggleFiltering()) { @@ -941,7 +941,7 @@ public class ReusableHelpPart implements IHelpUIConstants, showAllAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_SHOW_ALL)); showAllAction - .setToolTipText(Messages.AllTopicsPart_showAll_tooltip); + .setToolTipText(Messages.AllTopicsPart_showAll_tooltip); toolBarManager.insertBefore("back", showAllAction); //$NON-NLS-1$ toolBarManager.insertBefore("back", new Separator()); //$NON-NLS-1$ showAllAction.setChecked(!HelpBasePlugin.getActivitySupport() @@ -962,7 +962,7 @@ public class ReusableHelpPart implements IHelpUIConstants, // pages is null when the activity manager listener is added, and is set to null // prior to the activity manager listener being removed, so very short timeframes in // logic where pages could equals null entering this method - if (pages != null){ + if (pages != null){ for (int i = 0; i < pages.size(); i++) { HelpPartPage page = (HelpPartPage) pages.get(i); page.refilter(); @@ -1029,7 +1029,7 @@ public class ReusableHelpPart implements IHelpUIConstants, BrowserPart part = (BrowserPart) findPart(IHelpUIConstants.HV_BROWSER); part.clearBrowser(); } - + HelpPartPage page = findPage(id); if (page != null) { page.refreshPage(); @@ -1160,7 +1160,7 @@ public class ReusableHelpPart implements IHelpUIConstants, /* * (non-Javadoc) - * + * * @see org.eclipse.ui.internal.intro.impl.parts.IStandbyContentPart#setFocus() */ public void setFocus() { @@ -1180,7 +1180,7 @@ public class ReusableHelpPart implements IHelpUIConstants, * @param context * @param part * @param control - * @param isExplicitRequest is true if this is the result of a direct user request such as + * @param isExplicitRequest is true if this is the result of a direct user request such as * pressing F1 and false if it is in response to a focus change listener */ public void update(IContextProvider provider, IContext context, IWorkbenchPart part, @@ -1230,7 +1230,7 @@ public class ReusableHelpPart implements IHelpUIConstants, part = new MissingContentPart(parent, mform.getToolkit()); } if (part != null) { - mform.addPart(part); + mform.addPart(part); part.init(this, id, memento); } return part; @@ -1293,7 +1293,7 @@ public class ReusableHelpPart implements IHelpUIConstants, } private boolean openInternalBrowser(String url) { - String openMode = Platform.getPreferencesService().getString(HelpBasePlugin.PLUGIN_ID, + String openMode = Platform.getPreferencesService().getString(HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_HELP_VIEW_OPEN_MODE, IHelpBaseConstants.P_IN_PLACE, null); boolean openInEditor = IHelpBaseConstants.P_IN_EDITOR.equals(openMode); boolean openInBrowser = IHelpBaseConstants.P_IN_BROWSER.equals(openMode); @@ -1329,9 +1329,9 @@ public class ReusableHelpPart implements IHelpUIConstants, aurl = aurl.substring(0, aurl.length() - 14); DefaultHelpUI.showInWorkbenchBrowser(aurl, false); */ - + PlatformUI.getWorkbench().getHelpSystem().displayHelpResource(aurl); - + } catch (Exception e) { HelpUIPlugin.logError("Error opening browser", e); //$NON-NLS-1$ } @@ -1672,7 +1672,7 @@ public class ReusableHelpPart implements IHelpUIConstants, mng.setMessage(null); } - + private void toggleShowAll(boolean checked) { if (checked) { @@ -1698,7 +1698,7 @@ public class ReusableHelpPart implements IHelpUIConstants, page.toggleRoleFilter(); } } - + public void saveState(IMemento memento) { for (int i = 0; i < pages.size(); i++) { HelpPartPage page = (HelpPartPage) pages.get(i); @@ -1743,7 +1743,7 @@ public class ReusableHelpPart implements IHelpUIConstants, } return buff.toString(); } - + EngineDescriptorManager getEngineManager() { if (engineManager==null) { engineManager = new EngineDescriptorManager(); @@ -1772,9 +1772,9 @@ public class ReusableHelpPart implements IHelpUIConstants, clearBrowser(); showURL("/org.eclipse.help.webapp/" + MissingContentManager.MISSING_BOOKS_HELP_VIEW_HREF); //$NON-NLS-1$ updateStatusLinks(); - + } - + private void clearBrowser() { IHelpPart part = findPart(HV_BROWSER); if ( part == null ) { diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPartHistory.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPartHistory.java index 0b90e4e4c..5fd60115b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPartHistory.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ReusableHelpPartHistory.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -24,7 +24,7 @@ public class ReusableHelpPartHistory { public void addEntry(HistoryEntry entry) { if (cursor!= -1) { - // If we are adding a new entry while + // If we are adding a new entry while // the cursor is not at the end, discard // all the entries after the cursor. int extra = queue.size()-1 -cursor; @@ -47,11 +47,11 @@ public class ReusableHelpPartHistory { public boolean hasPrev() { return cursor != -1 && cursor > 0; } - + public HistoryEntry getNext() { return hasNext()?(HistoryEntry)queue.get(cursor+1):null; } - + public HistoryEntry getPrev() { return hasPrev() ? (HistoryEntry)queue.get(cursor-1):null; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java index a2e5699d6..ed3b7994b 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceDialog.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -33,7 +33,7 @@ import org.eclipse.swt.widgets.Shell; public class ScopePreferenceDialog extends PreferenceDialog { private EngineDescriptorManager descManager; private ArrayList<PendingOperation> pendingOperations; - + class PendingOperation { int action; EngineDescriptor desc; @@ -51,7 +51,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { * The Remove button id. */ private final static int DELETE_ID = IDialogConstants.CLIENT_ID + 2; - + public ScopePreferenceDialog(Shell parentShell, PreferenceManager manager, EngineDescriptorManager descManager, boolean editable) { super(parentShell, manager); this.descManager = descManager; @@ -69,10 +69,10 @@ public class ScopePreferenceDialog extends PreferenceDialog { gd.horizontalSpan = 2; treeControl.setLayoutData(gd); - Button lbutton = createButton(container, NEW_ID, Messages.ScopePreferenceDialog_new, false); + Button lbutton = createButton(container, NEW_ID, Messages.ScopePreferenceDialog_new, false); gd = (GridData)lbutton.getLayoutData(); gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING; - Button rbutton = createButton(container, DELETE_ID, Messages.ScopePreferenceDialog_delete, false); + Button rbutton = createButton(container, DELETE_ID, Messages.ScopePreferenceDialog_delete, false); rbutton.setEnabled(false); gd = (GridData)rbutton.getLayoutData(); gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_BEGINNING; @@ -82,7 +82,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { treeGd.widthHint = Math.max(treeGd.widthHint, size.x); return container; } - + @Override protected TreeViewer createTreeViewer(Composite parent) { TreeViewer viewer = super.createTreeViewer(parent); @@ -93,7 +93,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { }); return viewer; } - + @Override protected void buttonPressed(int buttonId) { switch (buttonId) { @@ -107,7 +107,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { super.buttonPressed(buttonId); } } - + private void treeSelectionChanged(Object obj) { boolean removable = false; if (obj instanceof ScopePreferenceManager.EnginePreferenceNode) { @@ -117,7 +117,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { } getButton(DELETE_ID).setEnabled(removable); } - + private void doNew() { NewEngineWizard wizard = new NewEngineWizard(descManager.getEngineTypes()); WizardDialog dialog = new WizardDialog(getShell(), wizard); @@ -147,7 +147,7 @@ public class ScopePreferenceDialog extends PreferenceDialog { scheduleOperation(DELETE_ID, desc); } } - + private void scheduleOperation(int action, EngineDescriptor desc) { if (pendingOperations==null) pendingOperations = new ArrayList<>(); diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java index 32c437cd4..8417cae3c 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopePreferenceManager.java @@ -20,10 +20,10 @@ import org.eclipse.jface.preference.PreferenceManager; import org.eclipse.jface.preference.PreferenceNode; public class ScopePreferenceManager extends PreferenceManager implements IHelpUIConstants { - private ScopeSet set; + private ScopeSet set; class SubpagePreferenceNode extends PreferenceNode { private IConfigurationElement config; - + public SubpagePreferenceNode(String id, String label, IConfigurationElement config) { super(id, label, null, null); @@ -45,7 +45,7 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI } class EnginePreferenceNode extends PreferenceNode { private EngineDescriptor desc; - + public EnginePreferenceNode(EngineDescriptor desc) { super(desc.getId(), desc.getLabel(), desc.getImageDescriptor(), null); this.desc = desc; @@ -64,10 +64,10 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI } } /** - * + * */ public ScopePreferenceManager(EngineDescriptorManager descManager, ScopeSet set) { - this.set = set; + this.set = set; load(descManager.getDescriptors()); } @@ -78,8 +78,8 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI IConfigurationElement [] pages = desc.getPages(); for (int j=0; j<pages.length; j++) { String category = pages[i].getAttribute(ATT_CATEGORY); - addNode(category, pages[i].getAttribute(ATT_ID), - pages[i].getAttribute(ATT_LABEL), + addNode(category, pages[i].getAttribute(ATT_ID), + pages[i].getAttribute(ATT_LABEL), pages[i]); } } @@ -95,5 +95,5 @@ public class ScopePreferenceManager extends PreferenceManager implements IHelpUI if (parent!=null) parent.add(node); return node; - } + } } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java index 123a04f72..8f9021e49 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSelectPart.java @@ -32,8 +32,8 @@ import org.eclipse.ui.forms.widgets.TableWrapData; import org.eclipse.ui.forms.widgets.TableWrapLayout; public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { - - + + public class ScopeObserver implements Observer { @Override @@ -49,14 +49,14 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { private String id; private ScopeObserver scopeObserver; - public ScopeSelectPart(Composite parent, FormToolkit toolkit) { + public ScopeSelectPart(Composite parent, FormToolkit toolkit) { container = toolkit.createComposite(parent); TableWrapLayout layout = new TableWrapLayout(); layout.numColumns = 1; container.setLayout(layout); ScopeSetManager scopeSetManager = ScopeState.getInstance().getScopeSetManager(); String name = scopeSetManager.getActiveSet().getName(); - scopeSetLink = toolkit.createFormText(container, false); + scopeSetLink = toolkit.createFormText(container, false); setScopeLink(name); scopeSetLink.addHyperlinkListener(new HyperlinkAdapter() { @@ -70,13 +70,13 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { td.valign = TableWrapData.MIDDLE; scopeSetLink.setLayoutData(td); scopeObserver = new ScopeObserver(); - scopeSetManager.addObserver(scopeObserver); + scopeSetManager.addObserver(scopeObserver); } - + private void doChangeScopeSet() { ScopeSetManager scopeSetManager = ScopeState.getInstance().getScopeSetManager(); - ScopeSetDialog dialog = new ScopeSetDialog(container.getShell(), - scopeSetManager, + ScopeSetDialog dialog = new ScopeSetDialog(container.getShell(), + scopeSetManager, ScopeState.getInstance().getEngineManager(), true); dialog.setInput(scopeSetManager); dialog.create(); @@ -90,7 +90,7 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { scopeSetManager.notifyObservers(); } } - + private void setActiveScopeSet(ScopeSet set) { setScopeLink(set.getName()); ScopeState.getInstance().getScopeSetManager().setActiveSet(set); @@ -106,7 +106,7 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { nameBuff.append(Messages.FederatedSearchPart_changeScopeSet); nameBuff.append("\""); //$NON-NLS-1$ } - + nameBuff.append(">"); //$NON-NLS-1$ nameBuff.append(EscapeUtils.escapeSpecialChars(name )); nameBuff.append(" </a><b>"); //$NON-NLS-1$ @@ -159,19 +159,19 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { @Override public void stop() { - + } @Override public void toggleRoleFilter() { - + } @Override public void refilter() { - + } - + @Override public void dispose() { if (scopeObserver != null) { @@ -179,5 +179,5 @@ public class ScopeSelectPart extends AbstractFormPart implements IHelpPart { } super.dispose(); } - + } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSet.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSet.java index e0c3db67a..b8d3b44c1 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSet.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSet.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -32,40 +32,40 @@ public class ScopeSet { private PreferenceStore preferenceStore; private boolean needsSaving; private int defaultSet = -1; - + public ScopeSet() { this(Messages.ScopeSet_default); defaultSet = 1; } - + public ScopeSet(String name) { this.needsSaving = true; this.name = name; } - + public boolean isEditable() { return !isDefault(); } - + public boolean isDefault() { if (defaultSet==1) return true; return getPreferenceStore().getBoolean(KEY_DEFAULT); } - + public boolean isImplicit() { return false; } public ScopeSet(ScopeSet set, String name) { - this(name); + this(name); copyFrom(set); } - + public void copyFrom(ScopeSet set) { copy((PreferenceStore)set.getPreferenceStore()); } - + public void dispose() { File file = new File(getFileName(name)); if (file.exists()) @@ -88,7 +88,7 @@ public class ScopeSet { } return preferenceStore; } - + protected String encodeFileName(String name) { return name; } @@ -96,10 +96,10 @@ public class ScopeSet { private String getFileName(String name) { IPath location = HelpUIPlugin.getDefault().getStateLocation(); location = location.append(SCOPE_DIR_NAME); - location = location.append(encodeFileName(name)+getExtension()); + location = location.append(encodeFileName(name)+getExtension()); return location.toOSString(); } - + protected String getExtension() { return EXT; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java index 2720190b3..b800081c2 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetDialog.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -48,8 +48,8 @@ import org.eclipse.ui.PlatformUI; * Scope dialog for federated search. */ public class ScopeSetDialog extends TrayDialog { - - + + public class NonDefaultFilter extends ViewerFilter { @Override @@ -82,7 +82,7 @@ public class ScopeSetDialog extends TrayDialog { private ArrayList<ScopeSet> sets; private ArrayList<PendingOperation> operations; private IStructuredContentProvider contentProvider; - + private Button showAllRadio; private Button showSelectedRadio; @@ -94,7 +94,7 @@ public class ScopeSetDialog extends TrayDialog { private ScopeSet initialSelection; private Object[] result; private boolean localOnly; - + private abstract class PendingOperation { ScopeSet set; public PendingOperation(ScopeSet set) { @@ -103,7 +103,7 @@ public class ScopeSetDialog extends TrayDialog { public abstract void commit(); public abstract void cancel(); } - + private class AddOperation extends PendingOperation { public AddOperation(ScopeSet set) { super(set); @@ -163,7 +163,7 @@ public class ScopeSetDialog extends TrayDialog { public void cancel() { } } - + private class ScopeContentProvider implements IStructuredContentProvider { @Override @@ -179,7 +179,7 @@ public class ScopeSetDialog extends TrayDialog { public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } - + private class ScopeLabelProvider extends LabelProvider { @Override @@ -217,11 +217,11 @@ public class ScopeSetDialog extends TrayDialog { labelProvider = new ScopeLabelProvider(); setInitialSelections( manager.getActiveSet()); } - + private void setInitialSelections(ScopeSet scopeSet) { initialSelection = scopeSet; } - + private ArrayList<ScopeSet> extractSets(ScopeSet[] array) { ArrayList<ScopeSet> list = new ArrayList<>(); for (int i=0; i<array.length; i++) { @@ -229,7 +229,7 @@ public class ScopeSetDialog extends TrayDialog { } return list; } - + @Override protected Control createDialogArea(Composite container) { Composite innerContainer = (Composite)super.createDialogArea(container); @@ -244,20 +244,20 @@ public class ScopeSetDialog extends TrayDialog { viewer.setFilters(filters ); return innerContainer; } - + private void createRadioButtons(Composite parent) { boolean showAll = initialSelection != null && initialSelection.isDefault(); showAllRadio = new Button(parent, SWT.RADIO); showAllRadio.setText(Messages.ScopeSet_selectAll); - + showSelectedRadio = new Button(parent, SWT.RADIO); showSelectedRadio.setText(Messages.ScopeSet_selectWorkingSet); showAllRadio.addSelectionListener(new ShowAllListener()); showAllRadio.setSelection(showAll); showSelectedRadio.setSelection(!showAll); } - - private void createTable(Composite parent) { + + private void createTable(Composite parent) { viewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); viewer.setContentProvider(contentProvider); viewer.setLabelProvider(labelProvider); @@ -265,7 +265,7 @@ public class ScopeSetDialog extends TrayDialog { viewer.addDoubleClickListener(event -> okPressed()); if (initialSelection != null) { viewer.setSelection(new StructuredSelection(initialSelection)); - } + } GridData gd = new GridData(GridData.FILL_BOTH); gd.heightHint = convertHeightInCharsToPixels(heightInChars); gd.widthHint = convertWidthInCharsToPixels(widthInChars); @@ -273,13 +273,13 @@ public class ScopeSetDialog extends TrayDialog { table.setLayoutData(gd); table.setFont(parent.getFont()); } - + private void enableTable() { if (viewer != null) { boolean showSelected = showSelectedRadio.getSelection(); viewer.getTable().setEnabled(showSelected); viewer.refresh(); - // Ensure that a scope is selected unless there are no + // Ensure that a scope is selected unless there are no // user defined scopes if (showSelected && viewer.getSelection().isEmpty()) { Object firstElement = viewer.getElementAt(0); @@ -289,7 +289,7 @@ public class ScopeSetDialog extends TrayDialog { } } } - + private void createEditingButtons(Composite composite) { Composite buttonComposite= new Composite(composite, SWT.RIGHT); GridLayout layout= new GridLayout(); @@ -298,19 +298,19 @@ public class ScopeSetDialog extends TrayDialog { GridData data= new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.GRAB_HORIZONTAL); data.grabExcessHorizontalSpace= true; composite.setData(data); - createButton(buttonComposite, NEW_ID, Messages.ScopeSetDialog_new, false); - renameButton = createButton(buttonComposite, RENAME_ID, Messages.ScopeSetDialog_rename, false); - editButton = createButton(buttonComposite, EDIT_ID, Messages.ScopeSetDialog_edit, false); - removeButton = createButton(buttonComposite, REMOVE_ID, Messages.ScopeSetDialog_remove, false); + createButton(buttonComposite, NEW_ID, Messages.ScopeSetDialog_new, false); + renameButton = createButton(buttonComposite, RENAME_ID, Messages.ScopeSetDialog_rename, false); + editButton = createButton(buttonComposite, EDIT_ID, Messages.ScopeSetDialog_edit, false); + removeButton = createButton(buttonComposite, REMOVE_ID, Messages.ScopeSetDialog_remove, false); updateButtons(); } - + public ScopeSet getActiveSet() { if (result!=null && result.length>0) return (ScopeSet)result[0]; return null; } - + @Override protected void okPressed() { if (operations!=null) { @@ -330,7 +330,7 @@ public class ScopeSetDialog extends TrayDialog { } super.okPressed(); } - + private void setResult(ScopeSet scope) { result = new Object[] { scope }; } @@ -343,7 +343,7 @@ public class ScopeSetDialog extends TrayDialog { newResult.toArray(result); } } - + @Override protected void cancelPressed() { if (operations!=null) { @@ -355,7 +355,7 @@ public class ScopeSetDialog extends TrayDialog { } super.cancelPressed(); } - + @Override protected void buttonPressed(int buttonId) { switch (buttonId) { @@ -375,7 +375,7 @@ public class ScopeSetDialog extends TrayDialog { } super.buttonPressed(buttonId); } - + private void doNew() { ScopeSet newSet = new ScopeSet(getDefaultName()); String name = getNewName(newSet.getName(), false); @@ -388,7 +388,7 @@ public class ScopeSetDialog extends TrayDialog { updateButtons(); } } - + private String getDefaultName() { Set<String> namesInUse = new HashSet<>(); for (int i=0; i<sets.size(); i++) { @@ -396,7 +396,7 @@ public class ScopeSetDialog extends TrayDialog { namesInUse.add(set.getName().toLowerCase()); } for (int i = 1; i < 1000; i++) { - String name = Messages.ScopeSetDialog_defaultName + i; + String name = Messages.ScopeSetDialog_defaultName + i; if (!namesInUse.contains(name.toLowerCase())) { return name; } @@ -412,15 +412,15 @@ public class ScopeSetDialog extends TrayDialog { return; } PreferenceManager manager = new ScopePreferenceManager(descManager, set); - - if (!localOnly) { + + if (!localOnly) { PreferenceDialog dialog = new ScopePreferenceDialog(getShell(), manager, descManager, set.isEditable()); dialog.setPreferenceStore(set.getPreferenceStore()); dialog.create(); dialog.getShell().setText(NLS.bind(Messages.ScopePreferenceDialog_wtitle, set.getName())); dialog.open(); } else { - LocalScopeDialog localDialog = new LocalScopeDialog(getShell(), manager, descManager, set); + LocalScopeDialog localDialog = new LocalScopeDialog(getShell(), manager, descManager, set); localDialog.create(); localDialog.getShell().setText(NLS.bind(Messages.ScopePreferenceDialog_wtitle, set.getName())); localDialog.open(); @@ -437,7 +437,7 @@ public class ScopeSetDialog extends TrayDialog { if (newName!=null) { if (rop!=null) rop.newName = newName; - else + else scheduleOperation(new RenameOperation(set, newName)); viewer.update(set, null); updateButtons(); @@ -454,13 +454,13 @@ public class ScopeSetDialog extends TrayDialog { dialog.create(); String dialogTitle = isRename ? Messages.RenameDialog_wtitle : Messages.NewDialog_wtitle; - dialog.getShell().setText(dialogTitle); + dialog.getShell().setText(dialogTitle); if (dialog.open()==RenameDialog.OK) { return dialog.getNewName(); } return null; } - + private void doRemove() { IStructuredSelection ssel = (IStructuredSelection)viewer.getSelection(); ScopeSet set = (ScopeSet)ssel.getFirstElement(); @@ -472,17 +472,17 @@ public class ScopeSetDialog extends TrayDialog { Object element = viewer.getElementAt(0); if (element != null) { viewer.setSelection(new StructuredSelection(element)); - } + } updateButtons(); } } - + private void scheduleOperation(PendingOperation op) { if (operations==null) operations = new ArrayList<>(); operations.add(op); } - + private void updateButtons() { IStructuredSelection ssel = (IStructuredSelection)viewer.getSelection(); editButton.setEnabled(ssel.isEmpty()==false); @@ -491,7 +491,7 @@ public class ScopeSetDialog extends TrayDialog { removeButton.setEnabled(editableSet); renameButton.setEnabled(editableSet); } - + private PendingOperation findOperation(ScopeSet set, Class<?> type) { if (operations!=null) { for (int i=0; i<operations.size(); i++) { @@ -506,6 +506,6 @@ public class ScopeSetDialog extends TrayDialog { } public void setInput(ScopeSetManager scopeSetManager) { - input = scopeSetManager; - } + input = scopeSetManager; + } } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java index a2732d6af..6a018e9e0 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeSetManager.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -113,7 +113,7 @@ public class ScopeSetManager extends Observable { for (int i = 0; i < files.length; i++) { File file = files[i]; String name = file.getName(); - int loc = name.lastIndexOf(ScopeSet.EXT); + int loc = name.lastIndexOf(ScopeSet.EXT); if (loc != -1) { ScopeSet set = new ScopeSet(name.substring(0, loc)); sets.add(set); @@ -121,7 +121,7 @@ public class ScopeSetManager extends Observable { defSet = set; continue; } - loc = name.lastIndexOf(HistoryScopeSet.EXT); + loc = name.lastIndexOf(HistoryScopeSet.EXT); if (loc != -1) { HistoryScopeSet set = new HistoryScopeSet(name.substring(0, loc), null); @@ -138,7 +138,7 @@ public class ScopeSetManager extends Observable { } } - + public ScopeSet getDefaultScope() { return defSet; } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeState.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeState.java index 4b99bd111..e559c19cb 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeState.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ScopeState.java @@ -12,20 +12,20 @@ package org.eclipse.help.ui.internal.views; public class ScopeState { - + private static ScopeState instance; private ScopeSetManager scopeSetManager; private EngineDescriptorManager engineManager; - - public static synchronized ScopeState getInstance() { + + public static synchronized ScopeState getInstance() { if ( instance == null ) { instance = new ScopeState(); } return instance; } - - private ScopeState() { + + private ScopeState() { scopeSetManager = new ScopeSetManager(); } @@ -40,5 +40,5 @@ public class ScopeState { public void setEngineManager(EngineDescriptorManager engineManager) { this.engineManager = engineManager; } - + } diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java index 4264433c2..997c3aada 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchPart.java @@ -63,7 +63,7 @@ import org.eclipse.ui.forms.widgets.TableWrapLayout; public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUIConstants { - + public class SearchScopeObserver implements Observer { @Override @@ -255,11 +255,11 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo shellDefaultButton = null; } }); - + createScopeSection(toolkit); - + // createAlternateQueriesSection(toolkit); - + toolkit.paintBordersFor(container); jobListener = new JobListener(); Job.getJobManager().addJobChangeListener(jobListener); @@ -284,7 +284,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo scopeObserver = new SearchScopeObserver(); scopeSetManager.addObserver(scopeObserver); } - + private void createSearchExpressionSection(FormToolkit toolkit) { TableWrapData td; Section searchExpressionSection = toolkit.createSection(container, Section.TWISTIE | Section.COMPACT @@ -312,7 +312,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo updateSearchWordText(); toolkit.paintBordersFor(detailGroup); } - + private void createAlternateQueriesSection(FormToolkit toolkit){ TableWrapData td = new TableWrapData(); @@ -320,12 +320,12 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo td.align = TableWrapData.FILL; container.setMenu(new Menu(container)); - + alternateQuerySection = toolkit.createSection(container, Section.TWISTIE | Section.COMPACT | Section.LEFT_TEXT_CLIENT_ALIGNMENT); alternateQuerySection.setLayoutData(td); alternateQuerySection.setText(Messages.AlternateQueries); - + alternateQueryComposite = toolkit.createComposite(alternateQuerySection); alternateQuerySection.setClient(alternateQueryComposite); TableWrapLayout flayout = new TableWrapLayout(); @@ -335,7 +335,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo // alternateQuerySection.setVisible(false); } - + private void createAdvancedLink(Composite parent, FormToolkit toolkit) { advancedLink = toolkit.createHyperlink(parent, Messages.FederatedSearchPart_advanced, SWT.NULL); advancedLink.addHyperlinkListener(new HyperlinkAdapter() { @@ -623,10 +623,10 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo } }); } - } + } } }); - } + } } @Override @@ -735,7 +735,7 @@ public class SearchPart extends AbstractFormPart implements IHelpPart, IHelpUICo searchPending = false; doSearch(searchWordCombo.getText()); } - + } @Override diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java index dcf0cef28..c0dbf7781 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SearchResultsPart.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -110,7 +110,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { results = new ArrayList<>(); contributeToToolBar(tbm); } - + void updateSeparatorVisibility() { ScrollBar scrollBar = innerForm.getVerticalBar(); separator.setVisible(scrollBar.getSelection()>0); @@ -127,9 +127,9 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { */ boolean descOn = Platform.getPreferencesService().getBoolean - (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_SHOW_SEARCH_DESCRIPTION, false, null); + (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_SHOW_SEARCH_DESCRIPTION, false, null); boolean showCategories = Platform.getPreferencesService().getBoolean - (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_SHOW_SEARCH_CATEGORIES, false, null); + (HelpBasePlugin.PLUGIN_ID, IHelpBaseConstants.P_KEY_SHOW_SEARCH_CATEGORIES, false, null); showCategoriesAction = new Action() { @Override @@ -146,7 +146,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { showCategoriesAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_SHOW_CATEGORIES)); showCategoriesAction.setChecked(showCategories); - showCategoriesAction.setToolTipText(Messages.SearchResultsPart_showCategoriesAction_tooltip); + showCategoriesAction.setToolTipText(Messages.SearchResultsPart_showCategoriesAction_tooltip); showCategoriesAction.setId("categories"); //$NON-NLS-1$ tbm.insertBefore("back", showCategoriesAction); //$NON-NLS-1$ @@ -166,7 +166,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { showDescriptionAction.setImageDescriptor(HelpUIResources .getImageDescriptor(IHelpUIConstants.IMAGE_SHOW_DESC)); showDescriptionAction.setChecked(descOn); - showDescriptionAction.setToolTipText(Messages.SearchResultsPart_showDescriptionAction_tooltip); + showDescriptionAction.setToolTipText(Messages.SearchResultsPart_showDescriptionAction_tooltip); showDescriptionAction.setId("description"); //$NON-NLS-1$ tbm.insertAfter("categories", showDescriptionAction); //$NON-NLS-1$ tbm.insertAfter("description", new Separator()); //$NON-NLS-1$ @@ -216,7 +216,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { public void setVisible(boolean visible) { container.setVisible(visible); } - + void clearResults() { clearResultSections(); separator.setVisible(false); @@ -247,7 +247,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { } reflow(); } - + private EngineDescriptor findLocalHelp(ArrayList<EngineDescriptor> eds) { for (int i=0; i<eds.size(); i++) { EngineDescriptor ed = eds.get(i); @@ -256,14 +256,14 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { } return null; } - + void completed() { for (int i = 0; i < results.size(); i++) { EngineResultSection section = results.get(i); section.completed(); } } - + void canceling() { for (int i = 0; i < results.size(); i++) { EngineResultSection section = results.get(i); @@ -279,7 +279,7 @@ public class SearchResultsPart extends AbstractFormPart implements IHelpPart { } else parent.showURL(url); } - + void doCategoryLink(String href) { parent.showPage(IHelpUIConstants.HV_ALL_TOPICS_PAGE); AllTopicsPart part = (AllTopicsPart) parent diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java index c30697211..8185bb963 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SeeAlsoPart.java @@ -68,7 +68,7 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart { rlayout.justify = false; rlayout.wrap = true; linkContainer.setLayout(rlayout); - + hyperlinkGroup = new HyperlinkGroup(container.getDisplay()); hyperlinkGroup.setHyperlinkUnderlineMode(toolkit.getHyperlinkGroup().getHyperlinkUnderlineMode()); } @@ -84,7 +84,7 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart { } else { link.setFont(JFaceResources.getDefaultFont()); } - data.exclude = false; + data.exclude = false; link.setVisible(!data.exclude); } linkContainer.layout(); @@ -101,24 +101,24 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart { } }; if ((helpPart.getStyle() & ReusableHelpPart.ALL_TOPICS) != 0) - addPageLink(container, toolkit, Messages.SeeAlsoPart_allTopics, IHelpUIConstants.HV_ALL_TOPICS_PAGE, + addPageLink(container, toolkit, Messages.SeeAlsoPart_allTopics, IHelpUIConstants.HV_ALL_TOPICS_PAGE, IHelpUIConstants.IMAGE_ALL_TOPICS, listener); if ((helpPart.getStyle() & ReusableHelpPart.SEARCH) != 0) { - addPageLink(container, toolkit, Messages.SeeAlsoPart_search, IHelpUIConstants.HV_FSEARCH_PAGE, + addPageLink(container, toolkit, Messages.SeeAlsoPart_search, IHelpUIConstants.HV_FSEARCH_PAGE, IHelpUIConstants.IMAGE_HELP_SEARCH, listener); } if ((helpPart.getStyle() & ReusableHelpPart.CONTEXT_HELP) != 0) { - addPageLink(container, toolkit, Messages.SeeAlsoPart_contextHelp, + addPageLink(container, toolkit, Messages.SeeAlsoPart_contextHelp, IHelpUIConstants.HV_CONTEXT_HELP_PAGE, IHelpUIConstants.IMAGE_RELATED_TOPICS, listener); } if ((helpPart.getStyle() & ReusableHelpPart.BOOKMARKS) != 0) { - addPageLink(container, toolkit, Messages.SeeAlsoPart_bookmarks, + addPageLink(container, toolkit, Messages.SeeAlsoPart_bookmarks, IHelpUIConstants.HV_BOOKMARKS_PAGE, IHelpUIConstants.IMAGE_BOOKMARKS, listener); } if ((helpPart.getStyle() & ReusableHelpPart.INDEX) != 0) { - addPageLink(container, toolkit, Messages.SeeAlsoPart_index, + addPageLink(container, toolkit, Messages.SeeAlsoPart_index, IHelpUIConstants.HV_INDEX_PAGE, IHelpUIConstants.IMAGE_INDEX, listener); } @@ -183,7 +183,7 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart { bgImage.dispose(); } } - + @Override public boolean fillContextMenu(IMenuManager manager) { return false; @@ -222,8 +222,8 @@ public class SeeAlsoPart extends AbstractFormPart implements IHelpPart { @Override public void saveState(IMemento memento) { - } - + } + @Override public void setFocus() { if (linkContainer!=null) diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java index 115a6cd03..b4a5bf9c4 100644 --- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java +++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/SorterByScore.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ diff --git a/org.eclipse.ui.intro.quicklinks/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.ui.intro.quicklinks/.settings/org.eclipse.jdt.ui.prefs index 30342114f..7ef179682 100644 --- a/org.eclipse.ui.intro.quicklinks/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.ui.intro.quicklinks/.settings/org.eclipse.jdt.ui.prefs @@ -1,6 +1,63 @@ -#Sat Nov 12 22:58:47 EST 2005 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_UA formatter_settings_version=9 internal.default.compliance=user org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/QuicklinksViewer.java b/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/QuicklinksViewer.java index 23283bb28..3588e455c 100644 --- a/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/QuicklinksViewer.java +++ b/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/QuicklinksViewer.java @@ -4,7 +4,7 @@ * 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: * Manumitting Technologies Inc - initial API and implementation *******************************************************************************/ @@ -70,7 +70,7 @@ import org.osgi.framework.FrameworkUtil; * from an extension point. The appearance of these quicklinks is normally taken * from the command metadata, including the image icon, but can be tailored. * These tailorings can be made optional depending on the current theme. - * + * * This implementation is still experimental and subject to change. Feedback * welcome as a <a href="http://eclip.se/9f">bug report on the Eclipse Bugzilla * against Platform/User Assistance</a>. @@ -160,7 +160,7 @@ public class QuicklinksViewer implements IIntroContentProvider { /** * Return the list of configured {@link Quicklink} that can be found. - * + * * @return */ public List<Quicklink> get() { @@ -177,7 +177,7 @@ public class QuicklinksViewer implements IIntroContentProvider { } } } - + for (IExtension ext : extensions) { if (productBundle == null || !productBundle.getSymbolicName().equals(ext.getNamespaceIdentifier())) { for (IConfigurationElement ce : ext.getConfigurationElements()) { @@ -247,7 +247,7 @@ public class QuicklinksViewer implements IIntroContentProvider { /** * Find {@link Quicklink}s whose {@code commandSpec} matches the simple * wildcard pattern in {@code commandSpecPattern} - * + * * @param commandSpecPattern * a simple wildcard pattern supporting *, ? * @return the set of matching Quicklinks @@ -326,7 +326,7 @@ public class QuicklinksViewer implements IIntroContentProvider { /** * Find the current Welcome/Intro identifier - * + * * @return the current identifier or {@code null} if no theme */ protected String getCurrentThemeId() { @@ -396,7 +396,7 @@ public class QuicklinksViewer implements IIntroContentProvider { * Rewrite or possible extract the icon at the given URL to a stable URL * that can be embedded in HTML and rendered in a browser. May create * temporary files that will be cleaned up on exit. - * + * * @param iconURL * @return stable URL */ @@ -425,7 +425,7 @@ public class QuicklinksViewer implements IIntroContentProvider { /** * Write out the image as a data: URL if possible or to the file-system. - * + * * @param descriptor * @return URL with the resulting image */ @@ -496,7 +496,7 @@ public class QuicklinksViewer implements IIntroContentProvider { * Attempt to populate common fields given other information. For commands, * we look up information in the ICommandService and ICommandImageService. * Return false if this quicklink cannot be found and should not be shown. - * + * * @return true if should be included */ private boolean populateQuicklink(Quicklink ql) { diff --git a/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/URLLabelProvider.java b/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/URLLabelProvider.java index 20ec3abd1..8ba05557a 100644 --- a/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/URLLabelProvider.java +++ b/org.eclipse.ui.intro.quicklinks/src/org/eclipse/ui/intro/quicklinks/URLLabelProvider.java @@ -4,7 +4,7 @@ * 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: * Manumitting Technologies Inc - initial API and implementation *******************************************************************************/ diff --git a/org.eclipse.ui.intro.universal/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.ui.intro.universal/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..3f3352a58 --- /dev/null +++ b/org.eclipse.ui.intro.universal/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,59 @@ +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/BaseData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/BaseData.java index 82ec33ae1..a022398b1 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/BaseData.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/BaseData.java @@ -24,7 +24,7 @@ public abstract class BaseData { public GroupData getParent() { return parent; } - + public abstract void write(PrintWriter writer, String indent); public String getId() { diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java index 9a404f434..2f4d9ab02 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationContentsArea.java @@ -266,7 +266,7 @@ public class CustomizationContentsArea { sel = null; } } - + CustomizationContentsArea() { } @@ -349,7 +349,7 @@ public class CustomizationContentsArea { } return super.getText(obj); } - + @Override public Image getImage(Object obj) { if (obj instanceof ExtensionData) { @@ -397,7 +397,7 @@ public class CustomizationContentsArea { public String getId() { return element.getAttribute("id"); //$NON-NLS-1$ } - + public boolean isScalable() { return "true".equals(element.getAttribute(FontSelection.ATT_SCALABLE)); //$NON-NLS-1$ } @@ -405,7 +405,7 @@ public class CustomizationContentsArea { public IntroTheme(IConfigurationElement element) { this.element = element; } - + public Image getPreviewImage() { if (previewImage==null) { String path = element.getAttribute("previewImage"); //$NON-NLS-1$ @@ -420,7 +420,7 @@ public class CustomizationContentsArea { } return previewImage; } - + public void dispose() { if (previewImage!=null) { previewImage.dispose(); @@ -552,7 +552,7 @@ public class CustomizationContentsArea { gd.verticalSpan = 3; gd.widthHint = 10; label.setLayoutData(gd); - + label = new Label(pageContainer, SWT.NULL); label.setText(Messages.WelcomeCustomizationPreferencePage_left); label = new Label(pageContainer, SWT.NULL); @@ -581,7 +581,7 @@ public class CustomizationContentsArea { gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 100; bottomLeft.getControl().setLayoutData(gd); - + bottomRight = createTableViewer(pageContainer, "bottom-right"); //$NON-NLS-1$ gd = new GridData(GridData.FILL_BOTH); gd.widthHint = 100; @@ -716,7 +716,7 @@ public class CustomizationContentsArea { private void enableFontsButton() { if (introTheme != null) { useRelativeFonts.setEnabled(introTheme.isScalable()); - } + } } private void updateThemePreview() { @@ -739,7 +739,7 @@ public class CustomizationContentsArea { /** * Remember the current page, close intro, reopen it and show the saved page. - * + * */ private void restartIntro() { IIntroManager manager = PlatformUI.getWorkbench().getIntroManager(); @@ -943,7 +943,7 @@ public class CustomizationContentsArea { }); item.setControl(container); } - + private void loadThemes() { IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.configExtension"); //$NON-NLS-1$ for (int i=0; i<elements.length; i++) { @@ -1077,7 +1077,7 @@ public class CustomizationContentsArea { private void fillPopupMenu(IMenuManager manager, final TableViewer viewer) { StructuredSelection ssel = (StructuredSelection) viewer.getSelection(); - + manager.add(new Separator()); Action addSeparator = new Action(Messages.WelcomeCustomizationPreferencePage_addSeparator) { @Override @@ -1085,7 +1085,7 @@ public class CustomizationContentsArea { doAddSeparator(viewer); } }; - + manager.add(addSeparator); manager.add(new Separator()); @@ -1121,9 +1121,9 @@ public class CustomizationContentsArea { addMoveToAction(menu, bottomLeft, viewer, Messages.WelcomeCustomizationPreferencePage_menu_bottom_left); addMoveToAction(menu, bottomRight, viewer, Messages.WelcomeCustomizationPreferencePage_menu_bottom_right); manager.add(menu); - + boolean addDeleteSeparator=false; - + for (Iterator<?> iter=ssel.iterator(); iter.hasNext();) { Object obj = iter.next(); if (obj instanceof SeparatorData) @@ -1168,7 +1168,7 @@ public class CustomizationContentsArea { gd.moveDown((BaseData) obj); viewer.refresh(); } - + private void doAddSeparator(Viewer viewer) { Object obj = ((StructuredSelection) viewer.getSelection()).getFirstElement(); GroupData gd = (GroupData) viewer.getInput(); diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationDialog.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationDialog.java index 7d9f46ed8..a35b2133e 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationDialog.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizationDialog.java @@ -23,7 +23,7 @@ public class CustomizationDialog extends TrayDialog { private CustomizationContentsArea contentsArea; private String pageId; - + private CustomizationContentsArea getContentsArea() { if (contentsArea == null) { contentsArea = new CustomizationContentsArea(); @@ -35,7 +35,7 @@ public class CustomizationDialog extends TrayDialog { setShellStyle(getShellStyle() | SWT.RESIZE); this.pageId = pageId; } - + @Override protected Control createDialogArea(Composite parent) { CustomizationContentsArea contents = getContentsArea(); @@ -46,7 +46,7 @@ public class CustomizationDialog extends TrayDialog { inner.setLayoutData(new GridData(GridData.FILL_BOTH)); return outerContainer; } - + @Override protected void okPressed() { if (getContentsArea().performOk()) { @@ -54,7 +54,7 @@ public class CustomizationDialog extends TrayDialog { } super.okPressed(); } - + @Override protected void cancelPressed() { getContentsArea().dispose(); @@ -63,9 +63,9 @@ public class CustomizationDialog extends TrayDialog { @Override protected void configureShell(Shell newShell) { - super.configureShell(newShell); - newShell.setText(Messages.WelcomeCustomizationPreferencePage_Customize); + super.configureShell(newShell); + newShell.setText(Messages.WelcomeCustomizationPreferencePage_Customize); newShell.setImage(ImageUtil.createImage("full/elcl16/configure.gif")); //$NON-NLS-1$); } - + } diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizeAction.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizeAction.java index fd2c69a90..d4242df17 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizeAction.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/CustomizeAction.java @@ -19,11 +19,11 @@ import org.eclipse.ui.intro.IIntroSite; public class CustomizeAction extends Action { private IIntroSite site; - + public CustomizeAction(IIntroSite site) { this.site = site; } - + @Override public void run() { String pageId = IntroPlugin.getDefault().getIntroModelRoot().getCurrentPageId(); diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/GroupData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/GroupData.java index 276bd84f3..5c76409bd 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/GroupData.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/GroupData.java @@ -24,7 +24,7 @@ public class GroupData { boolean fDefault=false; private String path; private ArrayList<BaseData> children = new ArrayList<>(); - + public GroupData(String path, boolean defaultGroup) { fDefault = defaultGroup; this.path = path; @@ -42,7 +42,7 @@ public class GroupData { if (child.getNodeName().equals("extension")) { //$NON-NLS-1$ loadExtension((Element) child); } - else if (child.getNodeName().equals("separator")) {//$NON-NLS-1$" + else if (child.getNodeName().equals("separator")) {//$NON-NLS-1$" loadSeparator((Element)child); } } @@ -51,11 +51,11 @@ public class GroupData { if (df!=null && df.equalsIgnoreCase("true")) //$NON-NLS-1$ fDefault = true; } - + public boolean isHidden() { return (path.equals(IUniversalIntroConstants.HIDDEN)); } - + public boolean isDefault() { return fDefault; } @@ -73,7 +73,7 @@ public class GroupData { result.add(element); } } - + public void add(BaseData ed) { children.add(ed); ed.setParent(this); @@ -86,12 +86,12 @@ public class GroupData { children.remove(ed); ed.setParent(null); } - + public void addImplicitExtension(String id, String name) { ExtensionData ed = new ExtensionData(id, name, IUniversalIntroConstants.LOW, true); add(ed); } - + private void loadSeparator(Element element) { String id = element.getAttribute("id"); //$NON-NLS-1$ SeparatorData sd = new SeparatorData(id); @@ -105,7 +105,7 @@ public class GroupData { ExtensionData ed = new ExtensionData(id, name, importance, false); add(ed); } - + public BaseData[] getChildren() { return children.toArray(new BaseData[children.size()]); } @@ -138,7 +138,7 @@ public class GroupData { public boolean contains(String id) { return find(id)!=null; } - + BaseData find(String extensionId) { for (int i = 0; i < children.size(); i++) { BaseData data = children.get(i); @@ -151,7 +151,7 @@ public class GroupData { public int getIndexOf(BaseData ed) { return children.indexOf(ed); } - + public int getIndexOf(String baseId) { for (int i = 0; i < children.size(); i++) { BaseData bd = children.get(i); @@ -160,17 +160,17 @@ public class GroupData { } return -1; } - + public boolean canMoveUp(BaseData ed) { int index = children.indexOf(ed); return (index>0); } - + public boolean canMoveDown(BaseData ed) { int index = children.indexOf(ed); return (index!= -1 && index < children.size()-1); } - + public void moveUp(BaseData ed) { int index = children.indexOf(ed); BaseData swapped = children.get(index-1); @@ -182,9 +182,9 @@ public class GroupData { int index = children.indexOf(ed); BaseData swapped = children.get(index+1); children.set(index, swapped); - children.set(index+1, ed); + children.set(index+1, ed); } - + public void addSeparator(BaseData after) { SeparatorData sd = new SeparatorData(); sd.id = ""+sd.hashCode(); //$NON-NLS-1$ @@ -197,7 +197,7 @@ public class GroupData { } children.add(sd); } - + public void write(PrintWriter writer, String indent) { writer.print(indent); if (isHidden()) diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IUniversalIntroConstants.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IUniversalIntroConstants.java index b6d74638d..961fd4bbe 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IUniversalIntroConstants.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IUniversalIntroConstants.java @@ -55,16 +55,16 @@ public interface IUniversalIntroConstants { String PERF_SET_STANDBY_STATE = PLUGIN_ID + "/perf/setStandbyState"; //$NON-NLS-1$ // not exposed in .option. Used because framework is convenient. String PERF_UI_ZOOM = PLUGIN_ID + "/perf/uiZoom"; //$NON-NLS-1$ - + // Universal Welcome - + String LOW = "low"; //$NON-NLS-1$ String MEDIUM = "medium"; //$NON-NLS-1$ String HIGH = "high"; //$NON-NLS-1$ String CALLOUT = "callout"; //$NON-NLS-1$ String HIDDEN = "hidden"; //$NON-NLS-1$ String NEW = "new"; //$NON-NLS-1$ - + String STYLE_LOW = "importance-low"; //$NON-NLS-1$ String STYLE_MEDIUM = "importance-medium"; //$NON-NLS-1$ String STYLE_HIGH = "importance-high"; //$NON-NLS-1$ @@ -85,7 +85,7 @@ public interface IUniversalIntroConstants { String ID_MIGRATE = "migrate";//$NON-NLS-1$ String ID_WEBRESOURCES = "webresources";//$NON-NLS-1$ String ID_WORKBENCH = "workbench"; //$NON-NLS-1$ - + // Page DIV ids String DIV_PAGE_LINKS = "page-links"; //$NON-NLS-1$ String DIV_ACTION_LINKS = "action-links"; //$NON-NLS-1$ @@ -94,17 +94,17 @@ public interface IUniversalIntroConstants { String DIV_LAYOUT_BOTTOM_LEFT = "bottom-left"; //$NON-NLS-1$ String DIV_LAYOUT_BOTTOM_RIGHT = "bottom-right"; //$NON-NLS-1$ - // Product intro variables + // Product intro variables String VAR_INTRO_BACKGROUND_IMAGE = "INTRO_BACKGROUND_IMAGE"; //$NON-NLS-1$ String VAR_INTRO_ROOT_PAGES = "INTRO_ROOT_PAGES"; //$NON-NLS-1$ String VAR_INTRO_DATA = "INTRO_DATA"; //$NON-NLS-1$ String VAR_WORKBENCH_AS_ROOT_LINK="workbenchAsRootLink"; //$NON-NLS-1$ String VAR_INTRO_DESCRIPTION_PREFIX = "introDescription"; //$NON-NLS-1$ - + //Page table properties String P_IMPORTANCE = "importance"; //$NON-NLS-1$ String P_NAME = "name"; //$NON-NLS-1$ - + //Theme property constants String LAUNCHBAR_OVERVIEW_ICON = "launchbarOverviewIcon"; //$NON-NLS-1$ String LAUNCHBAR_FIRSTSTEPS_ICON = "launchbarFirststepsIcon"; //$NON-NLS-1$ diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IntroData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IntroData.java index 00b42aa49..b08914e0f 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IntroData.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/IntroData.java @@ -39,18 +39,18 @@ public class IntroData { private String productId; private Map<String, PageData> pages = new HashMap<>(); private boolean active; - + public IntroData(String productId, String fileNameOrData, boolean active) { this.productId = productId; this.active = active; if (fileNameOrData!=null) initialize(fileNameOrData); } - + public String getProductId() { return productId; } - + public PageData getPage(String pageId) { return pages.get(pageId); } @@ -77,7 +77,7 @@ public class IntroData { PageData pd = new PageData(page); pages.put(pd.getId(), pd); } - + public void addImplicitContent() { IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.configExtension"); //$NON-NLS-1$ for (int i=0; i<elements.length; i++) { @@ -164,7 +164,7 @@ public class IntroData { buffer.append(spe.getLineNumber()); buffer.append(", uri "); //$NON-NLS-1$ buffer.append(spe.getSystemId()); - buffer.append("\n"); //$NON-NLS-1$ + buffer.append("\n"); //$NON-NLS-1$ buffer.append(spe.getMessage()); // Use the contained exception. @@ -188,7 +188,7 @@ public class IntroData { } return null; } - + public void write(PrintWriter writer) { writer.println("<?xml version=\"1.0\" encoding=\"utf-8\" ?>"); //$NON-NLS-1$ writer.println("<extensions>"); //$NON-NLS-1$ diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/Messages.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/Messages.java index 41ed0b1c4..1c5cb6b6b 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/Messages.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/Messages.java @@ -89,7 +89,7 @@ public class Messages extends NLS { public static String WelcomeCustomizationPreferencePage_menu_top_left; public static String WelcomeCustomizationPreferencePage_menu_top_right; public static String WelcomeCustomizationPreferencePage_menu_bottom_left; - public static String WelcomeCustomizationPreferencePage_menu_bottom_right; + public static String WelcomeCustomizationPreferencePage_menu_bottom_right; public static String WelcomeCustomizationPreferencePage_browse; public static String WelcomeCustomizationPreferencePage_browseTitle; public static String SharedIntroConfigurer_customize_label; diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java index a27b628a2..d0b11ceb1 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/PageData.java @@ -30,11 +30,11 @@ public class PageData { private String id; private ArrayList<GroupData> groups = new ArrayList<>(); private GroupData hidden=null; - + public PageData(String id) { this.id = id; } - + public PageData(Element page) { this.id = page.getAttribute("id"); //$NON-NLS-1$ NodeList children = page.getChildNodes(); @@ -51,7 +51,7 @@ public class PageData { } } } - + public void add(GroupData gd) { if (gd.isHidden()) hidden = gd; @@ -95,7 +95,7 @@ public class PageData { public boolean isHidden(String extensionId) { return hidden!=null && hidden.contains(extensionId); } - + public GroupData findGroup(String groupId) { if (groupId.equals(IUniversalIntroConstants.HIDDEN)) return hidden; @@ -107,14 +107,14 @@ public class PageData { } return null; } - + private void addGroup(Element element, boolean hide) { GroupData gd = new GroupData(element); if (hide) hidden = gd; else groups.add(gd); } - + public void addImplicitExtension(String extensionId, String name) { ExtensionData ed = findExtension(extensionId, true); if (ed!=null) { @@ -148,11 +148,11 @@ public class PageData { } return defaultGroup; } - + public String getId() { return id; } - + public ExtensionData findExtension(String extensionId, boolean checkHidden) { for (int i=0; i<groups.size(); i++) { GroupData gdata = groups.get(i); @@ -165,7 +165,7 @@ public class PageData { return find (hidden, extensionId); return null; } - + private ExtensionData find(GroupData gd, String extensionId) { BaseData bd = gd.find(extensionId); if (bd!=null && bd instanceof ExtensionData) @@ -189,7 +189,7 @@ public class PageData { GroupData last = groups.get(groups.size()-1); return id + "/" + last.getPath() + "/" + IUniversalIntroConstants.DEFAULT_ANCHOR; //$NON-NLS-1$//$NON-NLS-2$ } - + public void write(PrintWriter writer, String indent) { writer.print(indent); String indent2 = indent+" "; //$NON-NLS-1$ diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/SeparatorData.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/SeparatorData.java index 8e4eb2772..b92c15250 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/SeparatorData.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/SeparatorData.java @@ -13,10 +13,10 @@ package org.eclipse.ui.internal.intro.universal; import java.io.PrintWriter; public class SeparatorData extends BaseData { - + public SeparatorData() { } - + public SeparatorData(String id) { this.id = id; } diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java index 52b2f05a2..e4652431b 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroConfigurer.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -41,12 +41,12 @@ import org.osgi.framework.Bundle; /** * This class provides for dynamic configuration of the shared intro * implementation based on the data file associated with the product. - * + * * @since 3.2 */ public class UniversalIntroConfigurer extends IntroConfigurer implements IUniversalIntroConstants { - + private IntroData primaryIntroData; private IntroData[] secondaryIntroData; private SequenceResolver<IntroElement> sequenceResolver; @@ -99,7 +99,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements /* * (non-Javadoc) - * + * * @see org.eclipse.ui.intro.config.IntroConfigurer#getMixinStyle(java.lang.String) */ @Override @@ -216,7 +216,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements * <ul> * <li>foo → org.eclipse.ui.intro.universal.solstice/foo * </ul> - * + * * @param path * the path * @return same path with a prefixed theme directory component @@ -297,7 +297,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements private IntroElement[] getRootPageActionLinks(boolean standby) { String wb = getVariable(VAR_WORKBENCH_AS_ROOT_LINK); - // only create the workbench link if + // only create the workbench link if // not already configured as a root link if (wb==null || !wb.equalsIgnoreCase("true")) { //$NON-NLS-1$ IntroElement page = createRootPageLink(ID_WORKBENCH, standby); @@ -309,9 +309,9 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements private IntroElement[] getNavLinks(String pageId) { ArrayList<IntroElement> links = new ArrayList<>(); - String ids = getVariable(VAR_INTRO_ROOT_PAGES); + String ids = getVariable(VAR_INTRO_ROOT_PAGES); /* - * In high contrast mode the workbench link must be generated in the nav links + * In high contrast mode the workbench link must be generated in the nav links * otherwise it will not show */ if (ImageUtil.isHighContrast()) { @@ -397,7 +397,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements private IntroElement createNavLink(String id, String pageId, int [] counter) { if (id.equals(ID_OVERVIEW)) return createNavLink(Messages.SharedIntroConfigurer_overview_nav, - createPageURL(id, false), id, "left nav_link"+(++counter[0])); //$NON-NLS-1$ + createPageURL(id, false), id, "left nav_link"+(++counter[0])); //$NON-NLS-1$ if (id.equals(ID_FIRSTSTEPS)) return createNavLink(Messages.SharedIntroConfigurer_firststeps_nav, createPageURL(id, false), id, "left nav_link"+(++counter[0])); //$NON-NLS-1$ @@ -421,7 +421,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements return createNavLink( Messages.SharedIntroConfigurer_workbench_name, "http://org.eclipse.ui.intro/switchToLaunchBar", //$NON-NLS-1$ - id, + id, "right nav_link"+(++counter[0])); //$NON-NLS-1$ return null; } @@ -436,31 +436,31 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements private IntroElement createLaunchBarShortcut(String id) { if (id.equals(ID_OVERVIEW)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_OVERVIEW_ICON), Messages.SharedIntroConfigurer_overview_nav, + getThemeProperty(LAUNCHBAR_OVERVIEW_ICON), Messages.SharedIntroConfigurer_overview_nav, id); if (id.equals(ID_FIRSTSTEPS)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_FIRSTSTEPS_ICON), Messages.SharedIntroConfigurer_firststeps_nav, + getThemeProperty(LAUNCHBAR_FIRSTSTEPS_ICON), Messages.SharedIntroConfigurer_firststeps_nav, id); if (id.equals(ID_TUTORIALS)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_TUTORIALS_ICON), Messages.SharedIntroConfigurer_tutorials_nav, + getThemeProperty(LAUNCHBAR_TUTORIALS_ICON), Messages.SharedIntroConfigurer_tutorials_nav, id); if (id.equals(ID_SAMPLES)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_SAMPLES_ICON), Messages.SharedIntroConfigurer_samples_nav, + getThemeProperty(LAUNCHBAR_SAMPLES_ICON), Messages.SharedIntroConfigurer_samples_nav, id); if (id.equals(ID_WHATSNEW)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_WHATSNEW_ICON), Messages.SharedIntroConfigurer_whatsnew_nav, + getThemeProperty(LAUNCHBAR_WHATSNEW_ICON), Messages.SharedIntroConfigurer_whatsnew_nav, id); if (id.equals(ID_MIGRATE)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_MIGRATE_ICON), Messages.SharedIntroConfigurer_migrate_nav, + getThemeProperty(LAUNCHBAR_MIGRATE_ICON), Messages.SharedIntroConfigurer_migrate_nav, id); if (id.equals(ID_WEBRESOURCES)) return createShortcutLink( - getThemeProperty(LAUNCHBAR_WEBRESOURCES_ICON), Messages.SharedIntroConfigurer_webresources_nav, + getThemeProperty(LAUNCHBAR_WEBRESOURCES_ICON), Messages.SharedIntroConfigurer_webresources_nav, id); return null; } @@ -508,7 +508,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements if (value!=null) img.setAttribute("src", value); //$NON-NLS-1$ img.setAttribute("alt", label); //$NON-NLS-1$ - element.addChild(img); + element.addChild(img); styleId += " "+HIGH_CONTRAST; //$NON-NLS-1$ } element.setAttribute("style-id", styleId); //$NON-NLS-1$ @@ -594,7 +594,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements } return sequenceResolver.getSequence(primaryAnchors, secondaryAnchors); } - + private List<IntroElement> getAnchors(IntroData data, String pageId, String groupId) { PageData pdata = data.getPage(pageId); if (pdata != null) { @@ -604,7 +604,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements } return null; } - + @Override public String resolvePath(String extensionId, String path) { boolean extensionRelativePath = false; @@ -662,7 +662,7 @@ public class UniversalIntroConfigurer extends IntroConfigurer implements // there was no clear winner; fall back to the default return resolveDefaultPath(pageId, extensionId); } - + private String resolveDefaultPath(String pageId, String extensionId) { String pluginId = ExtensionMap.getInstance().getPluginId(extensionId); if (ContentDetector.isNew(pluginId)) { diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroPlugin.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroPlugin.java index bfc6a360c..357828b8f 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroPlugin.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/UniversalIntroPlugin.java @@ -29,12 +29,12 @@ public class UniversalIntroPlugin extends AbstractUIPlugin { // used for performance logging. Time when the constructor of // CustomizableIntroPart is called. private long uiCreationStartTime; - + // image registry that can be disposed while the // plug-in is still active. This is important for // switching themes after the plug-in has been loaded. private ImageRegistry volatileImageRegistry; - + /** * The constructor. */ @@ -48,7 +48,7 @@ public class UniversalIntroPlugin extends AbstractUIPlugin { public static UniversalIntroPlugin getDefault() { return inst; } - + /** * Returns the Intro Part. */ @@ -96,7 +96,7 @@ public class UniversalIntroPlugin extends AbstractUIPlugin { return PlatformUI.getWorkbench().getIntroManager().closeIntro( getIntro()); } - + public ImageRegistry getVolatileImageRegistry() { if (volatileImageRegistry==null) { volatileImageRegistry = createImageRegistry(); @@ -104,7 +104,7 @@ public class UniversalIntroPlugin extends AbstractUIPlugin { } return volatileImageRegistry; } - + public void resetVolatileImageRegistry() { if (volatileImageRegistry!=null) { volatileImageRegistry.dispose(); diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/WelcomeCustomizationPreferencePage.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/WelcomeCustomizationPreferencePage.java index 4fb16219a..d4d00bf86 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/WelcomeCustomizationPreferencePage.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/WelcomeCustomizationPreferencePage.java @@ -35,7 +35,7 @@ public class WelcomeCustomizationPreferencePage extends PreferencePage implement public WelcomeCustomizationPreferencePage(String title, ImageDescriptor image) { super(title, image); } - + private CustomizationContentsArea getContentsArea() { if (contentsArea == null) { contentsArea = new CustomizationContentsArea(); @@ -74,7 +74,7 @@ public class WelcomeCustomizationPreferencePage extends PreferencePage implement @Override public void init(IWorkbench workbench) { } - + public void setCurrentPage(String pageId) { getContentsArea().setCurrentPage(pageId); } diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java index 7fb469e04..026e77479 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetectHelper.java @@ -30,7 +30,7 @@ import org.eclipse.ui.IMemento; import org.eclipse.ui.XMLMemento; public class ContentDetectHelper { - + public static final int NO_STATE = -1; private static final String EXTENSION_COUNT_XML = "extensionCount.xml"; //$NON-NLS-1$ private static final String EXTENSION_NAMES_XML = "extensionNames.xml"; //$NON-NLS-1$ @@ -39,7 +39,7 @@ public class ContentDetectHelper { private static final String NAME = "name"; //$NON-NLS-1$ private static final String ROOT = "root"; //$NON-NLS-1$ private static final String PLUGIN_ID = "org.eclipse.ui.intro.universal"; //$NON-NLS-1$ - + private File configurationDirectory; private File getConfigurationLocation() { @@ -57,14 +57,14 @@ public class ContentDetectHelper { } return configurationDirectory; } - - public void saveExtensionCount(int count) { + + public void saveExtensionCount(int count) { XMLMemento writeMemento = XMLMemento.createWriteRoot(ROOT); writeMemento.putInteger(INTROCOUNT, count); saveMemento(writeMemento, EXTENSION_COUNT_XML); } - - public int getExtensionCount() { + + public int getExtensionCount() { XMLMemento readMemento = getReadMemento(EXTENSION_COUNT_XML); if (readMemento == null) { return NO_STATE; @@ -74,7 +74,7 @@ public class ContentDetectHelper { if (extensionCount == null) { return NO_STATE; } - + return extensionCount.intValue(); } @@ -86,7 +86,7 @@ public class ContentDetectHelper { } saveMemento(writeMemento, EXTENSION_NAMES_XML); } - + public Set<String> getContributors() { Set<String> contributors = new HashSet<>(); XMLMemento readMemento = getReadMemento(EXTENSION_NAMES_XML); @@ -99,19 +99,19 @@ public class ContentDetectHelper { } return contributors; } - + private XMLMemento getReadMemento(String filename) { XMLMemento memento; InputStreamReader reader = null; try { - final File stateFile = getStateFile(filename); + final File stateFile = getStateFile(filename); FileInputStream input = new FileInputStream(stateFile); reader = new InputStreamReader(input, StandardCharsets.UTF_8); memento = XMLMemento.createReadRoot(reader); - + } catch (FileNotFoundException e) { memento = null; // Do nothing, the file will not exist the first time the workbench in used. @@ -128,10 +128,10 @@ public class ContentDetectHelper { } return memento; } - + private void saveMemento(XMLMemento memento, String filename) { // Save the IMemento to a file. - File stateFile = getStateFile(filename); + File stateFile = getStateFile(filename); OutputStreamWriter writer = null; try { FileOutputStream stream = new FileOutputStream(stateFile); @@ -147,7 +147,7 @@ public class ContentDetectHelper { } } } - + private File getStateFile(String filename) { if (getConfigurationLocation() == null) { return null; @@ -155,7 +155,7 @@ public class ContentDetectHelper { File stateFile = new File(getConfigurationLocation(), filename); return stateFile; } - + public Set<String> findNewContributors(Set<String> contributors, Set<String> previousContributors) { Set<String> result = new HashSet<>(contributors); for (Iterator<String> iter = previousContributors.iterator(); iter.hasNext();) { @@ -166,9 +166,9 @@ public class ContentDetectHelper { public void deleteStateFiles() { try { - File stateFile = new File(getConfigurationLocation(), EXTENSION_COUNT_XML); + File stateFile = new File(getConfigurationLocation(), EXTENSION_COUNT_XML); stateFile.delete(); - stateFile = new File(getConfigurationLocation(), EXTENSION_NAMES_XML); + stateFile = new File(getConfigurationLocation(), EXTENSION_NAMES_XML); stateFile.delete(); } catch (RuntimeException e) { } diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetector.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetector.java index bd239ca66..8820600bd 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetector.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/contentdetect/ContentDetector.java @@ -22,12 +22,12 @@ public class ContentDetector extends IntroContentDetector { private static Set<String> newContributors; private static boolean detectorCalled = false; - + public ContentDetector() { } @Override - public boolean isNewContentAvailable() { + public boolean isNewContentAvailable() { try { detectorCalled = true; // If we have previously found new content no need to recompute @@ -38,7 +38,7 @@ public class ContentDetector extends IntroContentDetector { .getExtensionRegistry() .getExtensionPoint("org.eclipse.ui.intro.configExtension").getExtensions(); //$NON-NLS-1$ int numIntroExtensions = extensions.length; - + ContentDetectHelper helper = new ContentDetectHelper(); int previous = helper.getExtensionCount(); if (numIntroExtensions != previous) { @@ -55,13 +55,13 @@ public class ContentDetector extends IntroContentDetector { } helper.saveContributors(contributors); } - } catch (Exception e) { + } catch (Exception e) { return false; } newContributors = new HashSet<>(); return false; } - + /** * @return The set of the ids of config extensions which are new since the last time * intro was opened. May be null if there are no contributors. @@ -73,7 +73,7 @@ public class ContentDetector extends IntroContentDetector { } return newContributors; } - + /** * Test to see if this contribution was newly installed * @param contributionId diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java index 65a6f4c46..53b1eee36 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java @@ -56,7 +56,7 @@ public class BundleUtil { /** * Retrieves the given key from the bundle header. - * + * * @param bundle * @param key * @return @@ -74,7 +74,7 @@ public class BundleUtil { /** * Get the resourcelocation, but do not force an $nl$ on it. - * + * * @param resource * @param element * @return @@ -90,7 +90,7 @@ public class BundleUtil { * Returns the fully qualified location of the passed resource string from * the passed plugin id. If the file could not be loaded from the plugin, * the resource is returned as is. - * + * * @param resource * @return */ @@ -103,7 +103,7 @@ public class BundleUtil { /** * Shorthand util method. - * + * * @param resource * @return */ @@ -174,7 +174,7 @@ public class BundleUtil { return resource; } } - + private static String toExternalForm(URL localURL) { try { localURL = FileLocator.toFileURL(localURL); @@ -215,7 +215,7 @@ public class BundleUtil { /** * Get the absolute path of the given bundle, in the form * file:/path_to_plugin - * + * * @param bundle * @return */ @@ -243,7 +243,7 @@ public class BundleUtil { /** * Get the absolute path of the bundle with id <code>bundleId</code>. If * no such bundle is found, return null. - * + * * @param bundleId * @return */ diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/ImageUtil.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/ImageUtil.java index 09e9b2211..833b93161 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/ImageUtil.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/ImageUtil.java @@ -68,7 +68,7 @@ public final class ImageUtil { /** * Convenience method to create an image descriptor from the Intro plugin. - * + * * Method assumes that images are under the "icons" directory, so don't * append that directory name for "imageName". */ @@ -79,7 +79,7 @@ public final class ImageUtil { /** * Convenience method to create an image descriptor. - * + * */ public static ImageDescriptor createImageDescriptor(Bundle bundle, String imageName) { @@ -100,7 +100,7 @@ public final class ImageUtil { /** * Convenience method to create an image descriptor. - * + * */ public static ImageDescriptor createImageDescriptor(IPath base, String imageName) { @@ -118,7 +118,7 @@ public final class ImageUtil { /** * Convenience method to create an image from the Intro plugin. - * + * * Method assumes that images are under the "icons" directory, so don't * append that directory name for "imageName". */ @@ -135,7 +135,7 @@ public final class ImageUtil { /** * Util method for image re-use in Intro Plugin. - * + * * @param key * @return */ @@ -157,7 +157,7 @@ public final class ImageUtil { /** * Register an image descriptor in the Intro Plugin image registry. Has no * effect if the key has already been registered. - * + * * @param key * @param imageName */ @@ -188,11 +188,11 @@ public final class ImageUtil { return; registry.put(key, createImageDescriptor(base, imageName)); } - + /** * Tests for high contrast mode. Returns false if not called from a * UI thread (causes deadlocks during junit tests). - * + * * @return whether or not the display is in high contrast mode */ public static boolean isHighContrast() { diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/Log.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/Log.java index e3cd96c19..98675b084 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/Log.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/Log.java @@ -25,7 +25,7 @@ import org.eclipse.ui.internal.intro.universal.UniversalIntroPlugin; * mode. Info messages are only logged when the /trace/logInfo debug option is * set to true. Performance reports are only logged when /trace/performance is * set to true. - * + * */ public class Log implements IUniversalIntroConstants { diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/PreferenceArbiter.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/PreferenceArbiter.java index 4173d89a3..07f5dc568 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/PreferenceArbiter.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/PreferenceArbiter.java @@ -22,7 +22,7 @@ public class PreferenceArbiter { private Map<Object, int[]> references; private Object leader; - + public void consider(Object obj) { if (obj != null) { if (references == null) { @@ -44,7 +44,7 @@ public class PreferenceArbiter { } } } - + public Object getWinner() { return leader; } diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/intro/universal/ExtensionFactory.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/intro/universal/ExtensionFactory.java index 631d34c2c..1bb0231e7 100644 --- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/intro/universal/ExtensionFactory.java +++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/intro/universal/ExtensionFactory.java @@ -33,7 +33,7 @@ import org.eclipse.ui.internal.intro.universal.WelcomeCustomizationPreferencePag * </ul> * <p>This class should be referenced in extensions but not subclassed * or instantiated programmatically. - * + * * @since 3.2 * @noextend This class is not intended to be subclassed by clients. * @noinstantiate This class is not intended to be instantiated by clients. @@ -52,7 +52,7 @@ public class ExtensionFactory implements IExecutableExtensionFactory, IExecutabl return configure(new WelcomeCustomizationPreferencePage()); throw new CoreException(new Status(IStatus.ERROR, UniversalIntroPlugin.PLUGIN_ID, 0, - "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ + "Unknown id in data argument for " + getClass(), null)); //$NON-NLS-1$ } private Object configure(Object obj) throws CoreException { diff --git a/org.eclipse.ui.intro/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.ui.intro/.settings/org.eclipse.jdt.ui.prefs index 30342114f..7ef179682 100644 --- a/org.eclipse.ui.intro/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.ui.intro/.settings/org.eclipse.jdt.ui.prefs @@ -1,6 +1,63 @@ -#Sat Nov 12 22:58:47 EST 2005 eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_UA formatter_settings_version=9 internal.default.compliance=user org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/> +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=false +sp_cleanup.format_source_code_changes_only=false +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=true +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=true +sp_cleanup.organize_imports=false +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=false +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=false +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=true +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java index 8d4326d91..6d7a51e0c 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/FontSelection.java @@ -4,7 +4,7 @@ * 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 *******************************************************************************/ @@ -22,23 +22,23 @@ import org.eclipse.swt.graphics.FontData; import org.osgi.service.prefs.BackingStoreException; public class FontSelection { - + public static final String VAR_FONT_STYLE = "fontStyle"; //$NON-NLS-1$ public static final String FONT_ABSOLUTE = "absolute"; //$NON-NLS-1$ - public static final String FONT_RELATIVE = "relative"; //$NON-NLS-1$ + public static final String FONT_RELATIVE = "relative"; //$NON-NLS-1$ private static final String SCALE_FACTOR = "scaleFactor"; //$NON-NLS-1$ public static final String ATT_SCALABLE = "scalable"; //$NON-NLS-1$ - - private static final int MIN_HEIGHT = 10; + + private static final int MIN_HEIGHT = 10; private static final int MAX_HEIGHT = 16; - + /* * Returns the height in points of the default SWT font */ private static int getDefaultFontHeight() { Font defaultFont = JFaceResources.getDefaultFont(); FontData[] fontData = defaultFont.getFontData(); - int height = MIN_HEIGHT; + int height = MIN_HEIGHT; for (int i=0; i< fontData.length; i++) { FontData data = fontData[i]; height = Math.max(height, data.getHeight()); @@ -58,7 +58,7 @@ public class FontSelection { result += getFontSizeDeclaration("h6", defaultFontHeight, 70, scale); //$NON-NLS-1$ return result; } - + public static final int getScalePercentage() { int scale = Platform.getPreferencesService().getInt(IntroPlugin.PLUGIN_ID, (SCALE_FACTOR), 0, null); return scale; @@ -72,13 +72,13 @@ public class FontSelection { public static void setScalePercentage(int i) { IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(IntroPlugin.PLUGIN_ID); - prefs.putInt(SCALE_FACTOR, i); + prefs.putInt(SCALE_FACTOR, i); try { prefs.flush(); } catch (BackingStoreException e) { - } + } } - + // Set the scale factor to it's default public static void resetScalePercentage() { IEclipsePreferences iprefs = InstanceScope.INSTANCE.getNode(IntroPlugin.PLUGIN_ID); @@ -97,7 +97,7 @@ public class FontSelection { return style; } style = Platform.getPreferencesService().getString - (IntroPlugin.PLUGIN_ID, (FontSelection.VAR_FONT_STYLE), "", null); //$NON-NLS-1$ + (IntroPlugin.PLUGIN_ID, (FontSelection.VAR_FONT_STYLE), "", null); //$NON-NLS-1$ if (style.length() > 0) { return style; } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/IntroPlugin.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/IntroPlugin.java index e4970bcf4..df39994bc 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/IntroPlugin.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/IntroPlugin.java @@ -30,11 +30,11 @@ public class IntroPlugin extends AbstractUIPlugin { public static final String PLUGIN_ID = "org.eclipse.ui.intro"; //$NON-NLS-1$ // Debug control variables - public static boolean LOG_WARN = + public static boolean LOG_WARN = "true".equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID+"/debug/warn")); //$NON-NLS-1$ //$NON-NLS-2$ - public static boolean LOG_INFO = + public static boolean LOG_INFO = "true".equalsIgnoreCase(Platform.getDebugOption(PLUGIN_ID+"/debug/info")); //$NON-NLS-1$ //$NON-NLS-2$ - + // The static shared instance. private static IntroPlugin inst; @@ -45,12 +45,12 @@ public class IntroPlugin extends AbstractUIPlugin { // used for performance logging. Time when the constructor of // CustomizableIntroPart is called. private long uiCreationStartTime; - + // image registry that can be disposed while the // plug-in is still active. This is important for // switching themes after the plug-in has been loaded. private ImageRegistry volatileImageRegistry; - + // debug options public static boolean DEBUG = false; public static boolean DEBUG_NO_BROWSER = false; @@ -69,7 +69,7 @@ public class IntroPlugin extends AbstractUIPlugin { public static IntroPlugin getDefault() { return inst; } - + public ImageRegistry getVolatileImageRegistry() { if (volatileImageRegistry==null) { volatileImageRegistry = createImageRegistry(); @@ -77,7 +77,7 @@ public class IntroPlugin extends AbstractUIPlugin { } return volatileImageRegistry; } - + public void resetVolatileImageRegistry() { if (volatileImageRegistry!=null) { volatileImageRegistry.dispose(); @@ -108,7 +108,7 @@ public class IntroPlugin extends AbstractUIPlugin { /** * Returns the model root. Will always guarantee that model is loaded. - * + * * @return Returns the introModelRoot. */ public IntroModelRoot getIntroModelRoot() { @@ -201,8 +201,8 @@ public class IntroPlugin extends AbstractUIPlugin { */ public static synchronized void logError(String message) { logError(message,null); - } - + } + /** * Logs an Error message with an exception. To print errors to console, * run eclipse with the -console -consolelog arguments @@ -213,13 +213,13 @@ public class IntroPlugin extends AbstractUIPlugin { } Status errorStatus = new Status(IStatus.ERROR, PLUGIN_ID, message, ex); IntroPlugin.getDefault().getLog().log(errorStatus); - } - - + } + + /** * Logs a Warning message with an exception. To print warnings to console, * run eclipse with the -console -consolelog arguments - * + * * Only logs if the following conditions are true: * -debug switch is enabled at the command line * .options file is placed at the eclipse work directory with the contents: @@ -229,7 +229,7 @@ public class IntroPlugin extends AbstractUIPlugin { public static synchronized void logWarning(String message) { logWarning(message,null); } - + public static synchronized void logWarning(String message,Throwable ex) { if (IntroPlugin.getDefault().isDebugging() && LOG_WARN) { @@ -240,11 +240,11 @@ public class IntroPlugin extends AbstractUIPlugin { getDefault().getLog().log(warningStatus); } } - + /** * Logs a debug message. To print messages to console, * run eclipse with the -console -consolelog arguments - * + * * Only logs if the following conditions are true: * -debug switch is enabled at the command line * .options file is placed at the eclipse work directory with the contents: diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/Messages.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/Messages.java index 3b07660d5..50005e144 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/Messages.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/Messages.java @@ -55,7 +55,7 @@ public class Messages extends NLS { // ------- public static String IntroPart_openExternal_tooltip; public static String IntroPart_showContentButton_tooltip; - + //Always Welcome Checkbox public static String AlwaysWelcomeCheckbox_Text; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/FormattedHTMLElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/FormattedHTMLElement.java index 316d78969..065e09586 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/FormattedHTMLElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/FormattedHTMLElement.java @@ -54,7 +54,7 @@ public class FormattedHTMLElement extends HTMLElement { } /** * Set whether the end tag is required for this element - * + * * @param required * true if end tag required, false otherwise */ @@ -63,7 +63,7 @@ public class FormattedHTMLElement extends HTMLElement { } /** * Set the indent level that should be applied to this element when printed - * + * * @param indentLevel * The indentLevel to set. */ @@ -73,7 +73,7 @@ public class FormattedHTMLElement extends HTMLElement { /** * Set whether or not this element should be printed over multiple lines, * or on a single line - * + * * @param spanMultipleLines * true if the element should be printed over multiple lines, * false if it should be printed on a single line @@ -83,7 +83,7 @@ public class FormattedHTMLElement extends HTMLElement { } /** * Create a string of tabs to insert before the element is printed - * + * * @param indentLevel * the number of tabs to insert * @return diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLElement.java index aac3a49df..d2babce9e 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLElement.java @@ -45,7 +45,7 @@ public class HTMLElement { /** * Add an attribute with the given name and value to this HTMLElement - * + * * @param attributeName * @param attributeValue */ @@ -64,7 +64,7 @@ public class HTMLElement { /** * Get the attributes associated with this element - * + * * @return Returns the elementAttributes. */ public Map<String, String> getElementAttributes() { @@ -76,7 +76,7 @@ public class HTMLElement { /** * Set the attributes associated with this element - * + * * @param elementAttributes * The elementAttributes to set. */ @@ -86,7 +86,7 @@ public class HTMLElement { /** * Get this element's content - * + * * @return Returns the elementContent. */ public Vector<Object> getElementContent() { @@ -98,7 +98,7 @@ public class HTMLElement { /** * Set this element's content - * + * * @param elementContent * The elementContent to set. */ @@ -108,7 +108,7 @@ public class HTMLElement { /** * Get the name of this element - * + * * @return Returns the elementName. */ public String getElementName() { @@ -117,7 +117,7 @@ public class HTMLElement { /** * Set the name of this element - * + * * @param elementName * The elementName to set. */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLUtil.java index 699a61905..37b495f28 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/HTMLUtil.java @@ -21,7 +21,7 @@ public final class HTMLUtil { /** * Creates an HTML opening element of the form <elementName * elementAttributes> - * + * * @param elementName * the name of the element to create * @param elementAttributes @@ -50,7 +50,7 @@ public final class HTMLUtil { /** * Creates an HTML start tag of the form <elementName> - * + * * @param elementName * the name of the element to create * @param insertLineBreak @@ -65,7 +65,7 @@ public final class HTMLUtil { /** * Creates an HTML start tag of the form <elementName>and inserts a line * break after the start tag - * + * * @param elementName * the name of the element to create * @return @@ -76,7 +76,7 @@ public final class HTMLUtil { /** * Creates an HTML closing element of the form </elementName> - * + * * @param elementName * the name of the closing element to create * @param addNewLine @@ -97,7 +97,7 @@ public final class HTMLUtil { * Given a map of attribute names and values, this method will create a * StringBuffer of the attributes in the form: attrName="attrValue". These * attributes can appear in the start tag of an HTML element. - * + * * @param attributes * the attributes to be converted into a String list * @return @@ -123,7 +123,7 @@ public final class HTMLUtil { /** * Creates an HTML attribute of the form attrName="attrValue" - * + * * @param attrName * the name of the attribute * @param attrValue @@ -159,7 +159,7 @@ public final class HTMLUtil { /** * Determine if the contents of two character arrays are equal - * + * * @param a * @param b * @return diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java index e9b53ee1b..c5489cd35 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/html/IntroHTMLGenerator.java @@ -57,7 +57,7 @@ public class IntroHTMLGenerator { /** * Generates the HTML code that will be presented in the browser widget for the provided intro * page. - * + * * @param page * the page to generate HTML for * @param presentation @@ -70,13 +70,13 @@ public class IntroHTMLGenerator { this.providerSite = providerSite; initializeBackgroundSizeWorks(); - + // generate and add the appropriate encoding to the top of the document // generateEncoding(); // create the main HTML element, and all of its contents. return generateHTMLElement(); } - + private void initializeBackgroundSizeWorks() { // Internet Explorer <= 9 doesn't properly handle background-size backgroundSizeWorks = true; @@ -100,7 +100,7 @@ public class IntroHTMLGenerator { /** * Return the SWT Browser instance being used to render the intro. - * + * * @return the browser or {@code null} if the browser could not be determined */ private Browser getBrowser() { @@ -119,9 +119,9 @@ public class IntroHTMLGenerator { /** * Generates the HTML element and its content: - * + * * <pre> - * + * * <HTML> * <HEAD> * head content @@ -130,9 +130,9 @@ public class IntroHTMLGenerator { * body content * </BODY> * </HTML> - * + * * </pre> - * + * * @return the html HTMLElement */ private HTMLElement generateHTMLElement() { @@ -148,10 +148,10 @@ public class IntroHTMLGenerator { /** * Generates the HEAD element and its content: - * + * * <pre> - * - * + * + * * <HEAD> * <BASE href="base_plugin_location> * <style type="text/css">HTML, IMG { border: 0px; } </style> @@ -159,9 +159,9 @@ public class IntroHTMLGenerator { * <LINK href="style sheet"> * additional head content, if specified * </HEAD> - * + * * </pre> - * + * * @param indentLevel * the number of indents to insert before the element when it is printed * @return the head HTMLElement @@ -228,7 +228,7 @@ public class IntroHTMLGenerator { /** * Add any browser-specific rendering quirks - * + * * @param indentLevel */ private void addBrowserRenderingDirectives(HTMLElement head, int indentLevel) { @@ -272,18 +272,18 @@ public class IntroHTMLGenerator { /** * Generates the BODY element and its content: - * + * * <pre> - * - * + * + * * <BODY> * <DIV id="pageId" class="pageClass"> * page content * </DIV> * </BODY> - * + * * </pre> - * + * * @param indentLevel * the number of indents to insert before the element when it is printed * @return the body HTMLElement @@ -317,7 +317,7 @@ public class IntroHTMLGenerator { /** * Given an IntroElement, generate the appropriate HTMLElement - * + * * @param element * the IntroElement * @param indentLevel @@ -343,7 +343,7 @@ public class IntroHTMLGenerator { case AbstractIntroElement.IMAGE: return generateIntroImage((IntroImage) element, indentLevel); case AbstractIntroElement.HR: - return generateIntroSeparator((IntroSeparator) element, indentLevel); + return generateIntroSeparator((IntroSeparator) element, indentLevel); case AbstractIntroElement.TEXT: return generateIntroText((IntroText) element, indentLevel); case AbstractIntroElement.PAGE_TITLE: @@ -357,17 +357,17 @@ public class IntroHTMLGenerator { /** * Create a div element and its content from an IntroDiv: - * + * * <pre> - * - * + * + * * <div id="attrvalue"> * <h4><span class="div-label">attrvalue</span><h4> * any defined divs, links, html, images, text, includes * </div> - * + * * </pre> - * + * * @param element * the IntroDiv * @param indentLevel @@ -400,11 +400,11 @@ public class IntroHTMLGenerator { StringBuffer call = new StringBuffer(); call.append("return (toggleSection('");//$NON-NLS-1$ call.append(clientId); - call.append("','");//$NON-NLS-1$ + call.append("','");//$NON-NLS-1$ call.append(toggleClosedId); - call.append("','");//$NON-NLS-1$ + call.append("','");//$NON-NLS-1$ call.append(toggleOpenId); - call.append("'))"); //$NON-NLS-1$ + call.append("'))"); //$NON-NLS-1$ link.addAttribute("onClick", call.toString()); //$NON-NLS-1$ link.addContent(divLabel); divElement.addContent(link); @@ -427,7 +427,7 @@ public class IntroHTMLGenerator { IIntroConstants.PLUGIN_ID)); toggleImageOpen.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS, "section-toggle-image-open"); //$NON-NLS-1$ if (element.isExpanded()) - toggleImageOpen.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE, "display: inline"); //$NON-NLS-1$ + toggleImageOpen.addAttribute(IIntroHTMLConstants.ATTRIBUTE_STYLE, "display: inline"); //$NON-NLS-1$ link.addContent(toggleImageOpen); childContainer = generateDivElement(clientId, indentLevel + 1); childContainer.addAttribute("class", "section-body"); //$NON-NLS-1$//$NON-NLS-2$ @@ -481,17 +481,17 @@ public class IntroHTMLGenerator { /** * Generates an anchor (link) element and its content from an IntroLink: - * + * * <pre> - * + * * <A id=linkId class="link" href=linkHref> * <IMG src="blank.gif"> * <SPAN class="link-label">linkLabel </SPAN> * <P><SPAN>text</SPAN></P> * </A> - * + * * </pre> - * + * * @param element * the IntroLink * @param indentLevel @@ -525,7 +525,7 @@ public class IntroHTMLGenerator { } if (!useTable) { HTMLElement imageDiv = new FormattedHTMLElement(IIntroHTMLConstants.ELEMENT_DIV, indentBase+1, false); - imageDiv.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS, + imageDiv.addAttribute(IIntroHTMLConstants.ATTRIBUTE_CLASS, IIntroHTMLConstants.LINK_EXTRA_DIV); anchor1.addContent(imageDiv); } @@ -533,7 +533,7 @@ public class IntroHTMLGenerator { if (element.getLabel() != null) { HTMLElement label = generateSpanElement(IIntroHTMLConstants.SPAN_CLASS_LINK_LABEL, indentBase + 2); - label.addContent(element.getLabel()); + label.addContent(element.getLabel()); labelAnchor.addContent(label); } IntroText linkText = element.getIntroText(); @@ -562,7 +562,7 @@ public class IntroHTMLGenerator { * content from the referenced file is emitted as-is into a div element. If the type is "embed", * an OBJECT html element is created whose <code>data</code> attribute is equal to the * IntroHTML's <code>src</code> value - * + * * @param element * the IntroHTML * @param indentLevel @@ -578,13 +578,13 @@ public class IntroHTMLGenerator { /** * Generate an image element from an IntroImage: - * + * * <pre> - * + * * <IMG src=imageSrc id=imageId> - * + * * </pre> - * + * * @param element * the IntroImage * @param indentLevel @@ -598,7 +598,7 @@ public class IntroHTMLGenerator { imageElement.addAttribute(IIntroHTMLConstants.ATTRIBUTE_ID, element.getId()); return imageElement; } - + private HTMLElement generateIntroSeparator(IntroSeparator element, int indentLevel) { HTMLElement hrElement = new FormattedHTMLElement(IIntroHTMLConstants.ELEMENT_HR, indentLevel, false); if (element.getId() != null) @@ -612,14 +612,14 @@ public class IntroHTMLGenerator { * Generate a paragraph (<P>) element from an IntroText. The paragraph element will * contain a span element that will contain the actual text. Providing the span element provides * additional flexibility for CSS designers. - * + * * <pre> - * - * + * + * * <P><SPAN>spanContent</SPAN></P> - * + * * </pre> - * + * * @param element * the IntroText * @param indentLevel @@ -659,16 +659,16 @@ public class IntroHTMLGenerator { /** * Generate "inline" content from an IntroHTML. The content from the file referenced by the * IntroHTML's <code>src</code> attribute is emitted as-is into a div element: - * + * * <pre> - * - * + * + * * <div id="attrvalue" class="attrvalue2"> * content from file specified in src attribute * </div> - * + * * </pre> - * + * * @param element * the IntroHTML * @param indentLevel @@ -694,7 +694,7 @@ public class IntroHTMLGenerator { /** * Includes HTML content that is created by an IIntroContentProvider implementation. - * + * * @param element * @param indentLevel * @return @@ -739,15 +739,15 @@ public class IntroHTMLGenerator { /** * Generate "embedded" content from an IntroHTML. An OBJECT html element is created whose * <code>data</code> attribute is equal to the IntroHTML's <code>src</code> value. - * + * * <pre> - * + * * <OBJECT type="text/html" data="attrvalue"> * alternative text in case the object can not be rendered - * </OBJECT> - * + * </OBJECT> + * * </pre> - * + * * @param element * the IntroHTML * @param indentLevel @@ -786,13 +786,13 @@ public class IntroHTMLGenerator { /** * Generates the BASE element for the head of the html document. Each document can have only one * base element - * + * * <pre> - * - * + * + * * <BASE href=baseURL> * </pre> - * + * * @param indentLevel * @param baseURL * @return @@ -807,13 +807,13 @@ public class IntroHTMLGenerator { /** * Generates the style element that goes into HEAD: - * + * * <pre> - * + * * <style type="text/css">HTML, IMG { border: 0px; } </style> - * + * * </pre> - * + * * @param indentLevel * the number of indents to insert before the element when it is printed * @return the style HTMLElement @@ -823,9 +823,9 @@ public class IntroHTMLGenerator { style.addAttribute(IIntroHTMLConstants.ATTRIBUTE_TYPE, IIntroHTMLConstants.LINK_STYLE); style.addContent(IIntroHTMLConstants.STYLE_HTML); IntroTheme theme = introPage.getModelRoot().getTheme(); - if (theme != null && theme.isScalable() + if (theme != null && theme.isScalable() && FontSelection.FONT_RELATIVE.equals(FontSelection.getFontStyle())) { - String sizeStyle = FontSelection.generatePageFontStyle(); + String sizeStyle = FontSelection.generatePageFontStyle(); style.addContent(sizeStyle); } return style; @@ -833,13 +833,13 @@ public class IntroHTMLGenerator { /** * Generates the title element and its content: - * + * * <pre> - * + * * <TITLE>intro title</TITLE> - * + * * </pre> - * + * * @param title * the title of this intro page * @param indentLevel @@ -856,13 +856,13 @@ public class IntroHTMLGenerator { /** * Generates a link element that refers to a cascading style sheet (CSS): - * + * * <pre> - * - * + * + * * <LINK rel="stylesheet" style="text/css" href="style sheet"> * </pre> - * + * * @param href * the value of the href attribute for this link element * @param indentLevel @@ -881,13 +881,13 @@ public class IntroHTMLGenerator { /** * Generate an anchor element: - * + * * <pre> - * + * * <A id=linkId class=linkClass href=linkHref> </A> - * + * * </pre> - * + * * @param link * the IntroLink element that contains the value for the id and href attributes * @param indentLevel @@ -909,16 +909,16 @@ public class IntroHTMLGenerator { /** * Generates a div block that contains a header and span element: - * + * * <pre> - * - * + * + * * <DIV id=divId> * <H><SPAN>spanContent </SPAN> </H> * </DIV> - * + * * </pre> - * + * * @param divId * the id of the div to create * @param divClass @@ -945,13 +945,13 @@ public class IntroHTMLGenerator { * Generates a span element inside a text element, where the text element can be a P * (paragraph), or any of the H (Header) elements. Providing the span element provides * additional flexibility for CSS designers. - * + * * <pre> - * + * * <P><SPAN>spanContent</SPAN></P> - * + * * </pre> - * + * * @param type * the type of text element to create (e.g., P, H1, H2, etc) * @param spanID @@ -986,7 +986,7 @@ public class IntroHTMLGenerator { /** * Generates a DIV element with the provided indent, id, and class. - * + * * @param divId * value for the div's id attribute * @param divClass @@ -1003,7 +1003,7 @@ public class IntroHTMLGenerator { /** * Generates a DIV element with the provided indent and id. - * + * * @param divId * value for the div's id attribute * @param indentLevel @@ -1019,14 +1019,14 @@ public class IntroHTMLGenerator { /** * Generates an IMG element: - * + * * <pre> - * - * + * + * * <IMG src=imageSrc alt=altText> - * + * * </pre> - * + * * @param imageSrc * the value to be supplied to the src attribute * @param indentLevel @@ -1068,14 +1068,14 @@ public class IntroHTMLGenerator { /** * Generate a span element - * + * * <pre> - * + * * <SPAN class=spanClass> </SPAN> - * - * + * + * * </pre> - * + * * @param spanClass * the value to be supplied to the class attribute * @param indentLevel @@ -1090,12 +1090,12 @@ public class IntroHTMLGenerator { /** * Generate a span element - * + * * <pre> - * + * * <iframe src="localPage1.xhtml" frameborder="1" scrolling="auto" longdesc="localPage1.xhtml"> * </pre> - * + * * @param spanClass * the value to be supplied to the class attribute * @param indentLevel @@ -1129,7 +1129,7 @@ public class IntroHTMLGenerator { * content in the form of a StringBuffer. If the file read contains substitution segments of the * form $plugin:plugin_id$ then this method will make the proper substitution (the segment will * be replaced with the absolute path to the plugin with id plugin_id). - * + * * @param src - * the file that contains the target conent * @param charsetName - @@ -1198,7 +1198,7 @@ public class IntroHTMLGenerator { * substitution string is of the form: <code>$plugin:plugin_id$</code> where plugin_id is the * valid id of an installed plugin. The substitution string will be replaced with the absolute * path to the plugin. - * + * * An example usage of the string substution: The html file <code>inline.html</code> is * included in your intro via the html inline mechanism . This file needs to reference a * resource that is located in another plugin. The following might be found in inline.html: @@ -1208,7 +1208,7 @@ public class IntroHTMLGenerator { * is read in, the relevant section will be replaced as follows: <code> * <a href="file:/install_path/plugins/test.plugin/html/test.html">link to file</a> * </code> - * + * */ private static class PluginIdParser { @@ -1244,7 +1244,7 @@ public class IntroHTMLGenerator { * above conditions are not met, no substitution occurs. If the above conditions are met, * the content between (and including) the opening and closing "$" characters will be * replaced by the absolute path to the plugin - * + * * @return */ protected String parsePluginId() { @@ -1288,10 +1288,10 @@ public class IntroHTMLGenerator { * expected characters are found, they will be appended to the tokenContent StringBuffer and * the method will return true. If they are not found, false is returned and the caller * should reset the BufferedReader to the position it was in before this method was called. - * + * * Resetting the reader ensures that the characters read in this method can be re-examined * in case one of them happens to be the beginning of a valid substitution segment. - * + * * @return true if the next characters match <code>plugin:</code>, and false otherwise. */ private boolean findValidPluginSegment() { @@ -1320,10 +1320,10 @@ public class IntroHTMLGenerator { * SUBSTITUTION_END character is found, the method looks up the plugin id that has been * built up to see if it is a valid id. If so, return the absolute path to that plugin. If * not, return null. - * + * * This method assumes that the reader is positioned just after a valid <code>plugin:</code> * segment in a substitution string. - * + * * @return absolute path of the plugin id, if valid. null otherwise */ private String getPluginPath() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractBaseIntroElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractBaseIntroElement.java index b04b284af..53691f916 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractBaseIntroElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractBaseIntroElement.java @@ -51,7 +51,7 @@ public abstract class AbstractBaseIntroElement extends AbstractIntroIdElement { /** * Filter this element out based on the presentation kind. - * + * */ private boolean checkFilterState() { if (this.isOfType(AbstractIntroElement.MODEL_ROOT)) @@ -69,7 +69,7 @@ public abstract class AbstractBaseIntroElement extends AbstractIntroIdElement { public String getStyleId() { return style_id; } - + @Override protected void loadFromParent() { style_id = getAttribute(getElement(), ATT_STYLE_ID); @@ -88,7 +88,7 @@ public abstract class AbstractBaseIntroElement extends AbstractIntroIdElement { * this element has been added to the model, and it has a parent. Also, this * method will not be valid if the UI has not been loaded yet because it it * the creation of the UI that determines the presentation details. - * + * * @return Returns the isFiltered. */ public boolean isFiltered() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java index 0b1765dd6..7924e8ca0 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroContainer.java @@ -70,7 +70,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Get the children of this container. Loading children and resolving * includes and extension is delayed until this method call. - * + * * @return Returns all the children of this container. */ public AbstractIntroElement[] getChildren() { @@ -86,7 +86,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { resolveChildren(); Vector filtered = filterChildren(children); - + AbstractIntroElement[] childrenElements = (AbstractIntroElement[]) convertToModelArray( filtered, AbstractIntroElement.ELEMENT); return childrenElements; @@ -99,7 +99,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * <p> * <code> * int elementMask = IntroElement.IMAGE | IntroElement.DEFAULT_LINK; - * int elementMask = IntroElement.ABSTRACT_CONTAINER; + * int elementMask = IntroElement.ABSTRACT_CONTAINER; * </code> * The return type is determined depending on the mask. If the mask is a * predefined constant in the IntroElement, and it does not correspond to an @@ -111,7 +111,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * <code> * Introgroup[] groups = (IntroGroup[])page.getChildrenOfType(IntroElement.GROUP); * </code> - * + * * However, if the element mask is not homogenous (for example: LINKS | * GROUP) then the returned array must be cast to an array of * IntroElements.For exmaple, the following code gets all images and links @@ -120,10 +120,10 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * <p> * <code> * int elementMask = IntroElement.IMAGE | IntroElement.DEFAULT_LINK; - * IntroElement[] imagesAndLinks = + * IntroElement[] imagesAndLinks = * (IntroElement[])page.getChildrenOfType(elementMask); * </code> - * + * * @return An array of elements of the right type. If the container has no * children, or no children of the specified types, returns an empty * array. @@ -149,7 +149,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * IntroElement instances. If elementMask is a predefined model type (ie: * homogenous), then return array of corresponding type. Else, returns an * array of IntroElements. - * + * * @param vector */ private Object[] convertToModelArray(Vector vector, int elementMask) { @@ -205,7 +205,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { src = new AbstractIntroElement[size]; break; } - + vector.copyInto(src); return src; @@ -219,7 +219,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { protected void loadChildren() { // init the children vector. old children are disposed automatically. children = new Vector<>(); - + NodeList nodeList = element.getChildNodes(); Vector<Node> vector = new Vector<>(); @@ -241,7 +241,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Adds the given elements as children of this container, before the * specified index. - * + * * @param childElements */ protected void insertElementsBefore(Element[] childElements, Bundle bundle, @@ -263,7 +263,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Adds the given elements as children of this container, before the * specified element. The element must be a direct child of this container. - * + * * @param childElements */ protected void insertElementsBefore(Element[] childElements, Bundle bundle, @@ -280,7 +280,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Adds a child to this container, depending on its type. Subclasses may * override if there is a child specific to the subclass. - * + * * @param childElements */ protected AbstractIntroElement getModelChild(Element childElement, @@ -340,7 +340,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * and adds it as a child of this current container. If target is not a * group, or any element that can be included in a group, ignore this * include. - * + * * @param include */ private void resolveInclude(IntroInclude include) { @@ -361,7 +361,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * Filters the appropriate elements from the given Vector, according to the current * environment. For example, if one of the elements has a tag to filter for os=linux and * the os is win32, the element will not be returned in the resulting Vector. - * + * * @param unfiltered the unfiltered elements * @return a new Vector with elements filtered */ @@ -376,12 +376,12 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { } return filtered; } - + /** * Find the target element pointed to by the path in the include. It is * assumed that configId always points to an external config, and not the * same config of the inlcude. - * + * * @param include * @param path * @return @@ -406,7 +406,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * model.<br> * ps: This method could be a static method, but left as instance for model * enhancements. - * + * * @param model * @param path * @return @@ -417,7 +417,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { String[] pathSegments = StringUtil.split(path, "/"); //$NON-NLS-1$ if (container == null) return null; - + AbstractIntroElement target = container.findChild(pathSegments[0]); if (target == null) // there is no direct child with the specified first path segment. @@ -437,7 +437,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { } return target; } - + public AbstractIntroElement findTarget(AbstractIntroContainer container, String path, String extensionId) { // resolve path segments if they are incomplete. @@ -465,7 +465,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * searches direct children for the first child with the given id. The type * of the child can be any model element that has an id. ie: * AbstractIntroIdElement - * + * * @see org.eclipse.ui.internal.intro.impl.model.IntroElement#getType() */ public AbstractIntroElement findChild(String elementId) { @@ -477,7 +477,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * of the child must be of the passed model types mask. This method handles * the 3.0 style model for content. Pages enhance this behavior with DOM * apis. - * + * * @see org.eclipse.ui.internal.intro.impl.model.IntroElement#getType() */ public AbstractIntroElement findChild(String elementId, int elementMask) { @@ -537,7 +537,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { * plugin. Also note that when including a container, it must be resolved * otherwise reparenting will cause includes in this target container to * fail. - * + * * @param include * @param target */ @@ -579,11 +579,11 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Creates a clone of the given target node. A clone is create by simply * recreating that protion of the model. - * + * * Note: looked into the clonable interface in Java, but it was not used * because it makes modifications/additions to the model harder to maintain. * Will revisit later. - * + * * @param targer * @return */ @@ -617,7 +617,7 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Returns the element. - * + * * @return */ @Override @@ -642,13 +642,13 @@ public abstract class AbstractIntroContainer extends AbstractBaseIntroElement { /** * Adds a model element as a child. Caller is responsible for inserting * model elements that rea valid as children. - * + * * @param child */ public void addChild(AbstractIntroElement child) { children.add(child); } - + public void removeChild(AbstractIntroElement child) { children.remove(child); } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java index 2e1eaba2f..13adf8cf7 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroElement.java @@ -139,12 +139,12 @@ public abstract class AbstractIntroElement implements Cloneable { * Type constant which identifies am injected IFrame model element. */ public static final int INJECTED_IFRAME = 1 << 17; - + /** * Type constant for the theme element. */ public static final int THEME = 1 << 18; - + /** * Type constant for the hr element. */ @@ -196,7 +196,7 @@ public abstract class AbstractIntroElement implements Cloneable { * Constructor used when model elements are being loaded from an xml content * file. Bundle is propagated down the model to enable resolving resources * relative to the base of the bundle. - * + * * @param element * @param pd */ @@ -214,7 +214,7 @@ public abstract class AbstractIntroElement implements Cloneable { * In the case of a configExtension, it is set to point to the relative * position of the parent folder that holds the extension. Only when needed, * the base field is stored in a model element. This saves memory. - * + * * @param element * @param pd */ @@ -229,13 +229,13 @@ public abstract class AbstractIntroElement implements Cloneable { * Returns the configuration element from which this intro element was * loaded. In the case of extension, returns the configuration element of * the defining extension. - * + * * @return */ public IConfigurationElement getCfgElement() { return cfgElement instanceof IConfigurationElement?(IConfigurationElement)cfgElement:null; } - + public Element getElement() { return cfgElement instanceof Element?(Element)cfgElement:null; } @@ -244,7 +244,7 @@ public abstract class AbstractIntroElement implements Cloneable { * DOM getAttribute retruns an empty string (not null) if attribute is not * defined. Override this behavior to be consistent with Intro Model, and * IConfiguration element. - * + * * @param element * @param att * @return @@ -264,7 +264,7 @@ public abstract class AbstractIntroElement implements Cloneable { /** * Util method to parse a comma separated list of values - * + * * @param element * @param att * @return @@ -278,7 +278,7 @@ public abstract class AbstractIntroElement implements Cloneable { if (root!=null) { for (int i = 0; i < splitValues.length; i++) { splitValues[i] = root.resolveVariables(splitValues[i]); - } + } } return splitValues; } @@ -289,7 +289,7 @@ public abstract class AbstractIntroElement implements Cloneable { */ return null; } - + protected void loadFromParent() { } @@ -298,7 +298,7 @@ public abstract class AbstractIntroElement implements Cloneable { * Returns the plugin descriptor of the plugin from which this intro element * was loaded. In the case of extension, returns the plugin descriptor of * the plugin defining the extension. - * + * * @return */ public Bundle getBundle() { @@ -310,7 +310,7 @@ public abstract class AbstractIntroElement implements Cloneable { /** * Returns the specific model type of this intro element. To be implemented * by all subclasses. - * + * * @return returns one of the model class types defined in this class. */ public abstract int getType(); @@ -331,7 +331,7 @@ public abstract class AbstractIntroElement implements Cloneable { * <li>for Head elements that are children of Implementation elements * (shared Heads), it returns the holding presentation element.</li> * </ul> - * + * * @return returns the parent of this intro element. Null only for model * root. */ @@ -382,7 +382,7 @@ public abstract class AbstractIntroElement implements Cloneable { return (AbstractIntroPage) parent; return null; } - + public IntroModelRoot getModelRoot() { // return yourself if you are a model root. if (isOfType(AbstractIntroElement.MODEL_ROOT)) @@ -397,7 +397,7 @@ public abstract class AbstractIntroElement implements Cloneable { parent = parent.getParent(); if (parent.isOfType(MODEL_ROOT)) return (IntroModelRoot) parent; - return null; + return null; } @@ -409,7 +409,7 @@ public abstract class AbstractIntroElement implements Cloneable { * int elementMask = IntroElement.ABSTRACT_CONTAINER; * int elementMask = IntroElement.DIV | IntroElement.DEFAULT_LINK; * </code> - * + * * @param elementMask * element mask formed by bitwise OR of element type constants * defined in this class. @@ -428,7 +428,7 @@ public abstract class AbstractIntroElement implements Cloneable { * <code> * int elementMask = IntroElement.DIV | IntroElement.DEFAULT_LINK; * </code> - * + * * @return <code>true</code> if all elements are of the right type, and * <code>false</code> if the list is empty, or at least one * element is not of the specified types. @@ -459,13 +459,13 @@ public abstract class AbstractIntroElement implements Cloneable { } - + public String getMixinStyle() { return mixinStyle; } - + public void setMixinStyle(String mixinStyle) { this.mixinStyle = mixinStyle; } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroIdElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroIdElement.java index ecb5388f8..2f499d2a2 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroIdElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroIdElement.java @@ -19,7 +19,7 @@ import org.w3c.dom.Element; * An Intro Config component that has an id attribute. It is used as a base * class for all config elements that can take an id, and hence are valid * targets for includes and finds. - * + * */ public abstract class AbstractIntroIdElement extends AbstractIntroElement { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPage.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPage.java index dc3f9fb8e..8527efbd9 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPage.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPage.java @@ -80,7 +80,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { // DOM representing XHTML content. DOM is only cached in the case of XHTML // content. private Document dom; - + private DocumentProcessor domProcessor; // set when the content file is loaded (ie: loadChildren is called) @@ -125,7 +125,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * different from the bundle for all the other pages. Only pages do this * logic and so other model objects might have the wrong bundle cached if * the resource was loaded from an nl directory. - * + * * @param element */ AbstractIntroPage(Element element, Bundle bundle, String base) { @@ -167,20 +167,20 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { url = ModelUtil.resolveURL(base, url, bundle); } - + @Override public void setParent(AbstractIntroElement parent) { super.setParent(parent); if (content == null) init(element, getBundle(), initialBase); } - + /** * Returns unresolved content value as found in the source file. * the source file. * @return the unresolved content value */ - + public String getRawContent() { return getAttribute(element, ATT_CONTENT); } @@ -189,7 +189,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Initialize styles. Take first style in style attribute and make it the * page style. Then put other styles in styles vectors. Make sure to resolve * each style. - * + * * @param element * @param bundle */ @@ -225,7 +225,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * The page's title. Each page can have one title. - * + * * @return Returns the title of this page. */ public String getTitle() { @@ -267,7 +267,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * <p> * Note: this call needs to get all the children of this page, and so it * will resolve this page. might be expensive. - * + * * @return Returns all the inherited styles of this page. Returns an empty * array if page is not expandable or does not have inherited * styles. @@ -291,7 +291,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * resources from the inherited target plugin. Note: this call needs to get * all the children of this page, and so its will resolve this page. might * be expensive. - * + * * @return Returns all the inherited styles of this page. Returns an empty * hashtable if page is not expandable, does not have any includes, * or has includes that do not merge styles. @@ -306,7 +306,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Adds the given style to the list. Style is not added if it already exists * in the list. - * + * * @param style */ protected void addStyle(String style) { @@ -330,7 +330,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Adds the given style to the list.Style is not added if it already exists * in the list. - * + * * @param altStyle */ protected void addAltStyle(String altStyle, Bundle bundle) { @@ -344,7 +344,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Util method to add given styles to the list. - * + * */ protected void addStyles(String[] styles) { if (styles == null) @@ -394,7 +394,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Override parent behavior to lazily initialize styles vectors. This will * only be called once, if resolved == false. In the case of DOM model, * resolve this page's full DOM. - * + * * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroContainer#resolveChildren() */ @Override @@ -411,7 +411,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Override parent behavior to add support for HEAD & Title element in pages * only, and not in divs. - * + * * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroContainer#getModelChild(org.eclipse.core.runtime.IConfigurationElement) */ @Override @@ -436,7 +436,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Returns all head contributions in this page. There can be more than one * head contribution in the page; - * + * * @return */ public IntroHead[] getHTMLHeads() { @@ -501,7 +501,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Load the xml content from the introContent.xml file pointed to by the * content attribute, and loaded into the passed DOM. Load the first page * with correct id from this content file. - * + * * @param dom */ private void loadXMLContent(Document dom) { @@ -563,7 +563,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Returns the DOM representing an external XHTML file. May return null if * extension content is 3.0 format. The page is resolved before returning, * meaning includes are resolved, and the base of the page is defined. - * + * * @return */ public Document getResolvedDocument() { @@ -577,7 +577,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Returns the DOM representing an external XHTML file. May return null if * extension content is 3.0 format. The page is NOT resolved before * returning. It is retruned as given by the dom parser. - * + * * @return */ public Document getDocument() { @@ -592,7 +592,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Returns whether or not we have an XHTML page as the content for this * page. The XHTML page is defined through the content attribute. This * method forces the content file to be parsed and loaded in memory. - * + * * @return */ public boolean isXHTMLPage() { @@ -614,7 +614,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * whether or not an xmlns was used in the xml. note: could not have used * inheritance from parent container because return type for parent is intro * legacy model. - * + * */ public Element findDomChild(String id, String localElementName) { if (!loaded) @@ -626,7 +626,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Search for any element with the given id. - * + * * @param id * @return */ @@ -670,7 +670,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { } UAElement element = UAElementFactory.newElement(dom.getDocumentElement()); domProcessor.process(element, null); - + // and resolve includes. resolveIncludes(); @@ -724,7 +724,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { * Find the target Element pointed to by the path in the include. It is * assumed that configId always points to an external config, and not the * same config of the inlcude. - * + * * @param include * @param path * @return @@ -749,7 +749,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Finds the child element that corresponds to the given path in the passed * model. - * + * * @param model * model containing target path. * @param path @@ -814,7 +814,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Used when cloning pages to assign a unique id. Cache original id before * setting. - * + * * @param id */ public void setId(String id) { @@ -846,7 +846,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Return true if this page is a cloned page that has an IFrame. - * + * * @return */ public boolean isIFramePage() { @@ -863,7 +863,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Set the url of the embedded IFrame, if this page is an IFrame page. - * + * * @param url */ public void setIFrameURL(String url) { @@ -874,7 +874,7 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { /** * Return the url of the embedded IFrame, if this page is an IFrame page. - * + * * @param url */ public String getIFrameURL() { @@ -889,10 +889,10 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { public String getInitialBase() { return initialBase; } - + /** * Return the url of the embedded IFrame, if this page is an IFrame page. - * + * * @param url */ public boolean injectSharedStyle() { @@ -900,13 +900,13 @@ public abstract class AbstractIntroPage extends AbstractIntroContainer { } /** - * Returns true if this is a dynamicpage or not. + * Returns true if this is a dynamicpage or not. * @return Returns the isDynamic. */ public boolean isDynamic() { return isDynamic; } - + /** * @return Returns the url. */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPartImplementation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPartImplementation.java index 57ba999b5..e67662aa7 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPartImplementation.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/AbstractIntroPartImplementation.java @@ -35,7 +35,7 @@ import org.eclipse.ui.intro.config.CustomizableIntroPart; * instantiated from plugin markup and so we need a default constructor, * including in subclasses. It has some base methods, including maintaining a * history of navigation locations. Also, dynamic awarness is honored here. - * + * */ public abstract class AbstractIntroPartImplementation { @@ -121,7 +121,7 @@ public abstract class AbstractIntroPartImplementation { /** * Creates the UI based on this implementation class. . - * + * * @param parent */ public abstract void createPartControl(Composite parent); @@ -130,7 +130,7 @@ public abstract class AbstractIntroPartImplementation { * Called when the init method is called in the IIntroPart. Subclasses may * extend, for example to get the passed Memento. When extending, make sure * you include a call to super. - * + * * @param introPart */ public void init(IIntroPart introPart, IMemento memento) { @@ -156,7 +156,7 @@ public abstract class AbstractIntroPartImplementation { /** * Updates the UI navigation history with either a real URL. - * + * * @param location */ public void updateHistory(String location) { @@ -166,7 +166,7 @@ public abstract class AbstractIntroPartImplementation { /** * Updates the UI navigation history with a page ID. - * + * * @param pageId */ public void updateHistory(AbstractIntroPage page) { @@ -178,7 +178,7 @@ public abstract class AbstractIntroPartImplementation { /** * Subclasses must implement to set the state of the navigation actions in * the toolbar. - * + * */ public abstract void setFocus(); @@ -186,7 +186,7 @@ public abstract class AbstractIntroPartImplementation { /** * Subclasses must implement to update the intro view actions when history * is updated. - * + * */ protected abstract void updateNavigationActionsState(); @@ -224,7 +224,7 @@ public abstract class AbstractIntroPartImplementation { * Called when the Intro changes state. This method should not be * subclassed. It adds performance logging calls. Subclasses must implement * doStandbyStateChanged instead. - * + * * @param standby */ public void standbyStateChanged(boolean standby, boolean isStandbyPartNeeded) { @@ -305,12 +305,12 @@ public abstract class AbstractIntroPartImplementation { * about the most recently visited intro page. In static case, the last HTML * page is remembered. In dynamic case, the last UI page or HTML page is * remembered. - * + * * Note: This method saves the last visited intro page in a dynamic case. * Subclasses need to extend to get the desired behavior relavent to the * specific implementation. Broswer implementation needs to cache an http * web page, if it happens to be the last page visited. - * + * * @param memento */ public void saveState(IMemento memento) { @@ -323,7 +323,7 @@ public abstract class AbstractIntroPartImplementation { * memento. If a given implementation requires saving alternative * information (e.g., information about the most recently visited static * page) it should override this method. - * + * * @param memento */ protected void saveCurrentPage(IMemento memento) { @@ -376,7 +376,7 @@ public abstract class AbstractIntroPartImplementation { /** * Support dynamic awarness. Clear cached models first, then update UI by * delegating to implementation. - * + * * @see org.eclipse.core.runtime.IRegistryChangeListener#registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent) */ public void registryChanged(IRegistryChangeEvent event) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/ExtensionMap.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/ExtensionMap.java index 45666fa80..01fd0a870 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/ExtensionMap.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/ExtensionMap.java @@ -16,20 +16,20 @@ import java.util.Map; /** * This package maintains the mapping between extension ids in the registry and extension ids - * as defined in extension files. It also allows a configurer to change the page which will be + * as defined in extension files. It also allows a configurer to change the page which will be * displayed when the welcome screen is shown. */ public class ExtensionMap { - + private static ExtensionMap instance; private static String startPage; private Map<String, String> extensions = new HashMap<>(); - + private ExtensionMap() { - + } - + /** * Get the one and only instance of this class * @return @@ -51,9 +51,9 @@ public class ExtensionMap { extensions.put(anchorId, pluginId); } } - + /** - * Lookup in which plugin + * Lookup in which plugin * @param anchorId * @return the plugin which contributed that anchor */ @@ -76,9 +76,9 @@ public class ExtensionMap { public String getStartPage() { return startPage; } - + /** - * Allows a configurer to override the page which is displayed when + * Allows a configurer to override the page which is displayed when * the welcome screen is first shown * @param contentPage */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java index 4d7f6a4c8..ecf503b23 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/History.java @@ -50,7 +50,7 @@ public class History { /** * returns the history page. If iframe page, updated to correct url. - * + * * @return */ AbstractIntroPage getPage() { @@ -91,7 +91,7 @@ public class History { /** * Updates the UI navigation history with either a real URL, or a page ID. - * + * * @param pageId */ public void updateHistory(String location) { @@ -104,7 +104,7 @@ public class History { /** * Updates the UI navigation history with either a real URL, or a page ID. - * + * * @param page */ public void updateHistory(AbstractIntroPage page) { @@ -162,7 +162,7 @@ public class History { // point the nav location to the end of the vector. navigationLocation = getHistoryEndPosition(); } - + public void removeLastHistory() { history.remove(getHistoryEndPosition()); // point the nav location to the end of the vector. @@ -180,7 +180,7 @@ public class History { /** * Return the position of the last element in the navigation history. If * vector is empty, return 0. - * + * * @param vector * @return */ @@ -199,7 +199,7 @@ public class History { /** * Navigate forward in the history. - * + * * @return */ public void navigateHistoryForward() { @@ -221,7 +221,7 @@ public class History { /** * Returns true if the current location in the navigation history represents * a URL. False if the location is an Intro Page id. - * + * * @return Returns the locationIsURL. */ private HistoryObject getCurrentLocation() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroContentProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroContentProvider.java index 43f7acad3..83145aa7b 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroContentProvider.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroContentProvider.java @@ -21,7 +21,7 @@ import org.w3c.dom.Element; * implement the IIntroContentProvider interface. The pluginId attribute can be * used if the class doesn't come from the plugin that defined the markup. The * text content should be used only if we fail to load the class. <br> - * + * * INTRO: model class has access to style-id attribute but it is not used in the * schema. */ @@ -44,7 +44,7 @@ public class IntroContentProvider extends AbstractTextElement { /** * Returns the content provider, which should implement * IIntroContentProvider - * + * * @return Returns the contentProvider. */ public String getClassName() { @@ -53,7 +53,7 @@ public class IntroContentProvider extends AbstractTextElement { /** * Returns the id of the plugin that contains the content provider class - * + * * @return Returns the pluginId. */ public String getPluginId() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroExtensionContent.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroExtensionContent.java index cfb562284..5453202be 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroExtensionContent.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroExtensionContent.java @@ -43,7 +43,7 @@ public class IntroExtensionContent extends AbstractIntroElement { public static final int TYPE_CONTRIBUTION = 0; public static final int TYPE_REPLACEMENT = 1; - + protected static final String ATT_PATH = "path"; //$NON-NLS-1$ protected static final String ATT_ID = "id"; //$NON-NLS-1$ private static final String ATT_STYLE = "style"; //$NON-NLS-1$ @@ -87,12 +87,12 @@ public class IntroExtensionContent extends AbstractIntroElement { bundle); this.base = newBase; } - + // Save the mapping between plugin registry id and base/anchor id String contributor = configExtElement.getContributor().getName(); ExtensionMap.getInstance().putPluginId(anchorId, contributor); } - + public String getId() { return anchorId; } @@ -102,7 +102,7 @@ public class IntroExtensionContent extends AbstractIntroElement { * Initialize styles. Take first style in style attribute and make it the * page style. Then put other styles in styles vectors. Make sure to resolve * each style. - * + * * @param element * @param bundle */ @@ -131,7 +131,7 @@ public class IntroExtensionContent extends AbstractIntroElement { /** * Adds the given style to the list. Style is not added if it already exists * in the list. - * + * * @param style */ protected void addStyle(String style) { @@ -144,7 +144,7 @@ public class IntroExtensionContent extends AbstractIntroElement { /** * Adds the given style to the list.Style is not added if it already exists * in the list. - * + * * @param altStyle */ protected void addAltStyle(String altStyle, Bundle bundle) { @@ -197,7 +197,7 @@ public class IntroExtensionContent extends AbstractIntroElement { * that should be inserted for the extension. If it is a file, all child elements * of body are returned. If it is a file with an id, only the element with the id * is returned. - * + * * @return the elements to be inserted */ public Element[] getElements() { @@ -250,13 +250,13 @@ public class IntroExtensionContent extends AbstractIntroElement { public String getBase() { return base; } - + /** * Extracts the file and id parts of the content attribute. This attribute has two modes - * if you specify a file, it will include the body of that file (minus the body element itself). * If you append an id after the file, only the element with that id will be included. However * we need to know which mode we're in. - * + * * @param bundle the bundle that contributed this extension */ private void extractFileAndId(Bundle bundle) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroGroup.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroGroup.java index 2ab39b642..49e8b7b46 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroGroup.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroGroup.java @@ -38,11 +38,11 @@ public class IntroGroup extends AbstractIntroContainer { IntroGroup(Element element, Bundle bundle, String base) { super(element, bundle, base); } - + @Override protected void loadFromParent() { } - + private void resolve() { // reinitialize if there are variables in the value. if (label==null) { @@ -66,22 +66,22 @@ public class IntroGroup extends AbstractIntroContainer { resolve(); return label; } - + @Override public int getType() { return AbstractIntroElement.GROUP; } - + public boolean isExpandable() { String value=getAttribute(element, ATT_EXPANDABLE); return value!=null && value.equalsIgnoreCase("true"); //$NON-NLS-1$ } - + public boolean isExpanded() { String value=getAttribute(element, ATT_EXPANDED); return value!=null && value.equalsIgnoreCase("true"); //$NON-NLS-1$ } - + @Override protected void loadChildren() { String value = getAttribute(element, ATT_COMPUTED); @@ -102,7 +102,7 @@ public class IntroGroup extends AbstractIntroContainer { addDynamicNodes(this.element, nodes); } } - + private void addDynamicNodes(Element target, IntroElement [] nodes) { for (int i=0; i<nodes.length; i++) { IntroElement node = nodes[i]; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroHTML.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroHTML.java index ccd5d1059..83ceec7f9 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroHTML.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroHTML.java @@ -85,7 +85,7 @@ public class IntroHTML extends AbstractTextElement { /** * Returns the html type. Will be either "inline" or "embed". If not, null * will be returned as if the attibute was nto defined. - * + * * @return Returns the html type value. */ public boolean isInlined() { @@ -111,7 +111,7 @@ public class IntroHTML extends AbstractTextElement { /** * Returns the intro image used as a replacement if this HTML element fails. * May return null if there is no image child. - * + * * @return Returns the introImage. */ public IntroImage getIntroImage() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java index 83aa01834..a13f8bf4b 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroImage.java @@ -42,7 +42,7 @@ public class IntroImage extends AbstractBaseIntroElement { public String getAlt() { return getAttribute(element, ATT_ALT); } - + /** * @return Returns the title. */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarElement.java index d23ded6cf..e2f9c3b2b 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarElement.java @@ -26,7 +26,7 @@ import org.eclipse.ui.intro.config.IntroElement; * An Intro Config component captures launch bar information. It can have * shortcuts and one handle. <br> * ps: Handles are not modeled in a dedicated class, but are handled here. - * + * * @since 3.1 */ public class IntroLaunchBarElement extends AbstractIntroElement { @@ -50,7 +50,7 @@ public class IntroLaunchBarElement extends AbstractIntroElement { * Returns the desired launch bar orientation that results from the desired * location. Valid values are <code>SWT.VERTICAL</code> and * <code>SWT.HORIZONTAL</code>. - * + * * @return */ public int getOrientation() { @@ -63,7 +63,7 @@ public class IntroLaunchBarElement extends AbstractIntroElement { * Returns the location of the launch bar in the workbench window. Valid * values are <code>SWT.RIGHT</code>,<code>SWT.LEFT</code> and * <code>SWT.BOTTOM</code>. - * + * * @return */ public int getLocation() { @@ -113,7 +113,7 @@ public class IntroLaunchBarElement extends AbstractIntroElement { /** * Returns the relative icon path of the handle image. - * + * * @return */ private String getHandleImage() { @@ -126,7 +126,7 @@ public class IntroLaunchBarElement extends AbstractIntroElement { /** * Returns the icon image of the handle, or <code>null</code> if not * defined or found. - * + * * @return */ public ImageDescriptor getHandleImageDescriptor() { @@ -146,7 +146,7 @@ public class IntroLaunchBarElement extends AbstractIntroElement { /** * Returns an array of shorcut elements. - * + * * @return */ public IntroLaunchBarShortcut[] getShortcuts() { @@ -159,16 +159,16 @@ public class IntroLaunchBarElement extends AbstractIntroElement { /** * Creates an array of shortcut elements - * + * */ private void createShortcuts() { shortcuts = new ArrayList<>(); IntroModelRoot model = getModelRoot(); IntroConfigurer configurer = model!=null?model.getConfigurer():null; - + String cvalue = getCfgElement().getAttribute("computed"); //$NON-NLS-1$ boolean computed = cvalue!=null && cvalue.equalsIgnoreCase("true"); //$NON-NLS-1$ - + if (computed && configurer!=null) { IntroElement [] children = configurer.getLaunchBarShortcuts(); for (int i=0; i<children.length; i++) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarShortcut.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarShortcut.java index ba839693d..406f4c5a8 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarShortcut.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLaunchBarShortcut.java @@ -20,7 +20,7 @@ import org.eclipse.ui.intro.config.IntroElement; /** * An Intro Config component that captures launch bar shortcut information. - * + * * @since 3.1 */ public class IntroLaunchBarShortcut extends AbstractIntroElement { @@ -30,14 +30,14 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { private static final String ATT_TOOLTIP = "tooltip"; //$NON-NLS-1$ private static final String ATT_ICON = "icon"; //$NON-NLS-1$ private static final String ATT_URL = "url"; //$NON-NLS-1$ - + private IntroElement ielement; - + IntroLaunchBarShortcut(IConfigurationElement element, IntroElement ielement) { super(element); this.ielement = ielement; } - + IntroLaunchBarShortcut(IConfigurationElement element) { super(element); } @@ -47,7 +47,7 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { public int getType() { return AbstractIntroElement.LAUNCH_BAR_SHORTCUT; } - + private String getAttribute(String name) { if (ielement!=null) return ielement.getAttribute(name); @@ -56,7 +56,7 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { /** * Returns the URL of this shortcut. - * + * * @return */ public String getURL() { @@ -65,7 +65,7 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { /** * Returns the tooltip of this shortcut. - * + * * @return */ public String getToolTip() { @@ -74,7 +74,7 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { /** * Returns the relative icon path of this shortcut. - * + * * @return */ private String getIcon() { @@ -84,7 +84,7 @@ public class IntroLaunchBarShortcut extends AbstractIntroElement { /** * Returns the icon image of this shortcut, or <code>null</code> if not * found. - * + * * @return */ public ImageDescriptor getImageDescriptor() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java index d8ce46549..c9f2b36c9 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroLink.java @@ -81,7 +81,7 @@ public class IntroLink extends AbstractTextElement { /** * Retruns an IntroURL instance if link has a valid intro url. Returns null * otherwise. - * + * * @return Returns the introURL. */ public IntroURL getIntroURL() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java index 4e8c114d4..109c80bc5 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroModelRoot.java @@ -46,7 +46,7 @@ import org.w3c.dom.Node; /** * The root class for the OOBE model. It loads the configuration into the * appropriate classes. - * + * * Model rules: * <ol> * <li>if an attribute is not included in the markup, its value will be null in @@ -133,7 +133,7 @@ public class IntroModelRoot extends AbstractIntroContainer { public ListenerList<IPropertyListener> propChangeListeners = new ListenerList<>(); // a list to hold all loaded DOMs until resolving all configExtensions - // is done. + // is done. private List<ExtensionContent> unresolvedConfigExt = new ArrayList<>(); @@ -172,7 +172,7 @@ public class IntroModelRoot extends AbstractIntroContainer { * extension pages and groups. The presentation is loaded from the * IConfiguration element representing the config. All else is loaded from * xml content file. - * + * */ @Override protected void loadChildren() { @@ -189,7 +189,7 @@ public class IntroModelRoot extends AbstractIntroContainer { Log.warning("Could not find presentation element in intro config."); //$NON-NLS-1$ return; } - + loadTheme(); loadConfigurer(); @@ -232,7 +232,7 @@ public class IntroModelRoot extends AbstractIntroContainer { * presentation as the first child, so use that fact. This method is used * for dynamic awarness to enable replacing the new presentation with the * existing one after a model refresh. - * + * * @param presentation */ public void setPresentation(IntroPartPresentation presentation) { @@ -262,7 +262,7 @@ public class IntroModelRoot extends AbstractIntroContainer { IntroPartPresentation.ATT_HOME_PAGE_ID); return presentationElement; } - + private void loadConfigurer() { String cname = getCfgElement().getAttribute(ATT_CONFIGURER); if (cname!=null) { @@ -277,7 +277,7 @@ public class IntroModelRoot extends AbstractIntroContainer { } } } - + private void determineHomePage() { String pid = Platform.getProduct().getId(); startPageId = getProcessPreference("INTRO_START_PAGE", pid); //$NON-NLS-1$ @@ -308,11 +308,11 @@ public class IntroModelRoot extends AbstractIntroContainer { standbyPage.setStandbyPage(true); } } - + private void loadTheme() { String pid = Platform.getProduct().getId(); String themeId = getProcessPreference("INTRO_THEME", pid); //$NON-NLS-1$ - + IConfigurationElement [] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.intro.configExtension"); //$NON-NLS-1$ IConfigurationElement themeElement=null; for (int i=0; i<elements.length; i++) { @@ -389,9 +389,9 @@ public class IntroModelRoot extends AbstractIntroContainer { for (int i = 0; i < configExtensionElements.length; i++) { processConfigExtension(configExtensionElements[i]); } - + tryResolvingExtensions(); - + // At this stage all pages will be resolved, some contributions may not be // now add all unresolved extensions as model children and log fact. @@ -471,8 +471,8 @@ public class IntroModelRoot extends AbstractIntroContainer { Bundle bundle = BundleUtil.getBundleFromConfigurationElement(configExtElement); String elementBase = getBase(configExtElement); processOneExtension(configExtElement, elementBase, bundle, extensionContentElement); - if (extensionContentElement.hasAttribute("failed")) { //$NON-NLS-1$ - stillUnresolved.add(content); + if (extensionContentElement.hasAttribute("failed")) { //$NON-NLS-1$ + stillUnresolved.add(content); } } unresolvedConfigExt = stillUnresolved; @@ -486,10 +486,10 @@ public class IntroModelRoot extends AbstractIntroContainer { * not include the page and group contributions as part of the model. If * extension content has XHTML content (ie: content attribute is defined) we * load extension DOM into target page dom. - * + * * note: the extension Element is returned to enable creating a child model * element on failure. - * + * * @param * @return */ @@ -506,7 +506,7 @@ public class IntroModelRoot extends AbstractIntroContainer { addUnfilteredExtensions(elements, extensionContents); addUnfilteredExtensions(elements, replacementContents); - + return (Element[])elements.toArray(new Element[elements.size()]); } @@ -515,7 +515,7 @@ public class IntroModelRoot extends AbstractIntroContainer { Element extensionContentElement = extensionContents[i]; if (!UAContentFilter.isFiltered(UAElementFactory.newElement(extensionContentElement), IntroEvaluationContext.getContext())) { elements.add(extensionContentElement); - } + } } } @@ -540,7 +540,7 @@ public class IntroModelRoot extends AbstractIntroContainer { /** * Insert the extension content into the target. - * + * * @param extensionContent * @return */ @@ -582,7 +582,7 @@ public class IntroModelRoot extends AbstractIntroContainer { if (extensionContent.getExtensionType() == IntroExtensionContent.TYPE_REPLACEMENT) { targetElement.getParentNode().removeChild(targetElement); } - + // now handle style inheritance. // Update the parent page styles. skip style if it is null; String[] styles = extensionContent.getStyles(); @@ -599,7 +599,7 @@ public class IntroModelRoot extends AbstractIntroContainer { /** * Insert the extension content (3.0 format) into the target. - * + * * @param extensionContent * @return */ @@ -630,7 +630,7 @@ public class IntroModelRoot extends AbstractIntroContainer { Element [] children = extensionContent.getChildren(); parent.insertElementsBefore(children, bundle, base, target, mixinStyle); } - + private String getMixinStyle(IntroExtensionContent extensionContent) { String path = extensionContent.getPath(); if (!path.endsWith("/@")) //$NON-NLS-1$ @@ -660,7 +660,7 @@ public class IntroModelRoot extends AbstractIntroContainer { * configExtension. If we are extending a shared group do nothing. For * inherited alt-styles, we have to cache the bundle from which we inherited * the styles to be able to access resources in that plugin. - * + * * @param include * @param target */ @@ -686,7 +686,7 @@ public class IntroModelRoot extends AbstractIntroContainer { } /** - * Sets the model state based on all the model classes. + * Sets the model state based on all the model classes. */ private void setModelState(boolean loaded, boolean hasValidConfig) { this.loaded = loaded; @@ -697,7 +697,7 @@ public class IntroModelRoot extends AbstractIntroContainer { * Returns true if there is a valid contribution to * org.eclipse.ui.intro.config extension point, with a valid Presentation, * and pages. - * + * * @return Returns the hasValidConfig. */ public boolean hasValidConfig() { @@ -710,7 +710,7 @@ public class IntroModelRoot extends AbstractIntroContainer { public IntroPartPresentation getPresentation() { return introPartPresentation; } - + public IntroConfigurer getConfigurer() { return configurer; } @@ -721,7 +721,7 @@ public class IntroModelRoot extends AbstractIntroContainer { public AbstractIntroPage getHomePage() { return homePage; } - + /** * @return Returns the root Page. */ @@ -767,7 +767,7 @@ public class IntroModelRoot extends AbstractIntroContainer { /** * Sets the current page. If the model does not have a page with the passed * id, the message is logged, and the model retains its old current page. - * + * * @param currentPageId * The currentPageId to set. * * @param fireEvent @@ -811,7 +811,7 @@ public class IntroModelRoot extends AbstractIntroContainer { /** * Fires a property changed event. Made public because it can be used to * trigger a UI refresh. - * + * * @param propertyId * the id of the property that changed */ @@ -872,7 +872,7 @@ public class IntroModelRoot extends AbstractIntroContainer { * the configExt content files. ie: in plugin.xml. <br> * This method also sets the base attribute on the root element in the DOM * to enable resolving all resources relative to this DOM. - * + * * @return */ protected Document loadDOM(IConfigurationElement cfgElement) { @@ -898,7 +898,7 @@ public class IntroModelRoot extends AbstractIntroContainer { String content = configElement.getAttribute(ATT_CONTENT); return ModelUtil.getParentFolderToString(content); } - + public String resolveVariables(String text) { if (text==null) return null; if (text.indexOf('$')== -1) @@ -942,20 +942,20 @@ public class IntroModelRoot extends AbstractIntroContainer { return "rtl"; //$NON-NLS-1$ } else { return "ltr"; //$NON-NLS-1$ - } + } } - + if (configurer!=null) return configurer.getVariable(variable); return null; } - + public String resolvePath(String extensionId, String path) { if (configurer==null) return null; return configurer.resolvePath(extensionId, path); } - + public IntroTheme getTheme() { return theme; } @@ -963,13 +963,13 @@ public class IntroModelRoot extends AbstractIntroContainer { public String getStartPageId() { return startPageId; } - + private String getProcessPreference(String key, String pid) { String result = Platform.getPreferencesService().getString - (IntroPlugin.PLUGIN_ID, pid + '_' + key, "", null); //$NON-NLS-1$ + (IntroPlugin.PLUGIN_ID, pid + '_' + key, "", null); //$NON-NLS-1$ if (result.length() == 0) { result = Platform.getPreferencesService().getString - (IntroPlugin.PLUGIN_ID, key, "", null); //$NON-NLS-1$ + (IntroPlugin.PLUGIN_ID, key, "", null); //$NON-NLS-1$ } return result; } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroPartPresentation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroPartPresentation.java index cc7fead3d..fcbc602da 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroPartPresentation.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroPartPresentation.java @@ -90,7 +90,7 @@ public class IntroPartPresentation extends AbstractIntroElement { private IMemento memento; /** - * + * */ IntroPartPresentation(IConfigurationElement element) { super(element); @@ -131,7 +131,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Returns the styles associated with the Presentation. May be null if no shared presentation * style is needed, or in the case of static HTML OOBE. - * + * * @return Returns the array of styles or null if not defined. */ public String[] getImplementationStyles() { @@ -140,7 +140,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Returns the type attribute of the implementation picked by this presentation. - * + * * @return Returns the implementationKind. */ public String getImplementationKind() { @@ -155,7 +155,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Returns the model class for the Head element under an implementation. Returns null if there * is no head contribution. - * + * * @param element * @return */ @@ -179,7 +179,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Returns the launch bar element if defined in this presentation, or <code>null</code> * otherwise. - * + * * @since 3.1 * @return */ @@ -211,7 +211,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Creates the UI based on the implementation class. - * + * * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) */ public void createPartControl(Composite parent) { @@ -344,7 +344,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Util method that searches for the given value in a comma separated list of values. The list * is retrieved as an attribute value of OS, WS. - * + * */ private boolean listValueHasValue(String stringValue, String value) { String[] attributeValues = StringUtil.split(stringValue, ","); //$NON-NLS-1$ @@ -382,7 +382,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Creates the actual implementation class. Returns null on failure. - * + * */ private AbstractIntroPartImplementation createIntroPartImplementation(String implementationType) { // quick exits @@ -391,14 +391,14 @@ public class IntroPartPresentation extends AbstractIntroElement { if (!implementationType.equals(BROWSER_IMPL_KIND) && !implementationType.equals(FORMS_IMPL_KIND) && !implementationType.equals(TEXT_IMPL_KIND)) return null; - if (implementationType.equals(BROWSER_IMPL_KIND) && IntroPlugin.DEBUG_NO_BROWSER) + if (implementationType.equals(BROWSER_IMPL_KIND) && IntroPlugin.DEBUG_NO_BROWSER) return null; AbstractIntroPartImplementation implementation = null; try { if (implementationType.equals(BROWSER_IMPL_KIND)) - implementation = //null; - new BrowserIntroPartImplementation(); + implementation = //null; + new BrowserIntroPartImplementation(); else if (implementationType.equals(FORMS_IMPL_KIND)) implementation = new FormIntroPartImplementation(); else @@ -413,7 +413,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Returns the the Customizable Intro Part. may return null if init() has not been called yet on * the presentation. - * + * * @return Returns the introPart. */ public IIntroPart getIntroPart() { @@ -423,7 +423,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Save the current state of the intro. Delegate to the implementation to do the work, as * different implementations may have different requirements. - * + * * @param memento * the memento in which to store state information */ @@ -480,7 +480,7 @@ public class IntroPartPresentation extends AbstractIntroElement { /** * Support dynamic awarness. Clear cached models first, then update UI by delegating to * implementation. - * + * * @see org.eclipse.core.runtime.IRegistryChangeListener#registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent) */ public void registryChanged(IRegistryChangeEvent event) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java index 54ef23355..923da20af 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroSearchParticipant.java @@ -34,13 +34,13 @@ import org.osgi.framework.Bundle; /** * An implementation of SearchParticipant that adds Welcome content into the local help * index so that it can be searched. - * + * */ public class IntroSearchParticipant extends SearchParticipant { private IntroModelRoot model; - + private class TitleAndSummary { String title; String summary; @@ -165,7 +165,7 @@ public class IntroSearchParticipant extends SearchParticipant { addTitle(titleSummary.title, doc); } if (titleSummary.summary != null) { - doc.setSummary(titleSummary.summary); + doc.setSummary(titleSummary.summary); } doc.addContents(contents); return Status.OK_STATUS; @@ -195,11 +195,11 @@ public class IntroSearchParticipant extends SearchParticipant { } if (title != null) { titleSummary.title = title; - } + } if ("page-description".equals(childId)) { //$NON-NLS-1$ - titleSummary.summary = childIntroText.getText(); + titleSummary.summary = childIntroText.getText(); } - } + } if (child instanceof AbstractIntroContainer) { AbstractIntroContainer container = (AbstractIntroContainer) child; if (!"navigation-links".equals(container.getId())) { //$NON-NLS-1$ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroStandbyContentPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroStandbyContentPart.java index 408134009..64eda363e 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroStandbyContentPart.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroStandbyContentPart.java @@ -31,7 +31,7 @@ public class IntroStandbyContentPart extends AbstractIntroIdElement { /** * Note: model class with public constructor because it is not instantiated * by the model root. - * + * * @param element */ public IntroStandbyContentPart(IConfigurationElement element) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroTheme.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroTheme.java index ffd539fd4..0c39a330d 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroTheme.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/IntroTheme.java @@ -27,7 +27,7 @@ public class IntroTheme extends AbstractIntroIdElement { private String path; private Hashtable<String, String> properties; private boolean scalable; - + public IntroTheme(IConfigurationElement element) { super(element); name = element.getAttribute(ATT_NAME); @@ -44,11 +44,11 @@ public class IntroTheme extends AbstractIntroIdElement { public IntroTheme(Element element, Bundle bundle, String base) { super(element, bundle, base); } - + public String getName() { return name; } - + public String getPath() { return path; } @@ -57,15 +57,15 @@ public class IntroTheme extends AbstractIntroIdElement { public int getType() { return THEME; } - + public Map<String, String> getProperties() { return properties; } - + public boolean isScalable() { return scalable; } - + private void loadProperties(IConfigurationElement element) { IConfigurationElement [] children = element.getChildren("property"); //$NON-NLS-1$ if (children.length==0) diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/BaseExtensionPointManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/BaseExtensionPointManager.java index 4d8f4c398..d7de96cc3 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/BaseExtensionPointManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/BaseExtensionPointManager.java @@ -119,7 +119,7 @@ public class BaseExtensionPointManager { * that maps to the correct intro part id. If there is more than one config * thats maps to the same intro part id, log the fact, and return the first * one. If there are non, return null. - * + * * @param configElements * @return */ @@ -150,7 +150,7 @@ public class BaseExtensionPointManager { IConfigurationElement[] configExtensionElements = registry .getConfigurationElementsFor(CONFIG_EXTENSION); - + /* * Extension filter is used for performance testing to only load contributions * from a specific plug-in (fixed data set). @@ -174,7 +174,7 @@ public class BaseExtensionPointManager { /** * Add a model to the cache. This method is private because only this * manager class knows how to load an intro model. - * + * * @param modelId * @param model */ @@ -184,7 +184,7 @@ public class BaseExtensionPointManager { /** * Gets the given model from the cache. - * + * * @param modelId */ protected IntroModelRoot getCachedModel(String configId) { @@ -196,7 +196,7 @@ public class BaseExtensionPointManager { * with an attribute of the given value. If there is more than one * configuration element that maps to the attribute value log the fact, and * return the first one. If there are non, return null. - * + * * @param configElements * @return */ @@ -263,7 +263,7 @@ public class BaseExtensionPointManager { public Map<String, IntroModelRoot> getIntroModels() { return introModels; } - + /* * Internal test hook for restricting which extensions to load. */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ContentProviderManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ContentProviderManager.java index 550400325..fc545bca8 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ContentProviderManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ContentProviderManager.java @@ -89,7 +89,7 @@ public class ContentProviderManager { /** * Retrieve an existing content provider class, or null if never created before. - * + * * @param provider * @return */ @@ -107,7 +107,7 @@ public class ContentProviderManager { /** * Tries to create an intro content provider class. may return null if creation fails. This will * be logged. - * + * * @param provider * @param site * @return diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ExtensionPointManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ExtensionPointManager.java index 80a69e114..18a2eba8a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ExtensionPointManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ExtensionPointManager.java @@ -76,7 +76,7 @@ public class ExtensionPointManager extends BaseExtensionPointManager { /** * Load an intro model given a config id. - * + * * @param configId * @return */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/IntroContentParser.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/IntroContentParser.java index 6555f4966..3f56b59f1 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/IntroContentParser.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/IntroContentParser.java @@ -36,7 +36,7 @@ import org.xml.sax.SAXParseException; /** - * + * */ public class IntroContentParser { @@ -94,7 +94,7 @@ public class IntroContentParser { buffer.append(spe.getLineNumber()); buffer.append(", uri "); //$NON-NLS-1$ buffer.append(spe.getSystemId()); - buffer.append("\n"); //$NON-NLS-1$ + buffer.append("\n"); //$NON-NLS-1$ buffer.append(spe.getMessage()); // Use the contained exception. @@ -123,7 +123,7 @@ public class IntroContentParser { /** * Returned the DOM representing the intro xml content file. May return null * if parsing the file failed. - * + * * @return Returns the document. */ public Document getDocument() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ModelLoaderUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ModelLoaderUtil.java index 162ae121b..17328f01e 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ModelLoaderUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/ModelLoaderUtil.java @@ -29,7 +29,7 @@ public class ModelLoaderUtil { /** * Utility method to validate an elements name. - * + * * @param element * @param validName * @return @@ -48,7 +48,7 @@ public class ModelLoaderUtil { * passed array of elements. If the array is empty, null is returned. If * there is more than one element in the array, the first one is picked, but * this fact is logged. Attribute passed is used for logging. - * + * * @param configElements * @return the first configElement in the array, or null if the array is * empty. @@ -127,7 +127,7 @@ public class ModelLoaderUtil { /** * Util class for creating class instances from plugins. - * + * * @param pluginId * @param className * @return @@ -158,7 +158,7 @@ public class ModelLoaderUtil { /** * Creates a key for the given element. Returns null if any id is null along * the path. - * + * * @param element * @return */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/SharedConfigExtensionsManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/SharedConfigExtensionsManager.java index fe37646d0..ccfc3a9fa 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/SharedConfigExtensionsManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/loader/SharedConfigExtensionsManager.java @@ -78,7 +78,7 @@ public class SharedConfigExtensionsManager { /** * Create an intro standby part or an intro command model class. - * + * * @param element */ private void createModelClass(IConfigurationElement element) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java index 17b942dcc..40734c936 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURL.java @@ -123,7 +123,7 @@ public class IntroURL implements IIntroURL { /** * Prevent creation. Must be created through an IntroURLParser. This * constructor assumed we have a valid intro url. - * + * * @param url */ IntroURL(String action, Properties parameters) { @@ -133,13 +133,13 @@ public class IntroURL implements IIntroURL { /** * Executes whatever valid Intro action is embedded in this Intro URL. - * + * */ @Override public boolean execute() { final boolean[] result = new boolean[1]; Display display = Display.getCurrent(); - + BusyIndicator.showWhile(display, () -> result[0] = doExecute()); return result[0]; } @@ -189,7 +189,7 @@ public class IntroURL implements IIntroURL { // the parameters and the standby state. return runAction(getParameter(KEY_PLUGIN_ID), getParameter(KEY_CLASS), parameters, getParameter(KEY_STANDBY)); - + else if (action.equals(EXECUTE)) // execute a serialized command return executeCommand(getParameter(KEY_COMAND), getParameter(KEY_STANDBY)); @@ -220,7 +220,7 @@ public class IntroURL implements IIntroURL { /** * Sets the into part to standby, and shows the passed standby part, with * the given input. Forces the Intro view to open, if not yet created. - * + * * @param partId * @param input */ @@ -248,10 +248,10 @@ public class IntroURL implements IIntroURL { /** * Set the Workbench Intro Part state. Forces the Intro view to open, if not yet created. - * + * * Historically this value was "true" (show standby) or "false" (show normal). In Neon we add * "close", "standby" and "launchbar". - * + * * @param state * @return true if the intro was shown, or false if the intro could not be shown */ @@ -315,7 +315,7 @@ public class IntroURL implements IIntroURL { return false; } } - + /** * Executes a serialized <code>ParameterizedCommand</code>. Uses * {@link ICommandService#deserialize(String)} to convert the <code>command</code> argument @@ -342,9 +342,9 @@ public class IntroURL implements IIntroURL { return false; } } - + private ICommandService getCommandService() { - IWorkbench wb = PlatformUI.getWorkbench(); + IWorkbench wb = PlatformUI.getWorkbench(); if (wb != null) { Object serviceObject = wb.getAdapter(ICommandService.class); if (serviceObject != null) { @@ -356,7 +356,7 @@ public class IntroURL implements IIntroURL { } private IHandlerService getHandlerService() { - IWorkbench wb = PlatformUI.getWorkbench(); + IWorkbench wb = PlatformUI.getWorkbench(); if (wb != null) { Object serviceObject = wb.getAdapter(IHandlerService.class); if (serviceObject != null) { @@ -475,7 +475,7 @@ public class IntroURL implements IIntroURL { /** * Finds the target page and includes it in passed model. - * + * * @param pageId * @return */ @@ -523,7 +523,7 @@ public class IntroURL implements IIntroURL { /** * Searches all loaded models for the first page with the given id. - * + * * @param pageId * @return */ @@ -541,7 +541,7 @@ public class IntroURL implements IIntroURL { /** * Navigate foward in the presentation, whichever one it is. - * + * * @return */ private boolean navigate(String direction) { @@ -577,7 +577,7 @@ public class IntroURL implements IIntroURL { * Return a parameter defined in the Intro URL. Returns null if the * parameter is not defined. If this intro url has a decode=true parameter, * then all parameters are returned decoded using UTF-8. - * + * * @param parameterId * @return */ @@ -633,7 +633,7 @@ public class IntroURL implements IIntroURL { /** * Recreate the initial query passed to this URL. - * + * * @return */ private String retrieveInitialQuery() { @@ -675,7 +675,7 @@ public class IntroURL implements IIntroURL { Rectangle endBounds = Geometry.toDisplay(launchBar.getControl() .getParent(), launchBar.getControl().getBounds()); - AnimationEngine.createTweakedAnimation(window.getShell(), 400, startBounds, endBounds); + AnimationEngine.createTweakedAnimation(window.getShell(), 400, startBounds, endBounds); return true; } } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURLParser.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURLParser.java index 308d774e5..696a30d3c 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURLParser.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/url/IntroURLParser.java @@ -97,7 +97,7 @@ public class IntroURLParser { * Checks to see if tha passed URL is an Intro URL. An intro URL is an http * URL that has the intro plugin id as a host. eg: * "http://org.eclipse.ui.intro/test". - * + * * @param url * @return true if url is an intro URL. */ @@ -136,7 +136,7 @@ public class IntroURLParser { /** * Retruns the path attribute of the passed URL, stripped out of the leading * "/". Returns null if the url does not have a path. - * + * * @param url * @return */ @@ -151,7 +151,7 @@ public class IntroURLParser { /** * Retruns the Query part of the URL as an instance of a Properties class. - * + * * @param url * @return */ @@ -176,7 +176,7 @@ public class IntroURLParser { + params[i]); continue; } - + String key = urlDecode(keyValuePair[0]); if (key == null) { Log.warning("Failed to URL decode key: " + keyValuePair[0]); //$NON-NLS-1$ @@ -188,7 +188,7 @@ public class IntroURLParser { Log.warning("Failed to URL decode value: " + keyValuePair[1]); //$NON-NLS-1$ continue; } - + properties.setProperty(key, value); } return properties; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/BundleUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/BundleUtil.java index 0828fcca2..24b75fa60 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/BundleUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/BundleUtil.java @@ -60,7 +60,7 @@ public class BundleUtil { /** * Retrieves the given key from the bundle header. - * + * * @param bundle * @param key * @return @@ -78,7 +78,7 @@ public class BundleUtil { /** * Get the resourcelocation, but do not force an $nl$ on it. - * + * * @param resource * @param element * @return @@ -94,7 +94,7 @@ public class BundleUtil { * Returns the fully qualified location of the passed resource string from * the passed plugin id. If the file could not be loaded from the plugin, * the resource is returned as is. - * + * * @param resource * @return */ @@ -107,7 +107,7 @@ public class BundleUtil { /** * Shorthand util method. - * + * * @param resource * @return */ @@ -168,7 +168,7 @@ public class BundleUtil { } } } - + // we need to resolve this URL. String copyResource = resource; if (forceNLResolve && !copyResource.startsWith(NL_TAG)) { @@ -224,7 +224,7 @@ public class BundleUtil { /** * Get the absolute path of the given bundle, in the form * file:/path_to_plugin - * + * * @param bundle * @return */ @@ -252,7 +252,7 @@ public class BundleUtil { /** * Get the absolute path of the bundle with id <code>bundleId</code>. If * no such bundle is found, return null. - * + * * @param bundleId * @return */ @@ -262,12 +262,12 @@ public class BundleUtil { return null; return getResolvedBundleLocation(bundle); } - + /* * Bug 126085 - need to fix up file: protocol - * to a form that IE7 understands (file:///). + * to a form that IE7 understands (file:///). */ - + private static String toExternalForm(URL localURL) { try { localURL = FileLocator.toFileURL(localURL); diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/FindSupport.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/FindSupport.java index 8a8622e22..0de967c40 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/FindSupport.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/FindSupport.java @@ -44,21 +44,21 @@ public class FindSupport { } /** - * See doc on @link Platform#find(Bundle, IPath) Platform#find(Bundle, IPath) + * See doc on @link Platform#find(Bundle, IPath) Platform#find(Bundle, IPath) */ public static URL find(Bundle bundle, IPath path) { return find(bundle, path, null); } /** - * Proposed API for Platform in Eclispe 3.2. + * Proposed API for Platform in Eclispe 3.2. * Same as @link #find(Bundle, IPath) except multiple entries can be - * returned if more than one entry matches the path in the host and + * returned if more than one entry matches the path in the host and * any of its fragments. - * + * * @param bundle * @param path - * @return an array of entries which match the given path. An empty + * @return an array of entries which match the given path. An empty * array is returned if no matches are found. */ public static URL[] findEntries(Bundle bundle, IPath path) { @@ -69,7 +69,7 @@ public class FindSupport { * Proposed API for Platform in Eclipse 3.2. Same as @link #find(Bundle, IPath) except multiple * entries can be returned if more than one entry matches the path in the host and any of its * fragments. - * + * * @param bundle * @param path * @param override @@ -83,12 +83,12 @@ public class FindSupport { } /** - * See doc on @link Platform#find(Bundle, IPath, Map) Platform#find(Bundle, IPath, Map) + * See doc on @link Platform#find(Bundle, IPath, Map) Platform#find(Bundle, IPath, Map) */ public static URL find(Bundle b, IPath path, Map<String, String> override) { return find(b, path, override, null); } - + private static URL find(Bundle b, IPath path, Map<String, String> override, List<URL> multiple) { if (path == null) return null; @@ -99,7 +99,7 @@ public class FindSupport { if (path.isEmpty() || path.isRoot()) { // Watch for the root case. It will produce a new // URL which is only the root directory (and not the - // root of this plugin). + // root of this plugin). result = findInPlugin(b, Path.EMPTY, multiple); if (result == null || multiple != null) result = findInFragments(b, Path.EMPTY, multiple); @@ -182,7 +182,7 @@ public class FindSupport { ws = Platform.getWS(); IPath filePath = new Path("ws").append(ws).append(path); //$NON-NLS-1$ // We know that there is only one segment to the ws path - // e.g. ws/win32 + // e.g. ws/win32 URL result = findInPlugin(b, filePath, multiple); if (result != null && multiple == null) return result; @@ -252,7 +252,7 @@ public class FindSupport { } /** - * See doc on @link Platform#openStream(Bundle, IPath, boolean) Platform#Platform#openStream(Bundle, IPath, boolean) + * See doc on @link Platform#openStream(Bundle, IPath, boolean) Platform#Platform#openStream(Bundle, IPath, boolean) */ public static final InputStream openStream(Bundle bundle, IPath file, boolean localized) throws IOException { URL url = null; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/ModelUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/ModelUtil.java index d5198aa29..260422997 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/ModelUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/util/ModelUtil.java @@ -65,7 +65,7 @@ public class ModelUtil { * yes, returns it as is. If no, treats it as a resource relative to the * declaring plugin. Return the plugin relative location, fully qualified. * Retruns null if the passed string itself is null. - * + * * @param resource * @param pluginDesc * @return returns the URL as is if it had a protocol. @@ -85,7 +85,7 @@ public class ModelUtil { * yes, returns it as is. If no, treats it as a resource relative to the * declaring plugin. Return the plugin relative location, fully qualified. * Retruns null if the passed string itself is null. - * + * * @param resource * @param pluginDesc * @return returns the URL as is if it had a protocol. @@ -138,7 +138,7 @@ public class ModelUtil { /* - * + * * ******** XHTML DOM util methods ********************************* */ @@ -226,7 +226,7 @@ public class ModelUtil { /** * Returns a reference to the body of the DOM. - * + * * @param dom * @return */ @@ -291,7 +291,7 @@ public class ModelUtil { /** * Same as getElementsByTagName(Element parent, String tagName) but the * parent element is assumed to be the root of the document. - * + * * @see getElementsByTagName(Element parent, String tagName) */ public static Element[] getElementsByTagName(Document dom, String tagName) { @@ -323,7 +323,7 @@ public class ModelUtil { */ public static Element getElementById(Document dom, String id, String localElementName) { - + NodeList children = dom.getElementsByTagNameNS("*", localElementName); //$NON-NLS-1$ for (int i = 0; i < children.getLength(); i++) { Element element = (Element) children.item(i); @@ -338,7 +338,7 @@ public class ModelUtil { public static Element getElementById(Document dom, String id) { return getElementById(dom, id, "*"); //$NON-NLS-1$ } - + public static void updateResourceAttributes(Element element, AbstractIntroPage page) { updateResourceAttributes(element, page.getBase(), page.getBundle()); @@ -354,7 +354,7 @@ public class ModelUtil { /** * Updates all the resource attributes of the passed element to point to a * local resolved url. - * + * * @param element * @param extensionContent */ @@ -424,7 +424,7 @@ public class ModelUtil { /** * Remove all instances of the element from the DOM. - * + * */ public static void removeAllElements(Document dom, String elementLocalName) { // get all elements in DOM and remove them. diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java index 3e6efbad7..feec88dae 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/model/viewer/IntroModelLabelProvider.java @@ -123,10 +123,10 @@ public class IntroModelLabelProvider extends LabelProvider { case AbstractIntroElement.CONTAINER_EXTENSION: label = "Unresolved ConfigExtension: " //$NON-NLS-1$ + ((IntroExtensionContent) introElement).getPath(); - break; + break; case AbstractIntroElement.ANCHOR: label = "ANCHOR: " //$NON-NLS-1$ - + getPath(introElement.getParent(), ((IntroAnchor) introElement).getId()); + + getPath(introElement.getParent(), ((IntroAnchor) introElement).getId()); break; case AbstractIntroElement.PAGE_TITLE: label = "Title: " //$NON-NLS-1$ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java index 80c57d355..24a0b475a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/parts/StandbyPart.java @@ -54,7 +54,7 @@ import org.eclipse.ui.intro.config.IStandbyContentPart; * Intro goes out of standby content mode, and the standby content parts are not * shown anymore until the user explicitly asks for a part again. This is * accomplished through a data flag on the CustomizableIntroPart control. - * + * */ public class StandbyPart implements IIntroConstants { @@ -124,7 +124,7 @@ public class StandbyPart implements IIntroConstants { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.intro.IIntroPart#saveState(org.eclipse.ui.IMemento) */ private IMemento getMemento(IMemento memento, String key) { @@ -174,7 +174,7 @@ public class StandbyPart implements IIntroConstants { /** * Empty content part used as backup for failures. - * + * */ private void addAndShowEmptyPart(String message) { if (emptyPart == null) @@ -186,7 +186,7 @@ public class StandbyPart implements IIntroConstants { /** * Tries to create the last content part viewed, based on content part id.. - * + * * @param memento * @return */ @@ -204,7 +204,7 @@ public class StandbyPart implements IIntroConstants { /** * Sets the into part to standby, and shows the passed standby part, with * the given input. - * + * * @param partId * @param input */ @@ -258,7 +258,7 @@ public class StandbyPart implements IIntroConstants { * the corresponding part id. This is needed to retrive the control of a * given standby part. The IMemento should be passed to the StandbyPart when * it is initialized. - * + * * @param standbyContent */ public Control addStandbyContentPart(String partId, @@ -350,7 +350,7 @@ public class StandbyPart implements IIntroConstants { /** * Calls dispose on all cached IStandbyContentParts. - * + * */ public void dispose() { for (ControlKey controlKey : cachedContentParts.values()) { @@ -365,7 +365,7 @@ public class StandbyPart implements IIntroConstants { * subclass momento to also give the standby content part its own name * space. This was momentos saved by different content parts will not * conflict. - * + * * @param memento * the memento in which to store state information */ @@ -394,7 +394,7 @@ public class StandbyPart implements IIntroConstants { /* * Set focus on the IStandbyContentPart that corresponds to the top control * in the stack. - * + * * @see org.eclipse.ui.internal.intro.impl.parts.IStandbyContentPart#setFocus() */ public void setFocus() { @@ -410,7 +410,7 @@ public class StandbyPart implements IIntroConstants { /** * Checks the standby cache stack if we have already created a similar * IStandbyContentPart. If not, returns null. - * + * * @param standbyContent * @return */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java index 548829a2c..970777896 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/BrowserIntroPartImplementation.java @@ -76,12 +76,12 @@ import org.w3c.dom.NodeList; public class BrowserIntroPartImplementation extends AbstractIntroPartImplementation implements IPropertyListener, IIntroContentProviderSite { - + private final class ReduceAction extends Action { { - setToolTipText(Messages.Browser_reduce_tooltip); + setToolTipText(Messages.Browser_reduce_tooltip); setImageDescriptor(ImageUtil .createImageDescriptor("full/elcl16/reduce_font.gif")); //$NON-NLS-1$ setDisabledImageDescriptor(ImageUtil @@ -101,7 +101,7 @@ public class BrowserIntroPartImplementation extends private final class MagnifyAction extends Action { { - setToolTipText(Messages.Browser_magnify_tooltip); + setToolTipText(Messages.Browser_magnify_tooltip); setImageDescriptor(ImageUtil .createImageDescriptor("full/elcl16/magnify_font.gif")); //$NON-NLS-1$ setDisabledImageDescriptor(ImageUtil @@ -120,14 +120,14 @@ public class BrowserIntroPartImplementation extends private static final int SCALE_INCREMENT = 20; - // the browser widget that will display the intro content + // the browser widget that will display the intro content protected Browser browser = null; // the HTML generator used to generate dynamic content private IntroHTMLGenerator htmlGenerator = null; - + private String savedContent = null; - + private Action openBrowserAction = new Action() { { @@ -143,19 +143,19 @@ public class BrowserIntroPartImplementation extends try { tempFile = File.createTempFile("intro",".html"); //$NON-NLS-1$//$NON-NLS-2$ tempFile.deleteOnExit(); - BufferedWriter out = new BufferedWriter(new + BufferedWriter out = new BufferedWriter(new FileWriter(tempFile)); - out.write(savedContent); + out.write(savedContent); out.close(); IWorkbenchBrowserSupport support = PlatformUI.getWorkbench().getBrowserSupport(); IWebBrowser browser = support.getExternalBrowser(); browser.openURL(tempFile.toURI().toURL()); } catch (IOException e) { } catch (PartInitException e) { - } + } } - }; - + }; + private void restartIntro() { IIntroManager manager = PlatformUI.getWorkbench().getIntroManager(); IIntroPart part = manager.getIntro(); @@ -255,7 +255,7 @@ public class BrowserIntroPartImplementation extends browser.setText(Messages.Browser_invalidConfig); return; } - + // root page is what decides if the model is dynamic or not. if (getModel().isDynamic()) handleDynamicIntro(); @@ -306,7 +306,7 @@ public class BrowserIntroPartImplementation extends * Generate dynamic HTML for the provided page, and set it in the browser * widget. A cache is used for performance and for having a correct dynamic * content life cycle. This method also updates the navigation history. - * + * * @param page * the page to generate HTML for */ @@ -385,7 +385,7 @@ public class BrowserIntroPartImplementation extends if (IntroPlugin.DEBUG_TOOLBAR) { savedContent = content; } - + } return success; } @@ -421,7 +421,7 @@ public class BrowserIntroPartImplementation extends reinjectDynamicContent(dom, contentProviderElements); return content; } - + private String generateDoctype(boolean strict) { StringWriter swriter = new StringWriter(); PrintWriter writer = new PrintWriter(swriter); @@ -431,7 +431,7 @@ public class BrowserIntroPartImplementation extends } else { writer.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""); //$NON-NLS-1$ - writer.println("\t\t\t\"http://www.w3.org/TR/html4/loose.dtd\">"); //$NON-NLS-1$ + writer.println("\t\t\t\"http://www.w3.org/TR/html4/loose.dtd\">"); //$NON-NLS-1$ } writer.close(); return swriter.toString(); @@ -509,7 +509,7 @@ public class BrowserIntroPartImplementation extends /** * Return the cached IntroHTMLGenerator - * + * * @return */ private IntroHTMLGenerator getHTMLGenerator() { @@ -538,7 +538,7 @@ public class BrowserIntroPartImplementation extends toolBarManager.add(forwardAction); toolBarManager.update(true); IntroTheme theme = getModel().getTheme(); - boolean createZoomButtons = theme != null && theme.isScalable() && !resizeActionsAdded + boolean createZoomButtons = theme != null && theme.isScalable() && !resizeActionsAdded &&FontSelection.FONT_RELATIVE.equals(FontSelection.getFontStyle()); if (createZoomButtons) { toolBarManager.add(new ReduceAction()); @@ -589,7 +589,7 @@ public class BrowserIntroPartImplementation extends /** * Handle model property changes. Property listeners are only added in the * dynamic case. - * + * * @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, * int) */ @@ -623,7 +623,7 @@ public class BrowserIntroPartImplementation extends } /** - * + * * @see org.eclipse.ui.internal.intro.impl.model.AbstractIntroPartImplementation#reflow() */ @Override diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java index 44b125072..30672b61a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/FormIntroPartImplementation.java @@ -148,7 +148,7 @@ public class FormIntroPartImplementation extends * holds the home page, and one that holds all other pages. If the * presentation is configured to not show the home page with the Home Page * layout, then this page book will only have one page. - * + * * @param toolkit * @param form * @return @@ -230,7 +230,7 @@ public class FormIntroPartImplementation extends * Handle model property changes. The UI is notified here of a change to the * current page in the model. This happens if an intro URL showPage method * is executed. - * + * * @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, * int) */ @@ -378,7 +378,7 @@ public class FormIntroPartImplementation extends * form from the correct pagebook that refers to the page we need to * refresh. This will force a call to createContents on all content * providers the next time this page needs to be displayed. - * + * * @see org.eclipse.ui.intro.config.IIntroContentProviderSite#reflow(org.eclipse.ui.intro.config.IIntroContentProvider, * boolean) */ @@ -392,14 +392,14 @@ public class FormIntroPartImplementation extends else if (pageFormWithNav.hasPage(page.getId())) pageFormWithNav.reflow(); else if (mainPageBook.hasPage(page.getId())) - mainPageBook.reflow(true); + mainPageBook.reflow(true); } else { removeCachedPage(page); showPage(model.getCurrentPage()); } } - + @Override public void setFocus() { if (model.isDynamic()) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java index 29891fdb1..6dc3bab73 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/presentations/IntroLaunchBar.java @@ -3,7 +3,7 @@ * 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 * Lars Vogel <Lars.Vogel@vogella.com> - Bug 440136 **************************************************************************************************/ @@ -68,10 +68,10 @@ import org.eclipse.ui.intro.config.IntroURLFactory; * This class is responsible for creating the intro launch bar in the provided parent. It creates * 'restore' and 'close' actions, as well as actions for each shortcut element contributed in the * extension point. - * + * * Reimplemented as an E4 MToolControl for 4.x. Ideally the intro configuration information would be * available from the application IEclipseContext. - * + * * @since 3.1 */ public class IntroLaunchBar { @@ -97,7 +97,7 @@ public class IntroLaunchBar { private IntroLaunchBarElement element; protected boolean simple; - + @Inject @Optional private IntroTheme theme; @@ -178,7 +178,7 @@ public class IntroLaunchBar { /** * Install the Intro Launch Bar into the provided window. - * + * * @param window * the window to host the launch bar * @param modelRoot @@ -191,7 +191,7 @@ public class IntroLaunchBar { IntroLaunchBarElement element) { EModelService modelService = (EModelService) window.getService(EModelService.class); MTrimmedWindow trimmedWindow = (MTrimmedWindow) window.getService(MTrimmedWindow.class); - + MToolControl trimControl = modelService.createModelElement(MToolControl.class); trimControl.setElementId(LAUNCHBAR_ID); trimControl.setContributionURI(BUNDLECLASS_URI); @@ -212,7 +212,7 @@ public class IntroLaunchBar { * Remove all traces of any launch bars found in the model. Required on startup as the * {@linkplain IntroLaunchBar} instances may not be have been rendered yet and so are * disconnected from the {@link IntroPlugin}'s state. - * + * * @param workbench * the workbench to process */ @@ -298,11 +298,11 @@ public class IntroLaunchBar { /** * Not supported anymore as of the removal of the presentation API * TODO remove usage, see Bug 446171 - * + * * @return */ protected boolean isPlain() { - return true; + return true; } public void createControl(Composite parent) { @@ -478,7 +478,7 @@ public class IntroLaunchBar { } } } - + private String resolveColor(String value) { if (value.indexOf('$')== -1) return value; @@ -642,7 +642,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.internal.IWindowTrim#getId() */ public String getId() { @@ -651,7 +651,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.internal.IWindowTrim#getDisplayName() */ public String getDisplayName() { @@ -660,7 +660,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.internal.IWindowTrim#isCloseable() */ public boolean isCloseable() { @@ -669,7 +669,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.internal.IWindowTrim#handleClose() */ public void handleClose() { @@ -678,7 +678,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.IWindowTrim#getWidthHint() */ public int getWidthHint() { @@ -687,7 +687,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.IWindowTrim#getHeightHint() */ public int getHeightHint() { @@ -696,7 +696,7 @@ public class IntroLaunchBar { /* * (non-Javadoc) - * + * * @see org.eclipse.ui.IWindowTrim#isResizeable() */ public boolean isResizeable() { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageContentForm.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageContentForm.java index 6e918e1d8..838fbc9dd 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageContentForm.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageContentForm.java @@ -60,7 +60,7 @@ public class PageContentForm implements IIntroConstants { * Create the form for the root page. Number of columns there is equal to * the number of links. Every image link does not cache a model object for * data retrieval.. - * + * * @param pageBook */ public void createPartControl(ScrolledPageBook contentPageBook, @@ -113,11 +113,11 @@ public class PageContentForm implements IIntroConstants { /** * Creates a composite with TableWrapLayout to hold all page children. The * default number of columns is 1. - * + * * @param parent * @return */ - static Composite createPageTableComposite(PageWidgetFactory factory, FormToolkit toolkit, + static Composite createPageTableComposite(PageWidgetFactory factory, FormToolkit toolkit, PageStyleManager styleManager, Composite parent) { Composite client = toolkit.createComposite(parent); TableWrapLayout layout = new TableWrapLayout(); diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageForm.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageForm.java index 4f010fd0b..5d1d2b39e 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageForm.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageForm.java @@ -79,7 +79,7 @@ public class PageForm implements IIntroConstants { }; /** - * + * */ public PageForm(FormToolkit toolkit, IntroModelRoot modelRoot, Form parentForm) { @@ -90,7 +90,7 @@ public class PageForm implements IIntroConstants { /** * Create a Form for holding pages without navigation. - * + * * @param pageBook */ public void createPartControl(ScrolledPageBook mainPageBook, @@ -129,7 +129,7 @@ public class PageForm implements IIntroConstants { * This method is called when the current page changes. It creates the * PageContentForm if necessary, and handles showing the page in the Page * Book. It creates a model PageContentForm for the current page. - * + * * @param pageID */ public void showPage(AbstractIntroPage page, @@ -159,7 +159,7 @@ public class PageForm implements IIntroConstants { // a few methods like 'setFocus()' etc. // DG } - + public void reflow() { categoryPageBook.reflow(true); } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageFormWithNavigation.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageFormWithNavigation.java index cf7dd3ea6..1b1a59ced 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageFormWithNavigation.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageFormWithNavigation.java @@ -40,7 +40,7 @@ public class PageFormWithNavigation extends PageForm { /** - * + * */ public PageFormWithNavigation(FormToolkit toolkit, IntroModelRoot modelRoot, Form parentForm) { @@ -49,7 +49,7 @@ public class PageFormWithNavigation extends PageForm { /** * Extend parent behavior and add navigation. - * + * * @param pageBook */ @Override @@ -100,7 +100,7 @@ public class PageFormWithNavigation extends PageForm { /** * Creates an Image Hyperlink from an IntroLink. Model object is NOT cached. - * + * * @param body * @param link */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java index 8127c2ece..f34a81386 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageStyleManager.java @@ -49,14 +49,14 @@ public class PageStyleManager extends SharedStyleManager { * is retrieved from the page model class. The default properties are * assumed to be the presentation shared properties. The inherrited * properties are properties that we got from included and extension styles. - * + * * @param modelRoot */ public PageStyleManager(AbstractIntroPage page, Properties sharedProperties) { this.page = page; context = new StyleContext(); context.bundle = page.getBundle(); - + // honor shared-style. if (page.injectSharedStyle()) properties = new Properties(sharedProperties); @@ -115,7 +115,7 @@ public class PageStyleManager extends SharedStyleManager { * current pages style. If the given key is not found, the pageId is trimmed * from the begining of the key, and the key is looked up again. If key does * not start with a pageId, lookup only the key as is. - * + * * @param key * @return */ @@ -138,11 +138,11 @@ public class PageStyleManager extends SharedStyleManager { /** * Finds the context from which this key was loaded. If the key is not from * an inherited alt style, then use the context corresponding to this page. - * + * * @param key * @return */ - + @Override protected StyleContext getAssociatedContext(String key) { Properties aProperties = findPropertyOwner(key); @@ -167,7 +167,7 @@ public class PageStyleManager extends SharedStyleManager { public int getNumberOfColumns(IntroGroup group) { return getIntProperty(group, ".layout.ncolumns", 0); //$NON-NLS-1$ } - + public boolean getEqualWidth(IntroGroup group) { return getBooleanProperty(group, ".layout.equalWidth", false); //$NON-NLS-1$ } @@ -204,7 +204,7 @@ public class PageStyleManager extends SharedStyleManager { String key = buff.append(qualifier).toString(); return getIntProperty(key, defaultValue); } - + private boolean getBooleanProperty(AbstractBaseIntroElement element, String qualifier, boolean defaultValue) { StringBuffer buff = ModelLoaderUtil.createPathToElementKey(element, true); @@ -227,7 +227,7 @@ public class PageStyleManager extends SharedStyleManager { } return intValue; } - + private boolean getBooleanProperty(String key, boolean defaultValue) { boolean booleanValue = defaultValue; String value = getProperty(key); @@ -245,9 +245,9 @@ public class PageStyleManager extends SharedStyleManager { * element> * </p> * If not found, use the default description style. - * + * * Returns null if no default style found, or any id in path is null. - * + * * @param group * @return */ @@ -267,9 +267,9 @@ public class PageStyleManager extends SharedStyleManager { * <pageId>.description-id= <id of child description Text element> * </p> * If not found, use the default description style. - * + * * Returns null if no default style found, or any id in path is null. - * + * * @param group * @return */ @@ -302,7 +302,7 @@ public class PageStyleManager extends SharedStyleManager { * <pageId>.description-id= <id of child description Text element> * </p> * If not found, use the default description style. - * + * * @param group * @return */ @@ -333,7 +333,7 @@ public class PageStyleManager extends SharedStyleManager { /** * Returns the first direct child text element with the given style-id. - * + * * @return */ private String findTextFromStyleId(AbstractIntroContainer parent, @@ -355,7 +355,7 @@ public class PageStyleManager extends SharedStyleManager { /** * Util method to check model type, and filter model element out if it is of * the correct type. - * + * * @param element */ private AbstractIntroElement makeFiltered(AbstractIntroElement element) { @@ -398,7 +398,7 @@ public class PageStyleManager extends SharedStyleManager { String key = buff.append(".font.fg").toString(); //$NON-NLS-1$ return getColor(toolkit, key); } - + public Color getBackgrond(FormToolkit toolkit, AbstractBaseIntroElement element) { StringBuffer buff = ModelLoaderUtil.createPathToElementKey(element, true); if (buff == null) @@ -431,7 +431,7 @@ public class PageStyleManager extends SharedStyleManager { } return false; } - + private String getPropertyValue(AbstractIntroIdElement element, String suffix) { StringBuffer buff = ModelLoaderUtil.createPathToElementKey(element, true); if (buff != null) { @@ -461,7 +461,7 @@ public class PageStyleManager extends SharedStyleManager { /** * Retrieves an image for a link in a page. If not found, uses the page's * default link image. If still not found, uses the passed default. - * + * * @param link * @param qualifier * @return @@ -502,7 +502,7 @@ public class PageStyleManager extends SharedStyleManager { buff.append(qualifier); return buff.toString(); } - + private String createImageByIdKey(AbstractIntroPage page, IntroLink link, String qualifier) { if (link==null || link.getId()==null) diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java index 68f6e12b1..c0bfde650 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/PageWidgetFactory.java @@ -174,7 +174,7 @@ public class PageWidgetFactory { c = createSeparator(parent, sep); updateLayoutData(c, element); break; - + default: break; } @@ -238,7 +238,7 @@ public class PageWidgetFactory { /** * Creates an Image Hyperlink from an IntroLink. Model object is NOT cached. - * + * * @param body * @param link */ @@ -306,7 +306,7 @@ public class PageWidgetFactory { /** * Creates a forms Text or FormattedText. - * + * * @param body * @param link */ @@ -366,7 +366,7 @@ public class PageWidgetFactory { } return ilabel; } - + public Control createContentProvider(Composite parent, IntroContentProvider provider) { // If we've already loaded the content provider for this element, @@ -411,7 +411,7 @@ public class PageWidgetFactory { } return container; } - + protected Control createSeparator(Composite parent, IntroSeparator sep) { String key = sep.getParentPage().getId()+".separator.fg"; //$NON-NLS-1$ Color fg = styleManager.getColor(toolkit, key); @@ -462,7 +462,7 @@ public class PageWidgetFactory { /** * Will be only called for non formatted text. - * + * * @param text * @return */ @@ -481,7 +481,7 @@ public class PageWidgetFactory { /** * Check the filter state of the element. Only base elements have the filter * attribute. - * + * * @param element * @return */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/RootPageForm.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/RootPageForm.java index 49153242c..18f01b636 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/RootPageForm.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/RootPageForm.java @@ -155,7 +155,7 @@ public class RootPageForm implements IIntroConstants { }; /** - * + * */ public RootPageForm(FormToolkit toolkit, IntroModelRoot modelRoot, Form parentForm) { @@ -167,7 +167,7 @@ public class RootPageForm implements IIntroConstants { /** * Create the form for the root page. Number of columns there is equal to * the number of links. - * + * * @param pageBook */ public void createPartControl(ScrolledPageBook mainPageBook, @@ -277,7 +277,7 @@ public class RootPageForm implements IIntroConstants { /** * Creates an Image Hyperlink from an IntroLink. Model object is cached in * link. - * + * * @param body * @param link */ @@ -318,7 +318,7 @@ public class RootPageForm implements IIntroConstants { /** * Creates a label to display the link description when you hover over a * hyperlink. - * + * * @param body */ private Label createHoverLabel(Composite body) { @@ -333,7 +333,7 @@ public class RootPageForm implements IIntroConstants { label.setFont(PageStyleManager.getBannerFont()); return label; } - + private void createContentProvider(Composite parent, IntroContentProvider providerElement) { if (factory==null) { factory = new PageWidgetFactory(toolkit, rootPageStyleManager); diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/SharedStyleManager.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/SharedStyleManager.java index 8bb40f13e..9a425518a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/SharedStyleManager.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/swt/SharedStyleManager.java @@ -30,7 +30,7 @@ public class SharedStyleManager { protected Properties properties; protected StyleContext context; - + class StyleContext { IPath path; Bundle bundle; @@ -44,7 +44,7 @@ public class SharedStyleManager { /** * Constructor used when shared styles need to be loaded. The bundle is * retrieved from the model root. - * + * * @param modelRoot */ public SharedStyleManager(IntroModelRoot modelRoot) { @@ -67,7 +67,7 @@ public class SharedStyleManager { InputStream is = styleURL.openStream(); properties.load(is); is.close(); - context.path = new Path(style).removeLastSegments(1); + context.path = new Path(style).removeLastSegments(1); String t = (String)properties.get("theme"); //$NON-NLS-1$ if (t!=null && t.trim().equalsIgnoreCase("true")) //$NON-NLS-1$ context.inTheme = true; @@ -79,7 +79,7 @@ public class SharedStyleManager { /** * Get the property from the shared properties. - * + * * @param key * @return */ @@ -110,7 +110,7 @@ public class SharedStyleManager { * A utility method that creates RGB object from a value encoded in the * following format: #rrggbb, where r, g and b are hex color values in the * range from 00 to ff. - * + * * @param value * @return */ @@ -135,14 +135,14 @@ public class SharedStyleManager { /** * Finds the bundle from which this key was loaded. This is the bundle from * which shared styles where loaded. - * + * * @param key * @return */ protected Bundle getAssociatedBundle(String key) { return context.bundle; } - + protected StyleContext getAssociatedContext(String key) { return context; } @@ -158,8 +158,8 @@ public class SharedStyleManager { /** - * - * + * + * * @param toolkit * @param key * @return color. May return null. @@ -179,7 +179,7 @@ public class SharedStyleManager { /** * Retrieve an image from this page's properties, given a key. - * + * * @param key * @param defaultPageKey * @param defaultKey @@ -200,7 +200,7 @@ public class SharedStyleManager { if (ccontext.inTheme) { // if 'theme' key is set, load image // relative to the file, not relative to the bundle - ImageUtil.registerImage(currentKey, ccontext.path, value); + ImageUtil.registerImage(currentKey, ccontext.path, value); } else { Bundle bundle = ccontext.bundle; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ImageUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ImageUtil.java index 169befaa3..30f628ce0 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ImageUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ImageUtil.java @@ -48,7 +48,7 @@ public final class ImageUtil { public static final String INTRO_MODEL_LEAF = "leaf"; //$NON-NLS-1$ public static final String INTRO_MODEL_CONTAINER = "container"; //$NON-NLS-1$ public static final String OPEN_ITNRO_VIEW = "introView"; //$NON-NLS-1$ - + public static final String CONFIG_EXTENSION = "configExtension";//$NON-NLS-1$ // Image location @@ -56,7 +56,7 @@ public final class ImageUtil { /** * Convenience method to create an image descriptor from the Intro plugin. - * + * * Method assumes that images are under the "icons" directory, so don't * append that directory name for "imageName". */ @@ -64,10 +64,10 @@ public final class ImageUtil { return createImageDescriptor(Platform .getBundle(IIntroConstants.PLUGIN_ID), ICONS_PATH + imageName); } - + /** * Convenience method to create an image descriptor. - * + * */ public static ImageDescriptor createImageDescriptor(Bundle bundle, String imageName) { @@ -85,10 +85,10 @@ public final class ImageUtil { + " in bundle: " + bundle.getSymbolicName()); //$NON-NLS-1$ return ImageDescriptor.getMissingImageDescriptor(); } - + /** * Convenience method to create an image descriptor. - * + * */ public static ImageDescriptor createImageDescriptor(IPath base, String imageName) { @@ -108,7 +108,7 @@ public final class ImageUtil { /** * Convenience method to create an image from the Intro plugin. - * + * * Method assumes that images are under the "icons" directory, so don't * append that directory name for "imageName". */ @@ -125,7 +125,7 @@ public final class ImageUtil { /** * Util method for image re-use in Intro Plugin. - * + * * @param key * @return */ @@ -145,7 +145,7 @@ public final class ImageUtil { /** * Register an image descriptor in the Intro Plugin image registry. Has no * effect if the key has already been registered. - * + * * @param key * @param imageName */ @@ -165,7 +165,7 @@ public final class ImageUtil { return; registry.put(key, createImageDescriptor(bundle, imageName)); } - + public static void registerImage(String key, IPath base, String imageName) { ImageRegistry registry = IntroPlugin.getDefault().getVolatileImageRegistry(); if (registry.getDescriptor(key) != null) diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroEvaluationContext.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroEvaluationContext.java index 5dfeaeec1..b6b5ea341 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroEvaluationContext.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroEvaluationContext.java @@ -22,9 +22,9 @@ public final class IntroEvaluationContext { private static final String VARIABLE_PLATFORM = "platform"; //$NON-NLS-1$ private static final String VARIABLE_WORKBENCH = "workbench"; //$NON-NLS-1$ - + private static EvaluationContext context; - + /* * Returns the evaluation context to use in intro documents. */ @@ -36,7 +36,7 @@ public final class IntroEvaluationContext { } return context; } - + /* * Not meant to be instantiated. */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java index f9a51dba7..9db69684a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/IntroModelSerializer.java @@ -42,7 +42,7 @@ public class IntroModelSerializer { public IntroModelSerializer(IntroModelRoot root) { this(root, false); } - + public IntroModelSerializer(IntroModelRoot root, boolean filter) { this.buffer = new StringBuffer(); this.filter = filter; @@ -73,7 +73,7 @@ public class IntroModelSerializer { } return url; } - + private void printModelRootInfo(IntroModelRoot model, StringBuffer text) { text.append("\nIntro Model Content:"); //$NON-NLS-1$ text.append("\n======================"); //$NON-NLS-1$ @@ -224,7 +224,7 @@ public class IntroModelSerializer { text.append(indent + "alt = " + image.getAlt()); //$NON-NLS-1$ text.append(indent + "style-id = " + image.getStyleId()); //$NON-NLS-1$ } - + private void printSeparator(StringBuffer text, IntroSeparator sep, String indent) { text.append(indent + "HR: id = " + sep.getId()); //$NON-NLS-1$ indent = indent + "\t\t"; //$NON-NLS-1$ @@ -282,7 +282,7 @@ public class IntroModelSerializer { /** * Appends a given page's categories to the Text buffer. - * + * * @param text */ private void printPages(IntroPage[] pages, StringBuffer text) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Log.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Log.java index f7754c447..4a32fffcc 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Log.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Log.java @@ -25,7 +25,7 @@ import org.eclipse.ui.internal.intro.impl.IntroPlugin; * mode. Info messages are only logged when the /trace/logInfo debug option is * set to true. Performance reports are only logged when /trace/performance is * set to true. - * + * */ public class Log implements IIntroConstants { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java index f99665a51..1bdd587fb 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/ReopenUtil.java @@ -25,33 +25,33 @@ import org.eclipse.ui.XMLMemento; import org.eclipse.ui.internal.intro.impl.IntroPlugin; /** - * Utility class which manages the pseudo preference which determines whether + * Utility class which manages the pseudo preference which determines whether * Intro should always open on startup */ public class ReopenUtil { - + private static final String STATE = "state"; //$NON-NLS-1$ private static final String REOPEN = "reopen"; //$NON-NLS-1$ public static boolean isReopenPreferenceInitialized() { return readMemento() != null; } - + public static void setReopenPreference(boolean reopen) { - XMLMemento memento = XMLMemento.createWriteRoot(STATE); - memento.putBoolean(REOPEN, reopen); + XMLMemento memento = XMLMemento.createWriteRoot(STATE); + memento.putBoolean(REOPEN, reopen); saveMemento(memento); } - + public static boolean isReopenPreference() { XMLMemento memento = readMemento(); if (memento == null) { return false; } - return memento.getBoolean(REOPEN).booleanValue(); + return memento.getBoolean(REOPEN).booleanValue(); } - + private static XMLMemento readMemento() { XMLMemento memento; InputStreamReader reader = null; @@ -64,7 +64,7 @@ public class ReopenUtil { reader = new InputStreamReader(input, StandardCharsets.UTF_8); memento = XMLMemento.createReadRoot(reader); - + } catch (FileNotFoundException e) { memento = null; // Do nothing, the file will not exist the first time the workbench in used. @@ -96,7 +96,7 @@ public class ReopenUtil { if (writer != null) writer.close(); } catch (IOException e) { - + } } } diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java index b1add5d19..e0e0d27ba 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/StringUtil.java @@ -69,16 +69,16 @@ public class StringUtil { public static String decode(String s, String enc) throws UnsupportedEncodingException { try { return URLDecoder.decode(s, enc); - } + } catch (Exception ex) { // fall back to original string return s; } } - + // Removes leading and trailing whitespace and replaces other - // occurrences with a single space. - + // occurrences with a single space. + public static String normalizeWhiteSpace(String input) { if (input == null) { return null; diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Util.java b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Util.java index 09093455f..d93f3a194 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Util.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/internal/intro/impl/util/Util.java @@ -72,7 +72,7 @@ public class Util { /** * Utility method that will add a debug listener to the given control. All * common events are added. - * + * * @param control * @return */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/CustomizableIntroPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/CustomizableIntroPart.java index 1a07faeca..aac305360 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/CustomizableIntroPart.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/CustomizableIntroPart.java @@ -62,12 +62,12 @@ import org.eclipse.ui.part.IntroPart; * creation on load, and leaves restoring state to content part. Same with * saving state. The memento is passed shortly before shutdown to enable storing * of part specific data. - * + * * Note: This class was made public for re-use, as-is, as a valid class for the * <code>org.eclipse.ui.intro</code> extension point. It is not intended to be * subclassed or used otherwise. * </p> - * + * * @since 3.0 */ @@ -155,7 +155,7 @@ public final class CustomizableIntroPart extends IntroPart implements boolean startAtHomePage = ReopenUtil.isReopenPreference(); if (startAtHomePage) { PlatformUI.getPreferenceStore().setValue( - IWorkbenchPreferenceConstants.SHOW_INTRO, true); + IWorkbenchPreferenceConstants.SHOW_INTRO, true); memento = null; } // we have a valid config contribution, get presentation. Make sure @@ -186,7 +186,7 @@ public final class CustomizableIntroPart extends IntroPart implements /** * Creates the UI based on how the InroPart has been configured. - * + * * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite) */ @Override @@ -217,7 +217,7 @@ public final class CustomizableIntroPart extends IntroPart implements * Determine if we need to recreate a standby part. Return true if we have a * standby part memento that is not for the empty part AND stangby memento * has been tagged for restore, ie: it was open when workbench closed. - * + * * @param memento * @return <code>true</code> if we need to recreate a standby part */ @@ -242,7 +242,7 @@ public final class CustomizableIntroPart extends IntroPart implements /* * Handled state changes. Recreates the standby part if workbench was shut * down with one. - * + * * @see org.eclipse.ui.IIntroPart#standbyStateChanged(boolean) */ @Override @@ -282,7 +282,7 @@ public final class CustomizableIntroPart extends IntroPart implements * cases. This basically overrides the workbench behavior of Standby/normal * states. The design here is that if the showStandbyPart flag is set, then * we always need to show the standby part. - * + * * @return <code>true</code> if we need to show the standby part */ private boolean isStandbyPartNeeded() { @@ -368,7 +368,7 @@ public final class CustomizableIntroPart extends IntroPart implements /** * Returns the primary control associated with this Intro part. - * + * * @return the SWT control which displays this Intro part's content, or * <code>null</code> if this standby part's controls have not yet * been created. @@ -413,7 +413,7 @@ public final class CustomizableIntroPart extends IntroPart implements /** * Support dynamic awarness. - * + * * @see org.eclipse.core.runtime.IRegistryChangeListener#registryChanged(org.eclipse.core.runtime.IRegistryChangeEvent) */ @Override diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java index 20eed684c..4729aa6b6 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroAction.java @@ -21,7 +21,7 @@ import org.eclipse.ui.intro.IIntroSite; * <p> * http://org.eclipse.ui.intro/runAction?pluginId=x.y.z&class=x.y.z.someClass * </p> - * + * * @since 3.0 */ public interface IIntroAction { @@ -29,7 +29,7 @@ public interface IIntroAction { /** * Called to run this intro command. The properties represents the key=value * pairs extracted from the intro URL query. - * + * * @param site * @param params */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProvider.java index 507e3ff50..aef621e1f 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProvider.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProvider.java @@ -25,14 +25,14 @@ import org.eclipse.ui.forms.widgets.FormToolkit; * <ul> * <li>a content provider is defined in the Intro content markup file (ie: * introContent.xml file) as follows: - * + * * <p> * <contentProvider id="roles" * class="x.y.z.ContentProvider"> <br> * <text>Some alternate text for dynamic content</text> <br> * </contentProvider> * </p> - * + * * This defines the content provider as part of the intro content for that page. * </li> * <li>the content provider class is created when the page that contains this @@ -58,7 +58,7 @@ import org.eclipse.ui.forms.widgets.FormToolkit; * when the appropriate event happens. * <li>finally, when the intro view is closed, dispose will be called on the * content provider to give it a chance to dispose of any resources.</li> - * + * * @since 3.0.1 */ public interface IIntroContentProvider { @@ -66,7 +66,7 @@ public interface IIntroContentProvider { * Initializes the content provider. An IIntroContentProviderSite is passed, * which will be called on to recompute or layout the content when the * content becomes stale. - * + * * @param site * the site of this IIntroContentProvider */ @@ -77,7 +77,7 @@ public interface IIntroContentProvider { * Creates HTML content in the provided PrintWriter. This content will be * included in the generated HTML page when embedded HTML widget is used to * render intro content. - * + * * @param id * the unique identifier of the content element. The same content * provider class can be reused for several elements and the id @@ -90,7 +90,7 @@ public interface IIntroContentProvider { /** * Creates SWT content in the provided Composite. This method is called when * Eclipse Forms are used to render intro content. - * + * * @param id * the unique identifier of the content element * @param parent diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProviderSite.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProviderSite.java index 3a5326e5b..833ece439 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProviderSite.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroContentProviderSite.java @@ -19,7 +19,7 @@ package org.eclipse.ui.intro.config; * reflow. * <p> * This interface is not intended to be implemented or extended by clients. - * + * * @since 3.0.1 * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. @@ -30,7 +30,7 @@ public interface IIntroContentProviderSite { * that its content has become stale. For an HTML presentation, the whole * page should be regenerated. An SWT presentation should cause the page's * layout to be updated. - * + * * @param provider * the content provider that requests a reflow * @param incremental diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java index e4677a7c4..84d1fb917 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroURL.java @@ -33,7 +33,7 @@ package org.eclipse.ui.intro.config; * There is a number of supported Intro commands. Check docs for more details. * Calling execute runs the command if it is one of the supported commands. * </p> - * + * * @see IntroURLFactory * @see IIntroAction * @since 3.0 @@ -45,7 +45,7 @@ public interface IIntroURL { /** * Executes whatever valid Intro command is embedded in this Intro URL. * Returns true if action succeeded, and false otherwise. - * + * */ public boolean execute(); @@ -57,7 +57,7 @@ public interface IIntroURL { /** * Return a parameter defined in the Intro URL. Returns null if the * parameter is not defined. - * + * * @param parameterId * the id of the parameter being requested * @return the value of the parameter, or <code>null</code> if the diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroXHTMLContentProvider.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroXHTMLContentProvider.java index 6bfe745e7..343469ef8 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroXHTMLContentProvider.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IIntroXHTMLContentProvider.java @@ -16,7 +16,7 @@ import org.w3c.dom.Element; * A content provider for dynamic XHTML Intro content. When an XHTML intro page * is parsed and a contentProvider element is detected, it is used to create * dynamic XHTML content in the page. - * + * * @since 3.1 */ public interface IIntroXHTMLContentProvider extends IIntroContentProvider { @@ -24,29 +24,29 @@ public interface IIntroXHTMLContentProvider extends IIntroContentProvider { /** * Create XHTML content in the provided parent DOM Element. A typical usage * for this method would be: <br> - * + * * <br> * <code> * <contentProvider id="contentProviderId" * class="xx.yy.IntroContentProvider" * pluginId="xx.yy.id"/> <br></code> <br> - * + * * A parent DOM Element will be passed to allow for adding dynamic content * by manipulating the Java XML DOM for the XHTML file. A div is created * with an id equal to the id specified in the contentProvider element, and * is passed as the parent. In the above example, the DOM element * representing a div with id=myContentProviderDivId would be the parent * passed. - * + * * @param id * the unique identifier of the content element. The same content * provider class can be reused for several elements and the id * can be used to tell them apart. - * + * * @param parent * the parent xml Element where dynamic content will be added as * children. - * + * */ public void createContent(String id, Element parent); diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java index 2a7431478..717a71d00 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IStandbyContentPart.java @@ -28,17 +28,17 @@ import org.eclipse.ui.intro.IIntroPart; * pluginId="com.x.y.somePluginId" * class="com.x.y.someClass" * id="com.x.y.someContentPartId"> - * </standbyPart> + * </standbyPart> * </extension> * </pre> - * + * * </p> * Standby content parts have a life cycle that starts with a call to init, * shortly after part construction, followed by a call to createPartControl. * During these two calls, the part is responsible for creating its content and * using the memento to try to recreate its previous state. SetInput is the last * method called when trying to create a standby part. - * + * * @since 3.0 */ public interface IStandbyContentPart { @@ -48,7 +48,7 @@ public interface IStandbyContentPart { * <p> * Clients should not call this method. The intro framework calls this * method when it needs to. - * + * * @param parent * the parent control * @param toolkit @@ -60,7 +60,7 @@ public interface IStandbyContentPart { * Returns the primary control associated with this standby part. The * control is typically set during the createPartControl() call when this * part is being created. - * + * * @return the SWT control which displays this standby part's content, or * <code>null</code> if this standby part's controls have not yet * been created. @@ -77,7 +77,7 @@ public interface IStandbyContentPart { * construction. It marks the start of this parts' lifecycle. Clients must * not call this method. * </p> - * + * * @param introPart * the intro part hosting this stanndby content part. * @param memento @@ -95,7 +95,7 @@ public interface IStandbyContentPart { * an input specified, or when this standby part is being recreated from a * previous workbench session. In this case, the standby part is responsible * for handling a null input, and recreating itself from a cached IMemento. - * + * * @param input * the input object to be used by this standby part. */ @@ -125,7 +125,7 @@ public interface IStandbyContentPart { * 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 */ diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroConfigurer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroConfigurer.java index 3e80f94ce..5d7dc2767 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroConfigurer.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroConfigurer.java @@ -3,7 +3,7 @@ * 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 **************************************************************************************************/ @@ -20,7 +20,7 @@ import org.eclipse.ui.intro.IIntroSite; * Since it is possible for multiple products to use the same intro configuration, this class allows * them to customize some aspects of the intro content so that it looks different for different * products even though they all share the same intro implementation and content. - * + * * @since 3.2 */ @@ -28,7 +28,7 @@ public abstract class IntroConfigurer { /** * The identifier of the named group where the configurer can contribute local tool bar actions. - * + * * @see #init(IIntroSite, Map) */ public static final String TB_ADDITIONS = "additions"; //$NON-NLS-1$ @@ -41,7 +41,7 @@ public abstract class IntroConfigurer { /** * Provides the opportunity for the configurer to contribute to the action bars and to fetch * presentation theme properties. - * + * * @param site * the intro part's site * @param themeProperties @@ -57,7 +57,7 @@ public abstract class IntroConfigurer { /** * Internal method to associate the corresponding intro configuration model. May be called * independently of {@link #init(IIntroSite, Map)}. - * + * * @noreference */ final public void bind(IntroModelRoot model) { @@ -71,7 +71,7 @@ public abstract class IntroConfigurer { /** * Returns the value of the theme property with a given name. - * + * * @param name * the theme property name * @return the value of the property or <code>null</code> if property is not found, the theme @@ -92,7 +92,7 @@ public abstract class IntroConfigurer { * content files in attribute names and values of elements. Whenever $variable$ is encountered * in the content, it is evaluated using this class by passing 'variable' to this method and * substituting the result in the content. - * + * * @param variableName * the name of the substitution variable * @return the value to substitute in place of a variable or <code>null</code> if the variable @@ -103,7 +103,7 @@ public abstract class IntroConfigurer { /** * Returns the children of computed groups. Groups marked as computed will be completed at run * time when the group is asked to provide children. - * + * * @param pageId * the identifier of the page in which this group appears * @param groupId @@ -117,7 +117,7 @@ public abstract class IntroConfigurer { /** * Returns an array of elements that will be used to build launch bar short cut links. Override * this method if the intro launch bar has been marked as computed. - * + * * @return an array of elements that will be used to dynamically build shortcut links. */ public IntroElement[] getLaunchBarShortcuts() { @@ -128,7 +128,7 @@ public abstract class IntroConfigurer { * Resolves an incomplete path in the form "page_id/@" where page_id represents the identifier * of the target page. The configurator should complete the path according to its internal * resolution mechanism. The final path must point at an anchor in the referenced page. - * + * * @param extensionId * the id specified for the config extension * @param path @@ -141,7 +141,7 @@ public abstract class IntroConfigurer { /** * Returns the style value that will be mixed in with the original style of the extension. * Themes can use this feature to render certain extensions differently. - * + * * @param pageId * the identifier of the target page that this extension is contributed into * @param extensionId @@ -155,7 +155,7 @@ public abstract class IntroConfigurer { /** * Return true if {@code pageId} is the configured start page. - * + * * @param pageId * the page identifier * @since 3.5 diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroElement.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroElement.java index feee0b531..b529c8f6a 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroElement.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroElement.java @@ -4,7 +4,7 @@ * 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 **************************************************************************************************/ @@ -20,7 +20,7 @@ import java.util.List; * instances of this class from <code>IntroConfigurer</code> to dynamically complete the intro * content. Attribute and element names, as well as content model must match the intro * schema. - * + * * @since 3.2 */ public class IntroElement { @@ -32,7 +32,7 @@ public class IntroElement { /** * Creates a new intro element with the provided name. - * + * * @param name * the name of the new intro element */ @@ -42,7 +42,7 @@ public class IntroElement { /** * Sets the value of the named attribute. - * + * * @param name * attribute name * @param value @@ -54,7 +54,7 @@ public class IntroElement { /** * Returns the value of the attribute with a given name. - * + * * @param name * the attribute name * @return value of the attribute with a given name or <code>null</code> if not set. @@ -65,7 +65,7 @@ public class IntroElement { /** * Returns the names of all the attributes defined in this element. - * + * * @return an enumeration of all the element names */ @@ -75,7 +75,7 @@ public class IntroElement { /** * Returns the name of the element. - * + * * @return name of the element */ public String getName() { @@ -84,7 +84,7 @@ public class IntroElement { /** * Returns the value of the element. - * + * * @return value of the element or <code>null</code> if not set. */ public String getValue() { @@ -93,7 +93,7 @@ public class IntroElement { /** * Sets the value of the element. - * + * * @param value * the value of this element */ @@ -103,7 +103,7 @@ public class IntroElement { /** * Adds a child to this element. - * + * * @param child * the new child of this element */ @@ -115,7 +115,7 @@ public class IntroElement { /** * Returns the children of this element. - * + * * @return an array of child elements or an empty array of there are no children. */ public IntroElement[] getChildren() { @@ -123,7 +123,7 @@ public class IntroElement { return new IntroElement[0]; return (IntroElement[]) children.toArray(new IntroElement[children.size()]); } - + @Override public boolean equals(Object obj) { if (obj instanceof IntroElement) { diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java index 1d0778cb9..f91fcaf95 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/config/IntroURLFactory.java @@ -22,7 +22,7 @@ import org.eclipse.ui.internal.intro.impl.model.url.IntroURLParser; * This class provides all its functionality via static members. It is not * intended to be instantiated. * </p> - * + * * @see IIntroURL * @since 3.0 */ @@ -39,7 +39,7 @@ public final class IntroURLFactory { /** * Parses the given string, and returns an IntroURL if the string is a valid * Intro URL. Returns null in all other cases. Example usage: - * + * * <pre> * StringBuffer url = new StringBuffer(); * url.append("http://org.eclipse.ui.intro/showStandby?"); @@ -54,7 +54,7 @@ public final class IntroURLFactory { * introURL.execute(); * } * </pre> - * + * * @param url * the url to construct an IntroURL from * @return an IntroURL, or <code>null</code> if the url is invalid diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/AlwaysWelcomeCheckbox.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/AlwaysWelcomeCheckbox.java index 37d9bee62..dcba09ff5 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/AlwaysWelcomeCheckbox.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/AlwaysWelcomeCheckbox.java @@ -32,43 +32,43 @@ import org.eclipse.ui.intro.config.IIntroContentProviderSite; import org.eclipse.ui.PlatformUI; /** * - * Class which contributes a checkbox to an intro page which allows welcome to show - * on startup. If the checkbox is checked the home page of intro will be shown the next - * time the Eclipse application starts up. This class may be subclassed to override + * Class which contributes a checkbox to an intro page which allows welcome to show + * on startup. If the checkbox is checked the home page of intro will be shown the next + * time the Eclipse application starts up. This class may be subclassed to override * the text for the checkbox label. - * + * * Implements the IIntroContentProvider to create the checkbox ui, and the * org.eclipse.ui.intro.config.IIntroAction interface for handling checkbox click events. - * + * * @since 3.3 */ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction { public final static String ALWAYS_SHOW_INTRO = "alwaysShowIntro"; //$NON-NLS-1$ - + private boolean disposed = false; - + /** * Override this method to change the default text used for the checkbox - * - * @return String label for the checkbox - * + * + * @return String label for the checkbox + * * @since 3.3 - * + * */ protected String getText() { // Default text return Messages.AlwaysWelcomeCheckbox_Text; } - + @Override public void createContent(String id, PrintWriter out) { boolean alwaysShowIntro = getAlwaysShowIntroPref(); - // Use an IIntroAction url that points back to this class - + // Use an IIntroAction url that points back to this class - // particularly invoking run(). // This url is 'activated' using the onClick event. out.print("<div id=\""+id+"\"><input type=\"checkbox\" "+ //$NON-NLS-1$//$NON-NLS-2$ @@ -76,15 +76,15 @@ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction "\"http://org.eclipse.ui.intro/runAction?"+ //$NON-NLS-1$ "pluginId=org.eclipse.ui.intro&"+ //$NON-NLS-1$ "class="+this.getClass().getName()+"\" "); //$NON-NLS-1$ //$NON-NLS-2$ - + if (alwaysShowIntro) { out.print(" checked=\"checked\""); //$NON-NLS-1$ - + PlatformUI.getPreferenceStore().setValue( - IWorkbenchPreferenceConstants.SHOW_INTRO, alwaysShowIntro); + IWorkbenchPreferenceConstants.SHOW_INTRO, alwaysShowIntro); } - + out.println("/>"+getText()+"</div>"); //$NON-NLS-1$//$NON-NLS-2$ } @@ -98,7 +98,7 @@ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction Button checkBox = new Button(parent,SWT.CHECK); toolkit.adapt((Control)checkBox,false,false); - + checkBox.setText(getText()); checkBox.setSelection(alwaysShowIntro); checkBox.addSelectionListener(new SelectionAdapter(){ @@ -107,7 +107,7 @@ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction reverseShowIntroState(); } }); - + if (alwaysShowIntro) PlatformUI.getPreferenceStore().setValue( IWorkbenchPreferenceConstants.SHOW_INTRO, alwaysShowIntro); @@ -130,26 +130,26 @@ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction public void run(IIntroSite site, Properties params) { reverseShowIntroState(); } - + /** * Method reverses preference ALWAYS_SHOW_INTRO due to checkbox selection change - * + * */ private void reverseShowIntroState() { // Retrieve current state of IUniversalIntroConst.ALWAYS_SHOW_INTRO, change it, and save it back // to both ALWAYS_SHOW_INTRO and SHOW_INTRO boolean alwaysShowIntro = !getAlwaysShowIntroPref(); - + // local preference store setAlwaysShowIntroPref(alwaysShowIntro); - + // workbench preference store PlatformUI.getPreferenceStore().setValue( - IWorkbenchPreferenceConstants.SHOW_INTRO, alwaysShowIntro); + IWorkbenchPreferenceConstants.SHOW_INTRO, alwaysShowIntro); } - + public boolean getAlwaysShowIntroPref() { // If uninitialized, we will default to true (box will be checked) @@ -158,7 +158,7 @@ public class AlwaysWelcomeCheckbox implements IIntroContentProvider,IIntroAction } return ReopenUtil.isReopenPreference(); } - + public void setAlwaysShowIntroPref(boolean val) { ReopenUtil.setReopenPreference(val); diff --git a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java index eaf63147e..8975fa61c 100644 --- a/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java +++ b/org.eclipse.ui.intro/src/org/eclipse/ui/intro/contentproviders/EclipseRSSViewer.java @@ -63,18 +63,18 @@ import org.xml.sax.helpers.DefaultHandler; * The id for the contentProvider tag must consist of the following attributes. Each of these attributes must be separated by '##'. * <ul> * <TABLE CELLPADDING=6 FRAME=BOX> - * + * * <THEAD> * <TR> <TH>Attribute</TH> <TH>Description</TH> </TR> * </THEAD> - * + * * <TBODY> * <TR> <TD>url</TD> <TD>RSS news feed url</TD> </TR> * <TR> <TD>welcome_items</TD> <TD>Number of news feed to be displayed</TD> </TR> * <TR> <TD>no_news_url</TD> <TD>Alternative url for news feed</TD> </TR> * <TR> <TD>no_news_text</TD> <TD>Text for the alternative url</TD> </TR> * </TBODY> - * + * * </TABLE> * </ul> * For example: @@ -87,7 +87,7 @@ import org.xml.sax.helpers.DefaultHandler; * </ul> * </contentProvider> * </p> - * + * * @since 3.4 */ @@ -122,7 +122,7 @@ public class EclipseRSSViewer implements IIntroContentProvider { /** * Initialize the content provider * @param site an object which allows rcontainer reflows to be requested - */ + */ @Override public void init(IIntroContentProviderSite site) { this.site = site; @@ -135,16 +135,16 @@ public class EclipseRSSViewer implements IIntroContentProvider { * @param out a writer where the html will be written */ @Override - public void createContent(String id, PrintWriter out) { + public void createContent(String id, PrintWriter out) { if (disposed) return; this.id = id; params = setParams(id); - + if (items==null) createNewsItems(); - + if (items == null || threadRunning) { out.print("<p class=\"status-text\">"); //$NON-NLS-1$ out.print(Messages.RSS_Loading); @@ -200,7 +200,7 @@ public class EclipseRSSViewer implements IIntroContentProvider { return; this.id = id; params = setParams(id); - + if (formText == null) { // a one-time pass formText = toolkit.createFormText(parent, true); @@ -222,11 +222,11 @@ public class EclipseRSSViewer implements IIntroContentProvider { StringBuffer buffer = new StringBuffer(); buffer.append("<form>"); //$NON-NLS-1$ - - + + if (items==null) createNewsItems(); - + if (items == null || threadRunning) { buffer.append("<p>"); //$NON-NLS-1$ buffer.append(Messages.RSS_Loading); @@ -255,19 +255,19 @@ public class EclipseRSSViewer implements IIntroContentProvider { } buffer.append("</form>"); //$NON-NLS-1$ - + String text = buffer.toString(); text = text.replaceAll("&{1}", "&"); //$NON-NLS-1$ //$NON-NLS-2$ formText.setText(text, true, false); } - + private String createExternalURL(String url) { try { return INTRO_SHOW_IN_BROWSER + URLEncoder.encode(url, "UTF-8"); //$NON-NLS-1$ } catch (UnsupportedEncodingException e) { return INTRO_SHOW_IN_BROWSER + url; - } + } } @Override @@ -281,28 +281,28 @@ public class EclipseRSSViewer implements IIntroContentProvider { /** * Method is responsible for gathering RSS data. - * + * * Kicks off 2 threads: - * + * * The first (ContentThread) is to actually query the feeds URL to find RSS entries. * When it finishes, it calls a refresh to display the entires it found (if any). - * + * * [Esc RATLC00319786] * The second (TimeoutThread) waits for SOCKET_TIMEOUT ms to see if the content thread * has finished reading RSS. If it has finished, nothing further happens. If it has * not finished, the TimeoutThread sets the threadRunning boolean to false and refreshes * the page (basically telling the UI that no content could be found, and removes * the 'Loading...' text). - * + * */ private void createNewsItems() { - + ContentThread contentThread = new ContentThread(); contentThread.start(); TimeoutThread timeThread = new TimeoutThread(); timeThread.start(); } - + /** * Reflows the page using an UI thread. */ @@ -313,7 +313,7 @@ public class EclipseRSSViewer implements IIntroContentProvider { } private Image createImage(IPath path) { - Bundle bundle = Platform.getBundle(IntroPlugin.PLUGIN_ID); + Bundle bundle = Platform.getBundle(IntroPlugin.PLUGIN_ID); URL url = FileLocator.find(bundle, path, null); try { url = FileLocator.toFileURL(url); @@ -483,7 +483,7 @@ public class EclipseRSSViewer implements IIntroContentProvider { private String getParameter(String name) { return (String) params.get(name); } - + private class ContentThread extends Thread{ @Override @@ -506,11 +506,11 @@ public class EclipseRSSViewer implements IIntroContentProvider { SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(in, new RSSHandler()); refresh(); - + } catch (Exception e) { IntroPlugin.logError( NLS.bind( - Messages.RSS_Malformed_feed, + Messages.RSS_Malformed_feed, getParameter("url"))); //$NON-NLS-1$ refresh(); } finally { @@ -533,10 +533,10 @@ public class EclipseRSSViewer implements IIntroContentProvider { timeoutMethod.invoke(conn, new Object[] { new Integer(milliseconds)} ); } catch (Exception e) { // If running on a 1.4 JRE an exception is expected, fall through - } + } } } - + private class TimeoutThread extends Thread { @Override |