Home » Eclipse Projects » Platform - User Assistance (UA) » Eclipse 3.4 adding remote infocenter
Eclipse 3.4 adding remote infocenter [message #474608] |
Fri, 10 October 2008 19:11 |
David Kyle Messages: 125 Registered: July 2009 |
Senior Member |
|
|
Hi,
Our RCP application needs to add a dynamic remote infocenter, we have to use
an existing configuration system hence the calls to CfgInfo (our code).
Our current method is:
// accessing a discouraged internal class
Preferences preferences =
HelpBasePlugin.getDefault().getPluginPreferences();
try {
preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ ON,
true);
preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ DEFAULT_PORT,
false);
preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ HOST,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PATH,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PORT,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_ON ,
true);
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_DE FAULT_PORT,
false);
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_IC Enabled,
true);
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_HO ST,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PA TH,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PO RT,
CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
} catch (Exception e) {
log.error(e.getMessage(), e);
}
Not pretty but it works in Eclipse 3.3 and it appears to work in Eclipse
3.4. Now that Eclipse 3.4 can handle multiple remote infocenters is there a
way to add one programmatically?
Thanks,
David Kyle
|
|
|
Re: Eclipse 3.4 adding remote infocenter [message #474610 is a reply to message #474608] |
Fri, 10 October 2008 20:16 |
Chris Goldthorpe Messages: 815 Registered: July 2009 |
Senior Member |
|
|
Yes you could do that - with multiple remote infocenters the preferences
are comma separated, see
org.eclipse.help.internal.base.remote.PreferenceFileHandler and
org.eclipse.help.internal.base.remote.RemoteIC for an example of code
that reads and writes these preferences.
David Kyle wrote:
> Hi,
>
> Our RCP application needs to add a dynamic remote infocenter, we have to use
> an existing configuration system hence the calls to CfgInfo (our code).
>
> Our current method is:
>
> // accessing a discouraged internal class
> Preferences preferences =
> HelpBasePlugin.getDefault().getPluginPreferences();
> try {
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ ON,
> true);
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ DEFAULT_PORT,
> false);
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ HOST,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PATH,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PORT,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_ON ,
> true);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_DE FAULT_PORT,
> false);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_IC Enabled,
> true);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_HO ST,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PA TH,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PO RT,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
> } catch (Exception e) {
> log.error(e.getMessage(), e);
> }
>
> Not pretty but it works in Eclipse 3.3 and it appears to work in Eclipse
> 3.4. Now that Eclipse 3.4 can handle multiple remote infocenters is there a
> way to add one programmatically?
>
> Thanks,
> David Kyle
>
>
|
|
|
Re: Eclipse 3.4 adding remote infocenter [message #620076 is a reply to message #474608] |
Fri, 10 October 2008 20:16 |
Chris Goldthorpe Messages: 815 Registered: July 2009 |
Senior Member |
|
|
Yes you could do that - with multiple remote infocenters the preferences
are comma separated, see
org.eclipse.help.internal.base.remote.PreferenceFileHandler and
org.eclipse.help.internal.base.remote.RemoteIC for an example of code
that reads and writes these preferences.
David Kyle wrote:
> Hi,
>
> Our RCP application needs to add a dynamic remote infocenter, we have to use
> an existing configuration system hence the calls to CfgInfo (our code).
>
> Our current method is:
>
> // accessing a discouraged internal class
> Preferences preferences =
> HelpBasePlugin.getDefault().getPluginPreferences();
> try {
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ ON,
> true);
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ DEFAULT_PORT,
> false);
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ HOST,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PATH,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
> preferences.setDefault(IHelpBaseConstants.P_KEY_REMOTE_HELP_ PORT,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_ON ,
> true);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_DE FAULT_PORT,
> false);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_IC Enabled,
> true);
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_HO ST,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_HOST));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PA TH,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PATH));
> preferences.setValue(IHelpBaseConstants.P_KEY_REMOTE_HELP_PO RT,
> CfgInfo.getValue(ICfgInfoConstants.SECTION_IPE,
> ICfgInfoConstants.TAG_REMOTE_HELP_PORT));
> } catch (Exception e) {
> log.error(e.getMessage(), e);
> }
>
> Not pretty but it works in Eclipse 3.3 and it appears to work in Eclipse
> 3.4. Now that Eclipse 3.4 can handle multiple remote infocenters is there a
> way to add one programmatically?
>
> Thanks,
> David Kyle
>
>
|
|
|
Goto Forum:
Current Time: Thu Sep 19 21:04:28 GMT 2024
Powered by FUDForum. Page generated in 0.04552 seconds
|