Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 89520 Details for
Bug 218655
[api][breaking] Provide SystemType enablement info in non-UI
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch making the change
bug218655_systemTypeEnabled.diff.txt (text/plain), 11.59 KB, created by
Martin Oberhuber
on 2008-02-12 12:30:20 EST
(
hide
)
Description:
Patch making the change
Filename:
MIME Type:
Creator:
Martin Oberhuber
Created:
2008-02-12 12:30:20 EST
Size:
11.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rse.ui >Index: UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java,v >retrieving revision 1.28 >diff -u -r1.28 RSESystemTypeAdapter.java >--- UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java 8 Nov 2007 13:51:14 -0000 1.28 >+++ UI/org/eclipse/rse/ui/RSESystemTypeAdapter.java 12 Feb 2008 17:26:35 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -19,6 +19,7 @@ > * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry > * Martin Oberhuber (Wind River) - [181939] avoid subsystem plugin activation just for enablement checking > * Uwe Stieber (Wind River) - [199032] [api] Remove method acceptContextMenuActionContribution(...) from RSESystemTypeAdapter >+ * Martin Oberhuber (Wind River) - [218655][api] Provide SystemType enablement info in non-UI > ********************************************************************************/ > package org.eclipse.rse.ui; > >@@ -32,9 +33,7 @@ > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.rse.core.IRSESystemType; > import org.eclipse.rse.core.IRSESystemTypeConstants; >-import org.eclipse.rse.core.RSECorePlugin; > import org.eclipse.rse.core.RSEPreferencesManager; >-import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; > import org.eclipse.rse.internal.ui.RSEAdapter; > import org.eclipse.rse.ui.wizards.registries.IRSEWizardDescriptor; > import org.eclipse.ui.IViewPart; >@@ -101,10 +100,8 @@ > * image file. bundle parameter is used as the base for relative paths and > * is allowed to be null. > * >- * @param value >- * the absolute or relative path >- * @param definingBundle >- * bundle to be used for relative paths (may be null) >+ * @param value the absolute or relative path >+ * @param definingBundle bundle to be used for relative paths (may be null) > * @return ImageDescriptor > */ > public static ImageDescriptor getImage(String value, Bundle definingBundle) { >@@ -116,10 +113,8 @@ > * Create a URL from the argument absolute or relative path. The bundle parameter is > * used as the base for relative paths and may be null. > * >- * @param value >- * the absolute or relative path >- * @param definingBundle >- * bundle to be used for relative paths (may be null) >+ * @param value the absolute or relative path >+ * @param definingBundle bundle to be used for relative paths (may be null) > * @return the URL to the resource > */ > public static URL getUrl(String value, Bundle definingBundle) { >@@ -187,26 +182,31 @@ > * @param object the object being adapted, usually a system type. > * @return true if that system type is enabled. false if the object is > * not a system type or if it is not enabled. >+ * @deprecated Clients should use {@link IRSESystemType#isEnabled()}, which is >+ * available without UI dependencies, in order to guarantee consistent >+ * availability of system types. >+ * Providers of custom RSESystemTypeAdapter implementations, which override >+ * this method, should move their code to their IRSESystemType implementations. > */ >- public boolean isEnabled(Object object) { >+ public final boolean isEnabled(Object object) { > IRSESystemType systemType = getSystemType(object); >- if ( systemType != null && RSEPreferencesManager.getIsSystemTypeEnabled(systemType)) { >- // if enabled, check if the system type has any registered subsystems. If >- // not, this will auto-disable the system type. >- ISubSystemConfigurationProxy[] proxies = RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationProxies(); >- for (int i=0; i<proxies.length; i++) { >- if (proxies[i].appliesToSystemType(systemType)) { >- return true; >- } >- } >+ if (systemType != null) { >+ return systemType.isEnabled(); > } > return false; > } > > /** > * Sets the enabled state of a particular system type. >+ * <p> >+ * Note that system types which are provided by extenders via the dynamic >+ * sytemTypeProviders extension point may have their own logic to determine >+ * whether they are enabled or not, so changing the enabled setting may >+ * not work for them. >+ * > * @param object The system type being adapted. > * @param isEnabled true if the system type is enabled. false if it is not. >+ * @deprecated Set the enabled state in {@link RSEPreferencesManager} directly > */ > public void setIsEnabled(Object object, boolean isEnabled) { > IRSESystemType systemType = getSystemType(object); >#P org.eclipse.rse.core >Index: src/org/eclipse/rse/core/IRSESystemType.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java,v >retrieving revision 1.18 >diff -u -r1.18 IRSESystemType.java >--- src/org/eclipse/rse/core/IRSESystemType.java 24 May 2007 11:05:38 -0000 1.18 >+++ src/org/eclipse/rse/core/IRSESystemType.java 12 Feb 2008 17:26:36 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -13,7 +13,8 @@ > * Contributors: > * Uwe Stieber (Wind River) - Extended system type -> subsystemConfiguration association. > * Martin Oberhuber (Wind River) - [185098] Provide constants for all well-known system types >- * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() >+ * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() >+ * Martin Oberhuber (Wind River) - [218655][api] Provide SystemType enablement info in non-UI > ********************************************************************************/ > > package org.eclipse.rse.core; >@@ -248,6 +249,22 @@ > public boolean testProperty(String key, boolean expectedValue); > > /** >+ * Tests whether the system type is currently enabled. >+ * >+ * The enabled state is a dynamic property of a system type, compared to the >+ * static configuration by plugin markup. Enablement is a non-UI property, >+ * which can be set by a Product in the Preferences or modified by a user >+ * to hide certain system types. >+ * <p> >+ * Implementers of custom system types (which are registered by a SystemTypeProvider) >+ * can override this method to provide more advanced enabled checks e.g. based on >+ * license availability. >+ * >+ * @return <code>true</code> if the system type is currently enabled, or <code>false</code> otherwise. >+ */ >+ public boolean isEnabled(); >+ >+ /** > * Tests whether the system type refers to the local system. > * This is a shortcut for > * <pre> >Index: src/org/eclipse/rse/core/PasswordPersistenceManager.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/PasswordPersistenceManager.java,v >retrieving revision 1.8 >diff -u -r1.8 PasswordPersistenceManager.java >--- src/org/eclipse/rse/core/PasswordPersistenceManager.java 14 May 2007 08:52:32 -0000 1.8 >+++ src/org/eclipse/rse/core/PasswordPersistenceManager.java 12 Feb 2008 17:26:36 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -16,6 +16,7 @@ > * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType > * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods > * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() >+ * Martin Oberhuber (Wind River) - [218655][api] Provide SystemType enablement info in non-UI > ********************************************************************************/ > > package org.eclipse.rse.core; >@@ -94,6 +95,9 @@ > public Object getAdapter(Class adapter) { > return null; > } >+ public boolean isEnabled() { >+ return true; >+ } > } > > /** >Index: src/org/eclipse/rse/core/AbstractRSESystemType.java >=================================================================== >RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/AbstractRSESystemType.java,v >retrieving revision 1.3 >diff -u -r1.3 AbstractRSESystemType.java >--- src/org/eclipse/rse/core/AbstractRSESystemType.java 23 May 2007 12:41:20 -0000 1.3 >+++ src/org/eclipse/rse/core/AbstractRSESystemType.java 12 Feb 2008 17:26:36 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************** >- * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved. >+ * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved. > * This program and the accompanying materials are made available under the terms > * of the Eclipse Public License v1.0 which accompanies this distribution, and is > * available at http://www.eclipse.org/legal/epl-v10.html >@@ -15,6 +15,7 @@ > * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType > * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() > * Martin Oberhuber (Wind River) - [186868] Fix IRSESystemType.testProperty() semantics >+ * Martin Oberhuber (Wind River) - [218655][api] Provide SystemType enablement info in non-UI > ********************************************************************************/ > package org.eclipse.rse.core; > >@@ -25,6 +26,7 @@ > import org.eclipse.rse.core.model.Host; > import org.eclipse.rse.core.model.IHost; > import org.eclipse.rse.core.model.ISystemProfile; >+import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; > import org.osgi.framework.Bundle; > > /** >@@ -157,6 +159,24 @@ > > /* > * (non-Javadoc) >+ * @see org.eclipse.rse.core.IRSESystemType#isEnabled() >+ */ >+ public boolean isEnabled() { >+ if (RSEPreferencesManager.getIsSystemTypeEnabled(this)) { >+ // if enabled, check if the system type has any registered subsystems. If >+ // not, this will auto-disable the system type. >+ ISubSystemConfigurationProxy[] proxies = RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationProxies(); >+ for (int i=0; i<proxies.length; i++) { >+ if (proxies[i].appliesToSystemType(this)) { >+ return true; >+ } >+ } >+ } >+ return false; >+ } >+ >+ /* >+ * (non-Javadoc) > * @see org.eclipse.rse.core.IRSESystemType#isLocal() > */ > public boolean isLocal() {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 218655
: 89520