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 87276 Details for
Bug 208831
Add a platform check and an appropriate error message for unsupported platforms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Latest patch after implementing Paul's comment #6
208831 patch.txt (text/plain), 12.91 KB, created by
Bing Xu
on 2008-01-18 11:18:46 EST
(
hide
)
Description:
Latest patch after implementing Paul's comment #6
Filename:
MIME Type:
Creator:
Bing Xu
Created:
2008-01-18 11:18:46 EST
Size:
12.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.iac.administrator >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java,v >retrieving revision 1.11 >diff -u -r1.11 AutoStartStop.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java 10 May 2007 15:11:10 -0000 1.11 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java 18 Jan 2008 16:16:25 -0000 >@@ -40,6 +40,7 @@ > /* Set to true when WE start IAC; false otherwise. > * This boolean is unaffected if the user has manually started an instance the stand-alone AC */ > private static boolean iacStarted = false; >+ private static boolean shownNotSupportPlatformError = false; > > /* Instance of the plugin activator class */ > private static AdminPlugin adminPlugin = AdminPlugin.getDefault(); >@@ -59,6 +60,13 @@ > return 1; > } > >+ if(!AdminUtil.isSupportedPlatform() && !shownNotSupportPlatformError){ >+ AdminUtil.openErrorDialog(PreferenceMessages.ERROR_DIALOG_TITLE, PreferenceMessages.NOT_SUPPORT_PLATFORM); >+ shownNotSupportPlatformError = true; >+ } >+ >+ >+ > /* Do nothing if IAC is disabled */ > if (!adminPlugin.getBoolean(PreferenceMessages.ENABLE_DISABLE_LABEL)) > return 0; >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java,v >retrieving revision 1.17 >diff -u -r1.17 AdminUtil.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java 23 Aug 2007 14:26:29 -0000 1.17 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java 18 Jan 2008 16:16:25 -0000 >@@ -22,20 +22,26 @@ > import javax.xml.parsers.DocumentBuilder; > import javax.xml.parsers.DocumentBuilderFactory; > >+import org.eclipse.core.resources.IResourceStatus; >+import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.FileLocator; > import org.eclipse.core.runtime.IBundleGroup; > import org.eclipse.core.runtime.IBundleGroupProvider; > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Status; > import org.eclipse.jdt.launching.JavaRuntime; >+import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.tptp.platform.iac.administrator.AdminPlugin; > import org.eclipse.tptp.platform.iac.administrator.internal.config.ConfigGenerator; > import org.eclipse.tptp.platform.iac.administrator.internal.preference.PreferenceMessages; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.PlatformUI; > import org.osgi.framework.Bundle; > import org.w3c.dom.Document; > import org.w3c.dom.Element; >@@ -658,4 +664,51 @@ > return valid; > } > >+ >+ //bug 208831 >+ public static boolean isSupportedPlatform(){ >+ >+ return getPlatformSymbolicName() != null; >+ } >+ >+ >+ /* >+ * Copy from ConnectUtilUI.java because can't import that class because of circular reference. >+ * >+ **/ >+ private static Shell getValidShell() { >+ Shell shell = null; >+ IWorkbench workbench = PlatformUI.getWorkbench(); >+ if (workbench != null) { >+ if (workbench.getActiveWorkbenchWindow() != null) { >+ shell = workbench.getActiveWorkbenchWindow().getShell(); >+ if ((shell != null) && (!shell.isDisposed())) >+ return shell; >+ } >+ >+ if (workbench.getWorkbenchWindows().length > 0) { >+ shell = workbench.getWorkbenchWindows()[0].getShell(); >+ if ((shell != null) && (!shell.isDisposed())) >+ return shell; >+ } >+ } >+ >+ return null; >+ } >+ >+ >+ /* >+ * Copy from ConnectUtilUI.java because can't import that class because of circular reference. >+ * >+ **/ >+ public static void openErrorDialog(final String title, final String message){ >+ Display.getDefault().syncExec(new Runnable() { >+ public void run() { >+ >+ Status err = new Status(Status.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.ERROR, message,new Exception(message)); >+ ErrorDialog.openError(getValidShell(), title,PreferenceMessages.ERROR_GENERAL, err); >+ } >+ }); >+ >+ } > } >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/preference/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/preference/messages.properties,v >retrieving revision 1.3 >diff -u -r1.3 messages.properties >--- src/org/eclipse/tptp/platform/iac/administrator/internal/preference/messages.properties 26 Apr 2007 21:29:57 -0000 1.3 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/preference/messages.properties 18 Jan 2008 16:16:25 -0000 >@@ -34,6 +34,9 @@ > ADD_BUTTON = Add... > EDIT_BUTTON = Edit... > REMOVE_BUTTON = Remove... >+ NOT_SUPPORT_PLATFORM=Your platform is not supported by Eclipse TPTP. The Integrated Agent Controller will be disabled. \nTo profile on a supported host, please install and use a stand-alone Agent Controller on that host. >+ ERROR_DIALOG_TITLE=Error >+ ERROR_GENERAL=An error has occurred within the Integrated Agent Controller. > > # Confirmation dialog. Do not translate IAC. > CONFIRMATION_TITLE = Confirmation Dialog >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/preference/PreferenceMessages.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/preference/PreferenceMessages.java,v >retrieving revision 1.1 >diff -u -r1.1 PreferenceMessages.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/preference/PreferenceMessages.java 12 Apr 2007 18:02:53 -0000 1.1 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/preference/PreferenceMessages.java 18 Jan 2008 16:16:25 -0000 >@@ -45,7 +45,10 @@ > public static String ADD_BUTTON; > public static String EDIT_BUTTON; > public static String REMOVE_BUTTON; >- >+ public static String NOT_SUPPORT_PLATFORM; >+ public static String ERROR_DIALOG_TITLE; >+ public static String ERROR_GENERAL; >+ > /* Confirmation dialog */ > public static String CONFIRMATION_TITLE; > public static String CONFIRMATION_MESSAGE; >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/preference/IACPreferencePage.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/preference/IACPreferencePage.java,v >retrieving revision 1.7 >diff -u -r1.7 IACPreferencePage.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/preference/IACPreferencePage.java 30 Nov 2007 16:51:23 -0000 1.7 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/preference/IACPreferencePage.java 18 Jan 2008 16:16:25 -0000 >@@ -14,6 +14,7 @@ > > import java.util.StringTokenizer; > >+import org.eclipse.core.runtime.Status; > import org.eclipse.jface.dialogs.Dialog; > import org.eclipse.jface.dialogs.IDialogConstants; > import org.eclipse.jface.dialogs.MessageDialog; >@@ -22,6 +23,7 @@ > import org.eclipse.swt.SWT; > import org.eclipse.swt.events.ModifyEvent; > import org.eclipse.swt.events.ModifyListener; >+import org.eclipse.swt.graphics.Color; > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -112,7 +114,23 @@ > /* Stores the preference composite. Used for displaying warning when config file has to be regenerated */ > private Composite preferenceComposite = null; > >+ //bug 208831 >+ private Composite notSupportPlatformComposite = null; >+ private Label notSupportPlatformMsg = null; >+ //end bug 208831 >+ >+ >+ > protected Control createContents(Composite parent) { >+ >+ //bug 208831 >+ if(!AdminUtil.isSupportedPlatform()){ >+ createNotSupportPlatformErrorComposite(parent); >+ AdminPlugin.getDefault().getLog().log(new Status(Status.INFO, AdminPlugin.PLUGIN_ID,"Local platform is not supported by Integrated Agent Controller." )); >+ } >+ //end bug 208831 >+ >+ > preferenceComposite = parent; > createEnableDisableComposite(parent); > GridLayout gridLayout = new GridLayout(); >@@ -142,7 +160,6 @@ > /* Get the saved values from the preference store */ > refreshValuesFromPreference(); > >- > //bug 184625, add CSH > PlatformUI.getWorkbench().getHelpSystem().setHelp(enableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0001"); > PlatformUI.getWorkbench().getHelpSystem().setHelp(disableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0002"); >@@ -160,6 +177,18 @@ > PlatformUI.getWorkbench().getHelpSystem().setHelp(addUserButton, AdminPlugin.PLUGIN_ID+".iacpp0014"); > PlatformUI.getWorkbench().getHelpSystem().setHelp(removeUserButton, AdminPlugin.PLUGIN_ID+".iacpp0015"); > PlatformUI.getWorkbench().getHelpSystem().setHelp(editUserButton, AdminPlugin.PLUGIN_ID+".iacpp0016"); >+ >+ //208831 >+ if(!AdminUtil.isSupportedPlatform()){ >+ >+ enableIACButton.setSelection(false); >+ disableIACButton.setSelection(false); >+ enableIACButton.setEnabled(false); >+ disableIACButton.setEnabled(false); >+ >+ setIACEnable(false); >+ } >+ //end bug 208831 > return composite; > } > >@@ -654,6 +683,31 @@ > } > }); > } >+ //bug 208831 >+ private void createNotSupportPlatformErrorComposite(Composite parent) { >+ >+ GridData gridData1 = new GridData(); >+ gridData1.grabExcessHorizontalSpace = true; >+ gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL; >+ >+ GridLayout gridLayout2 = new GridLayout(); >+ gridLayout2.numColumns = 17; >+ notSupportPlatformComposite = new Composite(parent, SWT.NONE); >+ notSupportPlatformComposite.setLayout(gridLayout2); >+ notSupportPlatformComposite.setLayoutData(gridData1); >+ >+ >+ GridData gridData3 = new GridData(); >+ gridData3.grabExcessHorizontalSpace = false; >+ gridData3.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING; >+ notSupportPlatformMsg = new Label(notSupportPlatformComposite, SWT.NONE); >+ notSupportPlatformMsg.setText(PreferenceMessages.NOT_SUPPORT_PLATFORM); >+ notSupportPlatformMsg.setSize(150, 20); >+ notSupportPlatformMsg.setForeground(new Color(null, 255, 0, 0)); >+ >+ notSupportPlatformMsg.setLayoutData(gridData3); >+ } >+ //end bug 208831 > > /** > * This method creates the enable disable buttons >#P org.eclipse.tptp.platform.common >Index: src/org/eclipse/hyades/security/internal/util/messages.properties >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.common/src/org/eclipse/hyades/security/internal/util/messages.properties,v >retrieving revision 1.5 >diff -u -r1.5 messages.properties >--- src/org/eclipse/hyades/security/internal/util/messages.properties 19 Apr 2007 19:47:51 -0000 1.5 >+++ src/org/eclipse/hyades/security/internal/util/messages.properties 18 Jan 2008 16:16:24 -0000 >@@ -83,7 +83,7 @@ > _64 = Unknown > _65 = Alias name can not be empty > _66 = This alias name already exists, use another one >-_67 = IWAT0284E The agent controller is not available on host {0}.\n Make sure that:\n* the agent controller is installed.\n* the agent controller is configured to communicate with your machine.\n* you have the correct host name and port number for the agent controller. >+_67 = IWAT0284E The Agent Controller is not available on host {0}.\n Make sure that:\n* for localhost, the Internal Agent Controller is supported on your local platform. \n* the Agent Controller is installed.\n* the Agent Controller is configured to communicate with your machine.\n* you have the correct host name and port number for the Agent Controller. > _68 = IWAT0017E Security Certificate not available for host {0}.\n Make sure that you have the correct security certificates imported into the workspace. > _69 = IWAT0111E Security Certificate not found.\n To be able to connect, please import a Security Certificate into the workspace. > _70 = Information you exchange with this Agent Controller cannot be viewed or changed by others.\nHowever, it cannot be determined whether this Agent Controller is the intended target on host {0}.\nThe security certificate is unknown. You may view the certificate to determine whether you want to accept.\n\nDo you want to accept this certificate?
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 208831
:
84210
|
84213
|
87276
|
88432