mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45:22 +02:00
[226574][api] Add ISubSystemConfiguration#supportsEncoding()
This commit is contained in:
parent
bfbabda969
commit
56237a00c6
4 changed files with 197 additions and 117 deletions
|
@ -3,19 +3,20 @@
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Uwe Stieber (Wind River) - Extended system type -> subsystemConfiguration association.
|
* 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) - [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
|
* Martin Oberhuber (Wind River) - [218655][api] Provide SystemType enablement info in non-UI
|
||||||
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags
|
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags
|
||||||
|
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.core;
|
package org.eclipse.rse.core;
|
||||||
|
@ -23,6 +24,7 @@ package org.eclipse.rse.core;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemProfile;
|
import org.eclipse.rse.core.model.ISystemProfile;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||||
import org.eclipse.rse.internal.core.model.SystemHostPool;
|
import org.eclipse.rse.internal.core.model.SystemHostPool;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
|
@ -197,6 +199,26 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
*/
|
*/
|
||||||
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
|
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* System type Property Key (value: "supportsEncoding") indicating whether a
|
||||||
|
* given system type supports the user specifying an encoding to use for
|
||||||
|
* translating binary data to Java Unicode Strings when working on
|
||||||
|
* subsystems.
|
||||||
|
*
|
||||||
|
* It is up to the subsystems registered against a given system type whether
|
||||||
|
* they observe the system type's setting or not; the default
|
||||||
|
* implementations do observe it. Given that all subsystem configurations
|
||||||
|
* registered against a given system type do not support encodings, the
|
||||||
|
* corresponding RSE controls for allowing the user to change encodings will
|
||||||
|
* be disabled.
|
||||||
|
*
|
||||||
|
* Expected default value of this Property is "true" if not set.
|
||||||
|
*
|
||||||
|
* @see ISubSystemConfiguration#supportsEncoding(IHost)
|
||||||
|
* @since org.eclipse.rse.core 3.0
|
||||||
|
*/
|
||||||
|
public static final String PROPERTY_SUPPORTS_ENCODING = "supportsEncoding"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the id of the system type.
|
* Returns the id of the system type.
|
||||||
* @return the id of the system type
|
* @return the id of the system type
|
||||||
|
@ -205,7 +227,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the translatable label for use in the UI.
|
* Returns the translatable label for use in the UI.
|
||||||
*
|
*
|
||||||
* @return The UI label or <code>null</code> if not set.
|
* @return The UI label or <code>null</code> if not set.
|
||||||
*/
|
*/
|
||||||
public String getLabel();
|
public String getLabel();
|
||||||
|
@ -213,7 +235,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Returns the name of the system type.
|
* Returns the name of the system type.
|
||||||
* @return the name of the system type
|
* @return the name of the system type
|
||||||
*
|
*
|
||||||
* @deprecated Use {@link #getId()} for accessing the unique id or {@link #getLabel()} for the UI label.
|
* @deprecated Use {@link #getId()} for accessing the unique id or {@link #getLabel()} for the UI label.
|
||||||
*/
|
*/
|
||||||
public String getName();
|
public String getName();
|
||||||
|
@ -227,7 +249,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Returns the property of this system type with the given key.
|
* Returns the property of this system type with the given key.
|
||||||
* <code>null</code> is returned if there is no such key/value pair.
|
* <code>null</code> is returned if there is no such key/value pair.
|
||||||
*
|
*
|
||||||
* @param key the name of the property to return
|
* @param key the name of the property to return
|
||||||
* @return the value associated with the given key or <code>null</code> if none
|
* @return the value associated with the given key or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
|
@ -236,12 +258,12 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Tests whether the given boolean property matches the expected value
|
* Tests whether the given boolean property matches the expected value
|
||||||
* for this system type.
|
* for this system type.
|
||||||
*
|
*
|
||||||
* Clients can use their own properties with system types, but should
|
* Clients can use their own properties with system types, but should
|
||||||
* use reverse DNS notation to qualify their property keys (e.g.
|
* use reverse DNS notation to qualify their property keys (e.g.
|
||||||
* <code>com.acme.isFoobarSystem</code>. Property keys without qualifying
|
* <code>com.acme.isFoobarSystem</code>. Property keys without qualifying
|
||||||
* namespace are reserved for RSE internal use.
|
* namespace are reserved for RSE internal use.
|
||||||
*
|
*
|
||||||
* @param key the name of the property to return
|
* @param key the name of the property to return
|
||||||
* @param expectedValue the expected boolean value of the property.
|
* @param expectedValue the expected boolean value of the property.
|
||||||
* @return <code>true</code> if the Property is set on the system type and
|
* @return <code>true</code> if the Property is set on the system type and
|
||||||
|
@ -252,7 +274,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether the system type is currently enabled.
|
* Tests whether the system type is currently enabled.
|
||||||
*
|
*
|
||||||
* The enabled state is a dynamic property of a system type, compared to the
|
* 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,
|
* 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
|
* which can be set by a Product in the Preferences or modified by a user to
|
||||||
|
@ -261,7 +283,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Implementers of custom system types (which are registered by a
|
* Implementers of custom system types (which are registered by a
|
||||||
* SystemTypeProvider) can override this method to provide more advanced
|
* SystemTypeProvider) can override this method to provide more advanced
|
||||||
* enabled checks e.g. based on license availability.
|
* enabled checks e.g. based on license availability.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if the system type is currently enabled, or
|
* @return <code>true</code> if the system type is currently enabled, or
|
||||||
* <code>false</code> otherwise.
|
* <code>false</code> otherwise.
|
||||||
* @since org.eclipse.rse.core 3.0
|
* @since org.eclipse.rse.core 3.0
|
||||||
|
@ -303,7 +325,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Returns the bundle which is responsible for the definition of this system type.
|
* Returns the bundle which is responsible for the definition of this system type.
|
||||||
* Typically this is used as a base for searching for images and other files
|
* Typically this is used as a base for searching for images and other files
|
||||||
* that are needed in presenting the system type.
|
* that are needed in presenting the system type.
|
||||||
*
|
*
|
||||||
* @return the bundle which defines this system type or <code>null</code> if none
|
* @return the bundle which defines this system type or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
public Bundle getDefiningBundle();
|
public Bundle getDefiningBundle();
|
||||||
|
@ -317,7 +339,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* <b>Note:</b> The list returned here does not imply that the corresponding
|
* <b>Note:</b> The list returned here does not imply that the corresponding
|
||||||
* subsystem configurations exist. The list contains only possibilites not,
|
* subsystem configurations exist. The list contains only possibilites not,
|
||||||
* requirements.
|
* requirements.
|
||||||
*
|
*
|
||||||
* @return The list of subsystem configuration id's. May be empty,
|
* @return The list of subsystem configuration id's. May be empty,
|
||||||
* but never <code>null</code>.
|
* but never <code>null</code>.
|
||||||
*/
|
*/
|
||||||
|
@ -326,7 +348,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Creates a new <code>IHost</code> object instance. This method is
|
* Creates a new <code>IHost</code> object instance. This method is
|
||||||
* called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
|
* called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
|
||||||
*
|
*
|
||||||
* @param profile The system profile to associate with the host.
|
* @param profile The system profile to associate with the host.
|
||||||
* @return A new <code>IHost</code> object instance.
|
* @return A new <code>IHost</code> object instance.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
* This program and the accompanying materials are made available under the terms
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David Dykstal (IBM) - 168870: move core function from UI to core
|
* David Dykstal (IBM) - 168870: move core function from UI to core
|
||||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
|
@ -20,6 +20,7 @@
|
||||||
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI
|
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI
|
||||||
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags
|
* Martin Oberhuber (Wind River) - [cleanup] Add API "since" Javadoc tags
|
||||||
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
|
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
|
||||||
|
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.core.subsystems;
|
package org.eclipse.rse.core.subsystems;
|
||||||
|
@ -37,7 +38,7 @@ import org.eclipse.rse.services.IService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subsystem Configuration interface.
|
* Subsystem Configuration interface.
|
||||||
*
|
*
|
||||||
* @noimplement This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* Subsystem configuration implementations must subclass
|
* Subsystem configuration implementations must subclass
|
||||||
* <code>SubSystemConfiguration</code> rather than implementing
|
* <code>SubSystemConfiguration</code> rather than implementing
|
||||||
|
@ -65,6 +66,41 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// CRITICAL METHODS...
|
// CRITICAL METHODS...
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test whether subsystems managed by this configuration support custom
|
||||||
|
* encodings.
|
||||||
|
*
|
||||||
|
* Encodings specify the way how binary data on the remote system is
|
||||||
|
* translated into Java Unicode Strings. RSE provides some means for the
|
||||||
|
* User to specify a particular encoding to use; typically, all subsystems
|
||||||
|
* that do support custom encodings specified should use the same encoding
|
||||||
|
* such that they can interoperate. Therefore, encodings are usually
|
||||||
|
* obtained from {@link IHost#getDefaultEncoding(boolean)}.
|
||||||
|
*
|
||||||
|
* It's possible, however, that a particular subsystem "knows" that its
|
||||||
|
* resources are always encoded in a particular way, and there is no
|
||||||
|
* possibility to ever change that. The Subsystem Configuration would return
|
||||||
|
* <code>false</code> here in this case. Another possibility is that
|
||||||
|
* encodings for a particular subsystem can be changed, but in a way that's
|
||||||
|
* different than what RSE usually does. The default case, however, should
|
||||||
|
* be that subsystems fall back to the setting specified by the host or its
|
||||||
|
* underlying system type such that existing subsystem configurations can be
|
||||||
|
* re-used in an environment where the encoding to use is pre-defined by the
|
||||||
|
* system type or host connection.
|
||||||
|
*
|
||||||
|
* If no subsystem registered against a given host supports encodings, the
|
||||||
|
* corresponding UI controls on the IHost level are disabled in order to
|
||||||
|
* avoid confusion to the user.
|
||||||
|
*
|
||||||
|
* @return <code>true<code> if the RSE mechanisms for specifying custom
|
||||||
|
* encodings are observed and supported by the subsystems managed
|
||||||
|
* by this configuration for the given host.
|
||||||
|
* @see IRSESystemType#PROPERTY_SUPPORTS_ENCODING
|
||||||
|
* @since org.eclipse.rse.core 3.0
|
||||||
|
*/
|
||||||
|
public boolean supportsEncoding(IHost host);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if the subsystem supports more than one filter string
|
* Return true if the subsystem supports more than one filter string
|
||||||
* <p>RETURNS true BY DEFAULT
|
* <p>RETURNS true BY DEFAULT
|
||||||
|
@ -154,22 +190,22 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if deferred queries are supported.
|
* Return true if deferred queries are supported.
|
||||||
*
|
*
|
||||||
* Deferred queries work such that when a filter or element
|
* Deferred queries work such that when a filter or element
|
||||||
* children query is made, a WorkbenchJob is started to
|
* children query is made, a WorkbenchJob is started to
|
||||||
* perform the query in a background thread. The query can
|
* perform the query in a background thread. The query can
|
||||||
* take time to complete, but a negative side-effect of this
|
* take time to complete, but a negative side-effect of this
|
||||||
* is that it will always take time to complete.
|
* is that it will always take time to complete.
|
||||||
*
|
*
|
||||||
* Alternative models can use asynchronous calls to populate
|
* Alternative models can use asynchronous calls to populate
|
||||||
* their model with data from the remote side, and refresh
|
* their model with data from the remote side, and refresh
|
||||||
* the views when new data is in the model. Such subsystem
|
* the views when new data is in the model. Such subsystem
|
||||||
* configurations should return <code>false</code> here.
|
* configurations should return <code>false</code> here.
|
||||||
*
|
*
|
||||||
* The default implementation returns <code>true</code>, indicating
|
* The default implementation returns <code>true</code>, indicating
|
||||||
* that deferred queries are supported for filters, and delegates
|
* that deferred queries are supported for filters, and delegates
|
||||||
* the check for model elements to the ISystemViewElementAdapter.
|
* the check for model elements to the ISystemViewElementAdapter.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if deferred queries are supported.
|
* @return <code>true</code> if deferred queries are supported.
|
||||||
*/
|
*/
|
||||||
public boolean supportsDeferredQueries();
|
public boolean supportsDeferredQueries();
|
||||||
|
@ -179,7 +215,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* By default, the filter reference adapter treats a drop on a filter as an update to the list of filter
|
* By default, the filter reference adapter treats a drop on a filter as an update to the list of filter
|
||||||
* strings for a filter. For things like files, it is more desirable to treat the drop as a physical
|
* strings for a filter. For things like files, it is more desirable to treat the drop as a physical
|
||||||
* resource copy, so in that case, custom drop makes sense.
|
* resource copy, so in that case, custom drop makes sense.
|
||||||
*
|
*
|
||||||
* By default this returns false.
|
* By default this returns false.
|
||||||
*/
|
*/
|
||||||
public boolean providesCustomDropInFilters();
|
public boolean providesCustomDropInFilters();
|
||||||
|
@ -403,7 +439,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* by a connector service manager known to this configuration. This must be
|
* by a connector service manager known to this configuration. This must be
|
||||||
* implemented by service subsystem configurations. Service subsystems allow
|
* implemented by service subsystem configurations. Service subsystems allow
|
||||||
* a connector service to be changed.
|
* a connector service to be changed.
|
||||||
*
|
*
|
||||||
* @param host the host for which to set this connector service.
|
* @param host the host for which to set this connector service.
|
||||||
* @param connectorService the connector service associated with this host.
|
* @param connectorService the connector service associated with this host.
|
||||||
* @since org.eclipse.rse.core 3.0
|
* @since org.eclipse.rse.core 3.0
|
||||||
|
@ -415,7 +451,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* configuration is not a service subsystem configuration it must return
|
* configuration is not a service subsystem configuration it must return
|
||||||
* <code>null</code>, otherwise it must return the interface class that
|
* <code>null</code>, otherwise it must return the interface class that
|
||||||
* the underlying service layer implements.
|
* the underlying service layer implements.
|
||||||
*
|
*
|
||||||
* @return an interface class that is implemented by the service layer used
|
* @return an interface class that is implemented by the service layer used
|
||||||
* by subsystems that have this configuration, or <code>null</code>
|
* by subsystems that have this configuration, or <code>null</code>
|
||||||
* if this is not a service subsystem configuration.
|
* if this is not a service subsystem configuration.
|
||||||
|
@ -429,7 +465,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* configuration then this must return <code>null</code>, otherwise it
|
* configuration then this must return <code>null</code>, otherwise it
|
||||||
* must return the class that implements the interface specified in
|
* must return the class that implements the interface specified in
|
||||||
* {@link #getServiceType()}.
|
* {@link #getServiceType()}.
|
||||||
*
|
*
|
||||||
* @return an implementation class that implements the interface specified
|
* @return an implementation class that implements the interface specified
|
||||||
* in {@link #getServiceType()}, or <code>null</code> if this is
|
* in {@link #getServiceType()}, or <code>null</code> if this is
|
||||||
* not a service subsystem configuration.
|
* not a service subsystem configuration.
|
||||||
|
@ -442,7 +478,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* configuration is not a service subsystem this must return null. Otherwise
|
* configuration is not a service subsystem this must return null. Otherwise
|
||||||
* this must return the particular instance of the class returned by
|
* this must return the particular instance of the class returned by
|
||||||
* {@link #getServiceImplType()} that is associated with this host instance.
|
* {@link #getServiceImplType()} that is associated with this host instance.
|
||||||
*
|
*
|
||||||
* @param host The host for which to retrieve the service.
|
* @param host The host for which to retrieve the service.
|
||||||
* @return The instance of {@link IService} which is associated with this
|
* @return The instance of {@link IService} which is associated with this
|
||||||
* host, or <code>null</code> if this is not a service subsystem
|
* host, or <code>null</code> if this is not a service subsystem
|
||||||
|
@ -542,7 +578,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
/**
|
/**
|
||||||
* Get the filter pool manager for the given profile. A subsystem
|
* Get the filter pool manager for the given profile. A subsystem
|
||||||
* configuration has a filter pool manager for each profile.
|
* configuration has a filter pool manager for each profile.
|
||||||
*
|
*
|
||||||
* @param profile The system profile for which to get the manager.
|
* @param profile The system profile for which to get the manager.
|
||||||
* @param force if true then create the default filters for this subsystem
|
* @param force if true then create the default filters for this subsystem
|
||||||
* configuration in this profile. This should only be done during
|
* configuration in this profile. This should only be done during
|
||||||
|
@ -557,7 +593,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* configuration has a filter pool manager for each profile. Do not force
|
* configuration has a filter pool manager for each profile. Do not force
|
||||||
* the creation of default filter pools. Fully equivalent to
|
* the creation of default filter pools. Fully equivalent to
|
||||||
* getFilterPoolManager(profile, false).
|
* getFilterPoolManager(profile, false).
|
||||||
*
|
*
|
||||||
* @param profile The system profile for which to get the manager.
|
* @param profile The system profile for which to get the manager.
|
||||||
* @return a filter pool manager
|
* @return a filter pool manager
|
||||||
*/
|
*/
|
||||||
|
@ -614,7 +650,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
/**
|
/**
|
||||||
* Determines whether this factory is responsible for the creation of subsytems of the specified type
|
* Determines whether this factory is responsible for the creation of subsytems of the specified type
|
||||||
* Subsystem factories should override this to indicate which subsystems they support.
|
* Subsystem factories should override this to indicate which subsystems they support.
|
||||||
*
|
*
|
||||||
* @param subSystemType type of subsystem
|
* @param subSystemType type of subsystem
|
||||||
* @return whether this factory is for the specified subsystemtype
|
* @return whether this factory is for the specified subsystemtype
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,10 +7,10 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
* David McKnight (IBM) - [209703] apply encoding and updating remote file when apply on property page
|
* David McKnight (IBM) - [209703] apply encoding and updating remote file when apply on property page
|
||||||
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
|
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
|
||||||
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
|
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
|
||||||
|
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.propertypages;
|
package org.eclipse.rse.internal.files.ui.propertypages;
|
||||||
|
@ -41,6 +42,7 @@ import org.eclipse.osgi.util.NLS;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||||
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||||
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
|
import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
|
||||||
import org.eclipse.rse.internal.files.ui.Activator;
|
import org.eclipse.rse.internal.files.ui.Activator;
|
||||||
|
@ -86,23 +88,23 @@ import com.ibm.icu.text.NumberFormat;
|
||||||
public class SystemFilePropertyPage extends SystemBasePropertyPage
|
public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
implements SelectionListener
|
implements SelectionListener
|
||||||
{
|
{
|
||||||
|
|
||||||
protected Label labelNamePrompt, labelTypePrompt, labelPathPrompt, labelSizePrompt,
|
protected Label labelNamePrompt, labelTypePrompt, labelPathPrompt, labelSizePrompt,
|
||||||
labelModifiedPrompt;
|
labelModifiedPrompt;
|
||||||
//protected Button cbReadablePrompt, cbWritablePrompt;
|
//protected Button cbReadablePrompt, cbWritablePrompt;
|
||||||
protected Button cbReadonlyPrompt, cbHiddenPrompt;
|
protected Button cbReadonlyPrompt, cbHiddenPrompt;
|
||||||
protected Label labelName, labelType, labelPath, labelSize, labelModified, labelReadable, labelWritable, labelHidden;
|
protected Label labelName, labelType, labelPath, labelSize, labelModified, labelReadable, labelWritable, labelHidden;
|
||||||
protected Button defaultEncodingButton, otherEncodingButton;
|
protected Button defaultEncodingButton, otherEncodingButton;
|
||||||
protected Combo otherEncodingCombo;
|
protected Combo otherEncodingCombo;
|
||||||
protected String errorMessage;
|
protected String errorMessage;
|
||||||
protected boolean initDone = false;
|
protected boolean initDone = false;
|
||||||
protected boolean wasReadOnly = false;
|
protected boolean wasReadOnly = false;
|
||||||
protected String prevEncoding;
|
protected String prevEncoding;
|
||||||
|
|
||||||
private boolean encodingFieldAdded = false;
|
private boolean encodingFieldAdded = false;
|
||||||
private String defaultEncoding = null;
|
private String defaultEncoding = null;
|
||||||
private boolean isValidBefore = true;
|
private boolean isValidBefore = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for SystemFilterPropertyPage
|
* Constructor for SystemFilterPropertyPage
|
||||||
*/
|
*/
|
||||||
|
@ -110,8 +112,8 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the page's GUI contents.
|
* Create the page's GUI contents.
|
||||||
*/
|
*/
|
||||||
|
@ -121,7 +123,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
|
|
||||||
// Inner composite
|
// Inner composite
|
||||||
int nbrColumns = 2;
|
int nbrColumns = 2;
|
||||||
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
|
||||||
|
|
||||||
// Name display
|
// Name display
|
||||||
labelNamePrompt = SystemWidgetHelpers.createLabel(
|
labelNamePrompt = SystemWidgetHelpers.createLabel(
|
||||||
|
@ -170,12 +172,12 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
// Readonly display
|
// Readonly display
|
||||||
if (!file.isRoot())
|
if (!file.isRoot())
|
||||||
{
|
{
|
||||||
if (file.showReadOnlyProperty())
|
if (file.showReadOnlyProperty())
|
||||||
{
|
{
|
||||||
cbReadonlyPrompt = SystemWidgetHelpers.createCheckBox(
|
cbReadonlyPrompt = SystemWidgetHelpers.createCheckBox(
|
||||||
composite_prompts, null, SystemFileResources.RESID_PP_FILE_READONLY_LABEL, SystemFileResources.RESID_PP_FILE_READONLY_TOOLTIP);
|
composite_prompts, null, SystemFileResources.RESID_PP_FILE_READONLY_LABEL, SystemFileResources.RESID_PP_FILE_READONLY_TOOLTIP);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Readable display
|
// Readable display
|
||||||
|
@ -200,13 +202,14 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
composite_prompts, null, SystemFileResources.RESID_PP_FILE_HIDDEN_LABEL, SystemFileResources.RESID_PP_FILE_HIDDEN_TOOLTIP);
|
composite_prompts, null, SystemFileResources.RESID_PP_FILE_HIDDEN_LABEL, SystemFileResources.RESID_PP_FILE_HIDDEN_TOOLTIP);
|
||||||
//((GridData)cbHiddenPrompt.getLayoutData()).horizontalSpan = nbrColumns;
|
//((GridData)cbHiddenPrompt.getLayoutData()).horizontalSpan = nbrColumns;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if an encodings field should be added. Add only if the subsystem
|
// check if an encodings field should be added. Add only if the subsystem
|
||||||
// indicates that it supports encodings
|
// indicates that it supports encodings
|
||||||
if (file.getParentRemoteFileSubSystem().supportsEncoding()) {
|
IRemoteFileSubSystem subSys = file.getParentRemoteFileSubSystem();
|
||||||
|
IHost host = subSys.getHost();
|
||||||
|
if (subSys.getSubSystemConfiguration().supportsEncoding(host)) {
|
||||||
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
||||||
|
|
||||||
// encoding field
|
// encoding field
|
||||||
Group encodingGroup = SystemWidgetHelpers.createGroupComposite(composite_prompts, 2, SystemFileResources.RESID_PP_FILE_ENCODING_GROUP_LABEL);
|
Group encodingGroup = SystemWidgetHelpers.createGroupComposite(composite_prompts, 2, SystemFileResources.RESID_PP_FILE_ENCODING_GROUP_LABEL);
|
||||||
GridData data = new GridData();
|
GridData data = new GridData();
|
||||||
|
@ -216,32 +219,32 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
data.verticalAlignment = SWT.BEGINNING;
|
data.verticalAlignment = SWT.BEGINNING;
|
||||||
data.grabExcessVerticalSpace = false;
|
data.grabExcessVerticalSpace = false;
|
||||||
encodingGroup.setLayoutData(data);
|
encodingGroup.setLayoutData(data);
|
||||||
|
|
||||||
SelectionAdapter defaultButtonSelectionListener = new SelectionAdapter() {
|
SelectionAdapter defaultButtonSelectionListener = new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
updateEncodingGroupState(defaultEncodingButton.getSelection());
|
updateEncodingGroupState(defaultEncodingButton.getSelection());
|
||||||
updateValidState();
|
updateValidState();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// default encoding field
|
// default encoding field
|
||||||
defaultEncoding = file.getParentRemoteFile().getEncoding();
|
defaultEncoding = file.getParentRemoteFile().getEncoding();
|
||||||
|
|
||||||
String defaultEncodingLabel = SystemFileResources.RESID_PP_FILE_ENCODING_DEFAULT_LABEL;
|
String defaultEncodingLabel = SystemFileResources.RESID_PP_FILE_ENCODING_DEFAULT_LABEL;
|
||||||
int idx = defaultEncodingLabel.indexOf('%');
|
int idx = defaultEncodingLabel.indexOf('%');
|
||||||
|
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
defaultEncodingLabel = defaultEncodingLabel.substring(0, idx) +
|
defaultEncodingLabel = defaultEncodingLabel.substring(0, idx) +
|
||||||
defaultEncoding +
|
defaultEncoding +
|
||||||
defaultEncodingLabel.substring(idx+2);
|
defaultEncodingLabel.substring(idx+2);
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultEncodingButton = SystemWidgetHelpers.createRadioButton(encodingGroup, null, defaultEncodingLabel, SystemFileResources.RESID_PP_FILE_ENCODING_DEFAULT_TOOLTIP);
|
defaultEncodingButton = SystemWidgetHelpers.createRadioButton(encodingGroup, null, defaultEncodingLabel, SystemFileResources.RESID_PP_FILE_ENCODING_DEFAULT_TOOLTIP);
|
||||||
data = new GridData();
|
data = new GridData();
|
||||||
data.horizontalSpan = 2;
|
data.horizontalSpan = 2;
|
||||||
defaultEncodingButton.setLayoutData(data);
|
defaultEncodingButton.setLayoutData(data);
|
||||||
defaultEncodingButton.addSelectionListener(defaultButtonSelectionListener);
|
defaultEncodingButton.addSelectionListener(defaultButtonSelectionListener);
|
||||||
|
|
||||||
Composite otherComposite = new Composite(encodingGroup, SWT.NONE);
|
Composite otherComposite = new Composite(encodingGroup, SWT.NONE);
|
||||||
GridLayout otherLayout = new GridLayout();
|
GridLayout otherLayout = new GridLayout();
|
||||||
otherLayout.numColumns = 2;
|
otherLayout.numColumns = 2;
|
||||||
|
@ -252,14 +255,14 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
|
|
||||||
// other encoding field
|
// other encoding field
|
||||||
otherEncodingButton = SystemWidgetHelpers.createRadioButton(otherComposite, null, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_LABEL, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_TOOLTIP);
|
otherEncodingButton = SystemWidgetHelpers.createRadioButton(otherComposite, null, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_LABEL, SystemFileResources.RESID_PP_FILE_ENCODING_OTHER_TOOLTIP);
|
||||||
|
|
||||||
SelectionAdapter otherButtonSelectionListener = new SelectionAdapter() {
|
SelectionAdapter otherButtonSelectionListener = new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
updateEncodingGroupState(!otherEncodingButton.getSelection());
|
updateEncodingGroupState(!otherEncodingButton.getSelection());
|
||||||
updateValidState();
|
updateValidState();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
otherEncodingButton.addSelectionListener(otherButtonSelectionListener);
|
otherEncodingButton.addSelectionListener(otherButtonSelectionListener);
|
||||||
|
|
||||||
// other encoding combo
|
// other encoding combo
|
||||||
|
@ -280,26 +283,26 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
updateValidState();
|
updateValidState();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
SystemWidgetHelpers.createLabel(encodingGroup, ""); //$NON-NLS-1$
|
SystemWidgetHelpers.createLabel(encodingGroup, ""); //$NON-NLS-1$
|
||||||
|
|
||||||
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
SystemWidgetHelpers.createLabel(composite_prompts, "", 2); //$NON-NLS-1$
|
||||||
|
|
||||||
encodingFieldAdded = true;
|
encodingFieldAdded = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
encodingFieldAdded = false;
|
encodingFieldAdded = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!initDone)
|
if (!initDone)
|
||||||
doInitializeFields();
|
doInitializeFields();
|
||||||
|
|
||||||
if (!file.isRoot() && file.showReadOnlyProperty())
|
if (!file.isRoot() && file.showReadOnlyProperty())
|
||||||
cbReadonlyPrompt.addSelectionListener(this);
|
cbReadonlyPrompt.addSelectionListener(this);
|
||||||
|
|
||||||
return composite_prompts;
|
return composite_prompts;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the encoding group state.
|
* Update the encoding group state.
|
||||||
* @param useDefault whether to update the state with default option on. <code>true</code> if the default option
|
* @param useDefault whether to update the state with default option on. <code>true</code> if the default option
|
||||||
|
@ -308,24 +311,24 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
private void updateEncodingGroupState(boolean useDefault) {
|
private void updateEncodingGroupState(boolean useDefault) {
|
||||||
defaultEncodingButton.setSelection(useDefault);
|
defaultEncodingButton.setSelection(useDefault);
|
||||||
otherEncodingButton.setSelection(!useDefault);
|
otherEncodingButton.setSelection(!useDefault);
|
||||||
|
|
||||||
if (useDefault) {
|
if (useDefault) {
|
||||||
otherEncodingCombo.setText(getDefaultEncoding());
|
otherEncodingCombo.setText(getDefaultEncoding());
|
||||||
}
|
}
|
||||||
|
|
||||||
otherEncodingCombo.setEnabled(!useDefault);
|
otherEncodingCombo.setEnabled(!useDefault);
|
||||||
updateValidState();
|
updateValidState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the valid state of the encoding group.
|
* Updates the valid state of the encoding group.
|
||||||
*/
|
*/
|
||||||
private void updateValidState() {
|
private void updateValidState() {
|
||||||
boolean isValid = isEncodingValid();
|
boolean isValid = isEncodingValid();
|
||||||
|
|
||||||
if (isValid != isValidBefore) {
|
if (isValid != isValidBefore) {
|
||||||
isValidBefore = isValid;
|
isValidBefore = isValid;
|
||||||
|
|
||||||
if (isValidBefore) {
|
if (isValidBefore) {
|
||||||
clearErrorMessage();
|
clearErrorMessage();
|
||||||
}
|
}
|
||||||
|
@ -335,7 +338,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default encoding.
|
* Returns the default encoding.
|
||||||
* @return the default encoding
|
* @return the default encoding
|
||||||
|
@ -343,7 +346,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
protected String getDefaultEncoding() {
|
protected String getDefaultEncoding() {
|
||||||
return defaultEncoding;
|
return defaultEncoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the currently selected encoding.
|
* Returns the currently selected encoding.
|
||||||
* @return the currently selected encoding.
|
* @return the currently selected encoding.
|
||||||
|
@ -352,7 +355,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
if (defaultEncodingButton.getSelection()) {
|
if (defaultEncodingButton.getSelection()) {
|
||||||
return defaultEncoding;
|
return defaultEncoding;
|
||||||
}
|
}
|
||||||
|
|
||||||
return otherEncodingCombo.getText();
|
return otherEncodingCombo.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -363,7 +366,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
private boolean isEncodingValid() {
|
private boolean isEncodingValid() {
|
||||||
return defaultEncodingButton.getSelection() || isEncodingValid(otherEncodingCombo.getText());
|
return defaultEncodingButton.getSelection() || isEncodingValid(otherEncodingCombo.getText());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether or not the given encoding is valid.
|
* Returns whether or not the given encoding is valid.
|
||||||
* @param encoding the encoding.
|
* @param encoding the encoding.
|
||||||
|
@ -377,7 +380,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the input remote file object
|
* Get the input remote file object
|
||||||
*/
|
*/
|
||||||
|
@ -385,7 +388,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
{
|
{
|
||||||
Object element = getElement();
|
Object element = getElement();
|
||||||
IRemoteFile file = (IRemoteFile)element;
|
IRemoteFile file = (IRemoteFile)element;
|
||||||
|
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,16 +401,16 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
IRemoteFile file = getRemoteFile();
|
IRemoteFile file = getRemoteFile();
|
||||||
// name
|
// name
|
||||||
String name = file.getName();
|
String name = file.getName();
|
||||||
if (name.length() > 100)
|
if (name.length() > 100)
|
||||||
{
|
{
|
||||||
String shortName = name.substring(0, 97).concat("..."); //$NON-NLS-1$
|
String shortName = name.substring(0, 97).concat("..."); //$NON-NLS-1$
|
||||||
labelName.setText(shortName);
|
labelName.setText(shortName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
labelName.setText(name);
|
labelName.setText(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
// type
|
// type
|
||||||
if (file.isRoot())
|
if (file.isRoot())
|
||||||
labelType.setText(SystemFileResources.RESID_PP_FILE_TYPE_ROOT_VALUE);
|
labelType.setText(SystemFileResources.RESID_PP_FILE_TYPE_ROOT_VALUE);
|
||||||
|
@ -448,7 +451,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
if (file instanceof IVirtualRemoteFile)
|
if (file instanceof IVirtualRemoteFile)
|
||||||
cbReadonlyPrompt.setEnabled(false);
|
cbReadonlyPrompt.setEnabled(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
// readable
|
// readable
|
||||||
if (cbReadablePrompt != null)
|
if (cbReadablePrompt != null)
|
||||||
|
@ -460,16 +463,16 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
if (cbWritablePrompt != null)
|
if (cbWritablePrompt != null)
|
||||||
{
|
{
|
||||||
cbWritablePrompt.setSelection(file.canWrite());
|
cbWritablePrompt.setSelection(file.canWrite());
|
||||||
cbWritablePrompt.setEnabled(false);
|
cbWritablePrompt.setEnabled(false);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// hidden
|
// hidden
|
||||||
if (cbHiddenPrompt != null)
|
if (cbHiddenPrompt != null)
|
||||||
{
|
{
|
||||||
cbHiddenPrompt.setSelection(file.isHidden());
|
cbHiddenPrompt.setSelection(file.isHidden());
|
||||||
cbHiddenPrompt.setEnabled(false);
|
cbHiddenPrompt.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// the file encoding group
|
// the file encoding group
|
||||||
if (encodingFieldAdded) {
|
if (encodingFieldAdded) {
|
||||||
List encodings = IDEEncoding.getIDEEncodings();
|
List encodings = IDEEncoding.getIDEEncodings();
|
||||||
|
@ -479,7 +482,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
|
|
||||||
String encoding = file.getEncoding();
|
String encoding = file.getEncoding();
|
||||||
prevEncoding = encoding;
|
prevEncoding = encoding;
|
||||||
|
|
||||||
// if the encoding is the same as the default encoding, then we want to choose the default encoding option
|
// if the encoding is the same as the default encoding, then we want to choose the default encoding option
|
||||||
if (encoding.equalsIgnoreCase(defaultEncoding)) {
|
if (encoding.equalsIgnoreCase(defaultEncoding)) {
|
||||||
updateEncodingGroupState(true);
|
updateEncodingGroupState(true);
|
||||||
|
@ -491,7 +494,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by parent when user presses OK
|
* Called by parent when user presses OK
|
||||||
*/
|
*/
|
||||||
|
@ -500,9 +503,9 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
boolean ok = super.performOk();
|
boolean ok = super.performOk();
|
||||||
boolean readOnlySelected = cbReadonlyPrompt != null ? cbReadonlyPrompt.getSelection() : false;
|
boolean readOnlySelected = cbReadonlyPrompt != null ? cbReadonlyPrompt.getSelection() : false;
|
||||||
IRemoteFile remoteFile = getRemoteFile();
|
IRemoteFile remoteFile = getRemoteFile();
|
||||||
|
|
||||||
if (ok && (cbReadonlyPrompt!=null) &&
|
if (ok && (cbReadonlyPrompt!=null) &&
|
||||||
((readOnlySelected && !wasReadOnly) ||
|
((readOnlySelected && !wasReadOnly) ||
|
||||||
(!readOnlySelected && wasReadOnly)))
|
(!readOnlySelected && wasReadOnly)))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -510,7 +513,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
// get old can write attribute
|
// get old can write attribute
|
||||||
boolean oldCanWrite = remoteFile.canWrite();
|
boolean oldCanWrite = remoteFile.canWrite();
|
||||||
|
|
||||||
//set readonly
|
//set readonly
|
||||||
remoteFile.getParentRemoteFileSubSystem().setReadOnly(remoteFile,readOnlySelected, new NullProgressMonitor());
|
remoteFile.getParentRemoteFileSubSystem().setReadOnly(remoteFile,readOnlySelected, new NullProgressMonitor());
|
||||||
|
|
||||||
// get the new can write attribute
|
// get the new can write attribute
|
||||||
|
@ -522,17 +525,17 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
// Need to keep local copy and remote copies up to date
|
// Need to keep local copy and remote copies up to date
|
||||||
editable.setReadOnly(readOnlySelected);
|
editable.setReadOnly(readOnlySelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the values haven't changed, then we need to
|
// if the values haven't changed, then we need to
|
||||||
// refresh
|
// refresh
|
||||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||||
|
|
||||||
remoteFile.markStale(true);
|
remoteFile.markStale(true);
|
||||||
|
|
||||||
// oldCanWrite and updatedValue may not be the same depending on the underlying file service
|
// oldCanWrite and updatedValue may not be the same depending on the underlying file service
|
||||||
// If the file service updates the underlying object, then there is no need for a remote refresh
|
// If the file service updates the underlying object, then there is no need for a remote refresh
|
||||||
if (oldCanWrite == updatedValue)
|
if (oldCanWrite == updatedValue)
|
||||||
{
|
{
|
||||||
if (remoteFile.isDirectory())
|
if (remoteFile.isDirectory())
|
||||||
{
|
{
|
||||||
sr.fireEvent(new SystemResourceChangeEvent(remoteFile.getParentRemoteFile(),ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE, null));
|
sr.fireEvent(new SystemResourceChangeEvent(remoteFile.getParentRemoteFile(),ISystemResourceChangeEvents.EVENT_REFRESH_REMOTE, null));
|
||||||
|
@ -543,33 +546,33 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sr.fireEvent(new SystemResourceChangeEvent(remoteFile,ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,null));
|
sr.fireEvent(new SystemResourceChangeEvent(remoteFile,ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE,null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (RemoteFileIOException exc) {
|
catch (RemoteFileIOException exc) {
|
||||||
String msgDetails = NLS.bind(FileResources.FILEMSG_IO_ERROR_DETAILS, exc.getMessage());
|
String msgDetails = NLS.bind(FileResources.FILEMSG_IO_ERROR_DETAILS, exc.getMessage());
|
||||||
setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
ISystemFileConstants.FILEMSG_IO_ERROR,
|
ISystemFileConstants.FILEMSG_IO_ERROR,
|
||||||
IStatus.ERROR, FileResources.FILEMSG_IO_ERROR, msgDetails));
|
IStatus.ERROR, FileResources.FILEMSG_IO_ERROR, msgDetails));
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (RemoteFileSecurityException exc) {
|
catch (RemoteFileSecurityException exc) {
|
||||||
String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, exc.getMessage());
|
String msgDetails = NLS.bind(FileResources.FILEMSG_SECURITY_ERROR_DETAILS, exc.getMessage());
|
||||||
setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
setMessage(new SimpleSystemMessage(Activator.PLUGIN_ID,
|
||||||
ISystemFileConstants.FILEMSG_SECURITY_ERROR,
|
ISystemFileConstants.FILEMSG_SECURITY_ERROR,
|
||||||
IStatus.ERROR, FileResources.FILEMSG_SECURITY_ERROR, msgDetails));
|
IStatus.ERROR, FileResources.FILEMSG_SECURITY_ERROR, msgDetails));
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (SystemMessageException e) {
|
catch (SystemMessageException e) {
|
||||||
setMessage(e.getSystemMessage());
|
setMessage(e.getSystemMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the encoding
|
// set the encoding
|
||||||
String selectedEncoding = getSelectedEncoding();
|
String selectedEncoding = getSelectedEncoding();
|
||||||
|
|
||||||
|
|
||||||
if (ok && encodingFieldAdded && prevEncoding != null && !prevEncoding.equals(selectedEncoding)) {
|
if (ok && encodingFieldAdded && prevEncoding != null && !prevEncoding.equals(selectedEncoding)) {
|
||||||
IRemoteFile rfile = getRemoteFile();
|
IRemoteFile rfile = getRemoteFile();
|
||||||
IRemoteFileSubSystem subsys = rfile.getParentRemoteFileSubSystem();
|
IRemoteFileSubSystem subsys = rfile.getParentRemoteFileSubSystem();
|
||||||
|
@ -577,7 +580,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
|
|
||||||
RemoteFileEncodingManager mgr = RemoteFileEncodingManager.getInstance();
|
RemoteFileEncodingManager mgr = RemoteFileEncodingManager.getInstance();
|
||||||
if (defaultEncodingButton.getSelection())
|
if (defaultEncodingButton.getSelection())
|
||||||
{
|
{
|
||||||
mgr.setEncoding(hostName, rfile.getAbsolutePath(),null);
|
mgr.setEncoding(hostName, rfile.getAbsolutePath(),null);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -585,7 +588,7 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
mgr.setEncoding(hostName, rfile.getAbsolutePath(), getSelectedEncoding());
|
mgr.setEncoding(hostName, rfile.getAbsolutePath(), getSelectedEncoding());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile);
|
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile);
|
||||||
if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.NOT_OPEN) {
|
if (editable.checkOpenInEditor() != ISystemEditableRemoteObject.NOT_OPEN) {
|
||||||
IFile file = editable.getLocalResource();
|
IFile file = editable.getLocalResource();
|
||||||
|
@ -594,26 +597,26 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean wantDefaultAndApplyButton()
|
protected boolean wantDefaultAndApplyButton()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void performApply() {
|
protected void performApply() {
|
||||||
performOk();
|
performOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
doInitializeFields();
|
doInitializeFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate all the widgets on the page
|
* Validate all the widgets on the page
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -627,11 +630,11 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
|
|
||||||
public void widgetDefaultSelected(SelectionEvent event)
|
public void widgetDefaultSelected(SelectionEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
public void widgetSelected(SelectionEvent event)
|
public void widgetSelected(SelectionEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -643,13 +646,13 @@ public class SystemFilePropertyPage extends SystemBasePropertyPage
|
||||||
{
|
{
|
||||||
file = file.getParentRemoteFileSubSystem().getRemoteFileObject(file.getAbsolutePath(), new NullProgressMonitor());
|
file = file.getParentRemoteFileSubSystem().getRemoteFileObject(file.getAbsolutePath(), new NullProgressMonitor());
|
||||||
}
|
}
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
}
|
}
|
||||||
setElement((IAdaptable)file);
|
setElement((IAdaptable)file);
|
||||||
|
|
||||||
// reset according to the changed file
|
// reset according to the changed file
|
||||||
performDefaults();
|
performDefaults();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.setVisible(visible);
|
super.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI
|
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI
|
||||||
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
|
* David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types
|
||||||
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
|
* David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
|
||||||
|
* Martin Oberhuber (Wind River) - [226574][api] Add ISubSystemConfiguration#supportsEncoding()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.core.subsystems;
|
package org.eclipse.rse.core.subsystems;
|
||||||
|
@ -188,6 +189,24 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
||||||
// CRITICAL METHODS...
|
// CRITICAL METHODS...
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test whether this subsystem configuration supports custom encodings. We
|
||||||
|
* fall back to the setting provided by the host, or its underlying system
|
||||||
|
* type by default.
|
||||||
|
*
|
||||||
|
* @see ISubSystemConfiguration#supportsEncoding(IHost)
|
||||||
|
* @since org.eclipse.rse.core 3.0
|
||||||
|
*/
|
||||||
|
public boolean supportsEncoding(IHost host) {
|
||||||
|
// support encodings by default
|
||||||
|
boolean rv = true;
|
||||||
|
if (host.getSystemType().testProperty(IRSESystemType.PROPERTY_SUPPORTS_ENCODING, false)) {
|
||||||
|
// switched off on system type level
|
||||||
|
rv = false;
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if instance of this subsystem configuration's subsystems support connect and disconnect actions.
|
* Return true if instance of this subsystem configuration's subsystems support connect and disconnect actions.
|
||||||
* <b>By default, returns true</b>.
|
* <b>By default, returns true</b>.
|
||||||
|
@ -534,7 +553,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
||||||
* from static declaration in the
|
* from static declaration in the
|
||||||
* <tt>org.eclipse.rse.core.subsystemConfigurations</tt> and
|
* <tt>org.eclipse.rse.core.subsystemConfigurations</tt> and
|
||||||
* <tt>org.eclipse.rse.core.systemTypes</tt> extension points.
|
* <tt>org.eclipse.rse.core.systemTypes</tt> extension points.
|
||||||
*
|
*
|
||||||
* @noextend This method is not intended to be extended by clients. It will
|
* @noextend This method is not intended to be extended by clients. It will
|
||||||
* likely be declared <tt>final</tt> in the next release in
|
* likely be declared <tt>final</tt> in the next release in
|
||||||
* order to ensure consistency with static xml markup in the
|
* order to ensure consistency with static xml markup in the
|
||||||
|
|
Loading…
Add table
Reference in a new issue