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 84210 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]
Patch to add error message in Preference and Profile Dialog.
208831 patch.txt (text/plain), 14.90 KB, created by
Bing Xu
on 2007-11-30 13:22:51 EST
(
hide
)
Description:
Patch to add error message in Preference and Profile Dialog.
Filename:
MIME Type:
Creator:
Bing Xu
Created:
2007-11-30 13:22:51 EST
Size:
14.90 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#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 30 Nov 2007 18:14:03 -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* the internal agent controller is supported on your 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? >#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 30 Nov 2007 18:14:03 -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 hasShownNotSupportPlatformError = false; > > /* Instance of the plugin activator class */ > private static AdminPlugin adminPlugin = AdminPlugin.getDefault(); >@@ -50,7 +51,15 @@ > * @return Indicates the status of starting IAC. 0 if successful, nonzero if not. > */ > public static synchronized int startIAC() >- { >+ { >+ //bug 208831: Popup error for not supported platform. >+ if(! hasShownNotSupportPlatformError && !AdminUtil.isSupportedPlatform() ){ >+ AdminUtil.openErrorDialog(PreferenceMessages.ERROR_DIALOG_TITLE, PreferenceMessages.NOT_SUPPORT_PLATFORM); >+ hasShownNotSupportPlatformError = true; >+ return 3; >+ } >+ //end bug 208831 >+ > /* Do we have an instance of our plugin activator */ > if (adminPlugin == null) > { >Index: src/org/eclipse/tptp/platform/iac/administrator/internal/common/CommonConstants.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.iac.administrator/src/org/eclipse/tptp/platform/iac/administrator/internal/common/CommonConstants.java,v >retrieving revision 1.4 >diff -u -r1.4 CommonConstants.java >--- src/org/eclipse/tptp/platform/iac/administrator/internal/common/CommonConstants.java 5 May 2007 04:10:36 -0000 1.4 >+++ src/org/eclipse/tptp/platform/iac/administrator/internal/common/CommonConstants.java 30 Nov 2007 18:14:03 -0000 >@@ -11,6 +11,7 @@ > **********************************************************************/ > package org.eclipse.tptp.platform.iac.administrator.internal.common; > >+ > /** > * Common constants used for this plugin > * @author Navid Mehregani >@@ -70,5 +71,10 @@ > > /* Execution framework Plugin */ > public static final String EXECUTION_FRAMEWORK = "org.eclipse.hyades.execution"; >- >+ >+ //208831, add supported platforms >+ public static String[] supportedPlatforms = {WIN_IA32,WIN_EM64T, WIN_IPF,LINUX_IA32, LINUX_EM64T,LINUX_IPF}; >+ >+ >+ > } >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 30 Nov 2007 18:14:03 -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,57 @@ > return valid; > } > >+ >+ //bug 208831 >+ public static boolean isSupportedPlatform(){ >+ >+ String platform = getPlatformSymbolicName(); >+ >+ for(int i = 0; i < CommonConstants.supportedPlatforms.length; i++){ >+ if(CommonConstants.supportedPlatforms[i].equalsIgnoreCase(platform)) >+ return true; >+ >+ } >+ return false; >+ } >+ >+ /* >+ * 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 30 Nov 2007 18:14:03 -0000 >@@ -34,6 +34,9 @@ > ADD_BUTTON = Add... > EDIT_BUTTON = Edit... > REMOVE_BUTTON = Remove... >+ NOT_SUPPORT_PLATFORM=Your platform is not supported by this version of Eclipse TPTP. Agent Controller would be disabled. \nTo profile your localhost, please install and use a stand along Agent Controller. >+ ERROR_DIALOG_TITLE=Error >+ ERROR_GENERAL=An error has happened within the interal 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 30 Nov 2007 18:14:03 -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 30 Nov 2007 18:14:03 -0000 >@@ -4,7 +4,7 @@ > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at > * http://www.eclipse.org/legal/epl-v10.html >- * $Id: IACPreferencePage.java,v 1.7 2007/11/30 16:51:23 samwai Exp $ >+ * $Id: IACPreferencePage.java,v 1.6 2007/05/08 15:01:17 nmehrega Exp $ > * > * Contributors: > * IBM - Initial API and implementation >@@ -22,6 +22,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,8 +113,20 @@ > /* 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; >+ private boolean isSupportedPlatform; >+ //end bug 208831 >+ > protected Control createContents(Composite parent) { > preferenceComposite = parent; >+ >+ //bug 208831 >+ if(!AdminUtil.isSupportedPlatform()) >+ createNotSupportPlatformErrorComposite(parent); >+ //end bug 208831 >+ > createEnableDisableComposite(parent); > GridLayout gridLayout = new GridLayout(); > gridLayout.horizontalSpacing = 5; >@@ -134,14 +147,15 @@ > composite.setLayout(gridLayout); > label = new Label(composite, SWT.NONE); > label.setText(PreferenceMessages.JAVA_EXECUTABLE); >- label.setLayoutData(gridData1); >+ //label.setLayoutData(gridData1); > createJavaExecutableText(); > createAllowedHostsGroup(); > createAcSecurityGroup(); > > /* Get the saved values from the preference store */ > refreshValuesFromPreference(); >- >+ >+ > > //bug 184625, add CSH > PlatformUI.getWorkbench().getHelpSystem().setHelp(enableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0001"); >@@ -160,9 +174,23 @@ > 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(!isSupportedPlatform){ >+ >+ enableIACButton.setSelection(false); >+ disableIACButton.setSelection(false); >+ enableIACButton.setEnabled(false); >+ disableIACButton.setEnabled(false); >+ >+ setIACEnable(false); >+ } >+ //end bug 208831 > return composite; > } > >+ >+ > /** > * This helper method is used to extract the preference page values from the preference store. > * It's called when the preference page is created under 'createContents' >@@ -655,6 +683,32 @@ > }); > } > >+ //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 > *
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