Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 208831 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/platform/iac/administrator/internal/startstop/AutoStartStop.java (+8 lines)
Lines 40-45 Link Here
40
	/* Set to true when WE start IAC; false otherwise.  
40
	/* Set to true when WE start IAC; false otherwise.  
41
	 * This boolean is unaffected if the user has manually started an instance the stand-alone AC */
41
	 * This boolean is unaffected if the user has manually started an instance the stand-alone AC */
42
	private static boolean iacStarted = false;
42
	private static boolean iacStarted = false;
43
	private static boolean shownNotSupportPlatformError = false;
43
		
44
		
44
	/* Instance of the plugin activator class */
45
	/* Instance of the plugin activator class */
45
	private static AdminPlugin adminPlugin = AdminPlugin.getDefault();
46
	private static AdminPlugin adminPlugin = AdminPlugin.getDefault();
Lines 59-64 Link Here
59
			return 1;
60
			return 1;
60
		}
61
		}
61
		
62
		
63
		if(!AdminUtil.isSupportedPlatform() && !shownNotSupportPlatformError){
64
			AdminUtil.openErrorDialog(PreferenceMessages.ERROR_DIALOG_TITLE, PreferenceMessages.NOT_SUPPORT_PLATFORM);
65
			shownNotSupportPlatformError = true;
66
		}
67
		
68
		
69
		
62
		/* Do nothing if IAC is disabled */
70
		/* Do nothing if IAC is disabled */
63
		if (!adminPlugin.getBoolean(PreferenceMessages.ENABLE_DISABLE_LABEL))
71
		if (!adminPlugin.getBoolean(PreferenceMessages.ENABLE_DISABLE_LABEL))
64
			return 0;
72
			return 0;
(-)src/org/eclipse/tptp/platform/iac/administrator/internal/common/AdminUtil.java (+53 lines)
Lines 22-41 Link Here
22
import javax.xml.parsers.DocumentBuilder;
22
import javax.xml.parsers.DocumentBuilder;
23
import javax.xml.parsers.DocumentBuilderFactory;
23
import javax.xml.parsers.DocumentBuilderFactory;
24
24
25
import org.eclipse.core.resources.IResourceStatus;
26
import org.eclipse.core.resources.ResourcesPlugin;
25
import org.eclipse.core.runtime.FileLocator;
27
import org.eclipse.core.runtime.FileLocator;
26
import org.eclipse.core.runtime.IBundleGroup;
28
import org.eclipse.core.runtime.IBundleGroup;
27
import org.eclipse.core.runtime.IBundleGroupProvider;
29
import org.eclipse.core.runtime.IBundleGroupProvider;
28
import org.eclipse.core.runtime.Platform;
30
import org.eclipse.core.runtime.Platform;
29
import org.eclipse.core.runtime.Status;
31
import org.eclipse.core.runtime.Status;
30
import org.eclipse.jdt.launching.JavaRuntime;
32
import org.eclipse.jdt.launching.JavaRuntime;
33
import org.eclipse.jface.dialogs.ErrorDialog;
31
import org.eclipse.jface.dialogs.IDialogConstants;
34
import org.eclipse.jface.dialogs.IDialogConstants;
32
import org.eclipse.jface.dialogs.MessageDialog;
35
import org.eclipse.jface.dialogs.MessageDialog;
33
import org.eclipse.swt.SWT;
36
import org.eclipse.swt.SWT;
34
import org.eclipse.swt.layout.GridData;
37
import org.eclipse.swt.layout.GridData;
38
import org.eclipse.swt.widgets.Display;
35
import org.eclipse.swt.widgets.Shell;
39
import org.eclipse.swt.widgets.Shell;
36
import org.eclipse.tptp.platform.iac.administrator.AdminPlugin;
40
import org.eclipse.tptp.platform.iac.administrator.AdminPlugin;
37
import org.eclipse.tptp.platform.iac.administrator.internal.config.ConfigGenerator;
41
import org.eclipse.tptp.platform.iac.administrator.internal.config.ConfigGenerator;
38
import org.eclipse.tptp.platform.iac.administrator.internal.preference.PreferenceMessages;
42
import org.eclipse.tptp.platform.iac.administrator.internal.preference.PreferenceMessages;
43
import org.eclipse.ui.IWorkbench;
44
import org.eclipse.ui.PlatformUI;
39
import org.osgi.framework.Bundle;
45
import org.osgi.framework.Bundle;
40
import org.w3c.dom.Document;
46
import org.w3c.dom.Document;
41
import org.w3c.dom.Element;
47
import org.w3c.dom.Element;
Lines 658-661 Link Here
658
		return valid;
664
		return valid;
659
	}
665
	}
660
	
666
	
667
	
668
	//bug 208831
669
	public static boolean isSupportedPlatform(){
670
		
671
		return getPlatformSymbolicName() != null;
672
	}
673
	
674
	
675
	/*
676
	 * Copy from ConnectUtilUI.java because can't import that class because of circular reference.
677
	 * 
678
	 **/
679
	private static Shell getValidShell() {
680
		Shell shell = null;
681
		IWorkbench workbench = PlatformUI.getWorkbench();
682
		if (workbench != null) {
683
			if (workbench.getActiveWorkbenchWindow() != null) {
684
				shell = workbench.getActiveWorkbenchWindow().getShell();
685
				if ((shell != null) && (!shell.isDisposed()))
686
					return shell;
687
			}
688
689
			if (workbench.getWorkbenchWindows().length > 0) {
690
				shell = workbench.getWorkbenchWindows()[0].getShell();
691
				if ((shell != null) && (!shell.isDisposed()))
692
					return shell;
693
			}
694
		}
695
696
		return null;
697
	}
698
	
699
	
700
	/*
701
	 * Copy from ConnectUtilUI.java because can't import that class because of circular reference.
702
	 * 
703
	 **/
704
	public static void openErrorDialog(final String title, final String message){
705
		Display.getDefault().syncExec(new Runnable() {
706
			public void run() {
707
				
708
				Status err = new Status(Status.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.ERROR, message,new Exception(message));
709
				ErrorDialog.openError(getValidShell(), title,PreferenceMessages.ERROR_GENERAL, err);
710
			}
711
		});
712
		
713
	}
661
}
714
}
(-)src/org/eclipse/tptp/platform/iac/administrator/internal/preference/messages.properties (+3 lines)
Lines 34-39 Link Here
34
  ADD_BUTTON = Add...
34
  ADD_BUTTON = Add...
35
  EDIT_BUTTON = Edit...
35
  EDIT_BUTTON = Edit...
36
  REMOVE_BUTTON = Remove...
36
  REMOVE_BUTTON = Remove...
37
  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. 
38
  ERROR_DIALOG_TITLE=Error
39
  ERROR_GENERAL=An error has occurred within the Integrated Agent Controller.
37
  
40
  
38
# Confirmation dialog. Do not translate IAC.
41
# Confirmation dialog. Do not translate IAC.
39
  CONFIRMATION_TITLE = Confirmation Dialog
42
  CONFIRMATION_TITLE = Confirmation Dialog
(-)src/org/eclipse/tptp/platform/iac/administrator/internal/preference/PreferenceMessages.java (-1 / +4 lines)
Lines 45-51 Link Here
45
	public static String ADD_BUTTON;
45
	public static String ADD_BUTTON;
46
	public static String EDIT_BUTTON;
46
	public static String EDIT_BUTTON;
47
	public static String REMOVE_BUTTON;
47
	public static String REMOVE_BUTTON;
48
		
48
	public static String NOT_SUPPORT_PLATFORM;
49
	public static String ERROR_DIALOG_TITLE;
50
	public static String ERROR_GENERAL;
51
	
49
	/* Confirmation dialog */
52
	/* Confirmation dialog */
50
	public static String CONFIRMATION_TITLE;
53
	public static String CONFIRMATION_TITLE;
51
	public static String CONFIRMATION_MESSAGE;
54
	public static String CONFIRMATION_MESSAGE;
(-)src/org/eclipse/tptp/platform/iac/administrator/internal/preference/IACPreferencePage.java (-1 / +55 lines)
Lines 14-19 Link Here
14
14
15
import java.util.StringTokenizer;
15
import java.util.StringTokenizer;
16
16
17
import org.eclipse.core.runtime.Status;
17
import org.eclipse.jface.dialogs.Dialog;
18
import org.eclipse.jface.dialogs.Dialog;
18
import org.eclipse.jface.dialogs.IDialogConstants;
19
import org.eclipse.jface.dialogs.IDialogConstants;
19
import org.eclipse.jface.dialogs.MessageDialog;
20
import org.eclipse.jface.dialogs.MessageDialog;
Lines 22-27 Link Here
22
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.SWT;
23
import org.eclipse.swt.events.ModifyEvent;
24
import org.eclipse.swt.events.ModifyEvent;
24
import org.eclipse.swt.events.ModifyListener;
25
import org.eclipse.swt.events.ModifyListener;
26
import org.eclipse.swt.graphics.Color;
25
import org.eclipse.swt.graphics.Point;
27
import org.eclipse.swt.graphics.Point;
26
import org.eclipse.swt.layout.GridData;
28
import org.eclipse.swt.layout.GridData;
27
import org.eclipse.swt.layout.GridLayout;
29
import org.eclipse.swt.layout.GridLayout;
Lines 112-118 Link Here
112
	/* Stores the preference composite. Used for displaying warning when config file has to be regenerated */
114
	/* Stores the preference composite. Used for displaying warning when config file has to be regenerated */
113
	private Composite preferenceComposite = null;
115
	private Composite preferenceComposite = null;
114
	
116
	
117
	//bug 208831
118
	private Composite notSupportPlatformComposite = null;
119
	private Label notSupportPlatformMsg = null;
120
	//end bug 208831
121
122
	
123
	
115
	protected Control createContents(Composite parent) {
124
	protected Control createContents(Composite parent) {
125
		
126
		//bug 208831
127
		if(!AdminUtil.isSupportedPlatform()){
128
			createNotSupportPlatformErrorComposite(parent);
129
			AdminPlugin.getDefault().getLog().log(new Status(Status.INFO, AdminPlugin.PLUGIN_ID,"Local platform is not supported by Integrated Agent Controller." ));		
130
		}
131
		//end bug 208831
132
		
133
 
116
		preferenceComposite = parent;
134
		preferenceComposite = parent;
117
		createEnableDisableComposite(parent);
135
		createEnableDisableComposite(parent);
118
		GridLayout gridLayout = new GridLayout();
136
		GridLayout gridLayout = new GridLayout();
Lines 142-148 Link Here
142
		/* Get the saved values from the preference store */
160
		/* Get the saved values from the preference store */
143
		refreshValuesFromPreference();
161
		refreshValuesFromPreference();
144
162
145
		
146
		//bug 184625, add CSH
163
		//bug 184625, add CSH
147
		PlatformUI.getWorkbench().getHelpSystem().setHelp(enableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0001");
164
		PlatformUI.getWorkbench().getHelpSystem().setHelp(enableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0001");
148
		PlatformUI.getWorkbench().getHelpSystem().setHelp(disableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0002");
165
		PlatformUI.getWorkbench().getHelpSystem().setHelp(disableIACButton, AdminPlugin.PLUGIN_ID+".iacpp0002");
Lines 160-165 Link Here
160
		PlatformUI.getWorkbench().getHelpSystem().setHelp(addUserButton, AdminPlugin.PLUGIN_ID+".iacpp0014");
177
		PlatformUI.getWorkbench().getHelpSystem().setHelp(addUserButton, AdminPlugin.PLUGIN_ID+".iacpp0014");
161
		PlatformUI.getWorkbench().getHelpSystem().setHelp(removeUserButton, AdminPlugin.PLUGIN_ID+".iacpp0015");
178
		PlatformUI.getWorkbench().getHelpSystem().setHelp(removeUserButton, AdminPlugin.PLUGIN_ID+".iacpp0015");
162
		PlatformUI.getWorkbench().getHelpSystem().setHelp(editUserButton, AdminPlugin.PLUGIN_ID+".iacpp0016");
179
		PlatformUI.getWorkbench().getHelpSystem().setHelp(editUserButton, AdminPlugin.PLUGIN_ID+".iacpp0016");
180
		
181
		//208831
182
		if(!AdminUtil.isSupportedPlatform()){
183
			
184
			enableIACButton.setSelection(false);
185
			disableIACButton.setSelection(false);
186
			enableIACButton.setEnabled(false);
187
			disableIACButton.setEnabled(false);
188
			
189
			setIACEnable(false);
190
		}
191
		//end bug 208831
163
		return composite;
192
		return composite;
164
	}
193
	}
165
	
194
	
Lines 654-659 Link Here
654
			}
683
			}
655
		});
684
		});
656
	}
685
	}
686
	//bug 208831
687
	private void createNotSupportPlatformErrorComposite(Composite parent) {
688
		
689
		GridData gridData1 = new GridData();
690
		gridData1.grabExcessHorizontalSpace = true;
691
		gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
692
		
693
		GridLayout gridLayout2 = new GridLayout();
694
		gridLayout2.numColumns = 17;
695
		notSupportPlatformComposite = new Composite(parent, SWT.NONE);
696
		notSupportPlatformComposite.setLayout(gridLayout2);
697
		notSupportPlatformComposite.setLayoutData(gridData1);
698
699
		
700
		GridData gridData3 = new GridData();			
701
		gridData3.grabExcessHorizontalSpace = false;
702
		gridData3.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
703
		notSupportPlatformMsg = new Label(notSupportPlatformComposite, SWT.NONE);
704
		notSupportPlatformMsg.setText(PreferenceMessages.NOT_SUPPORT_PLATFORM);
705
		notSupportPlatformMsg.setSize(150, 20);
706
		notSupportPlatformMsg.setForeground(new Color(null, 255, 0, 0));
707
		
708
		notSupportPlatformMsg.setLayoutData(gridData3);
709
	}
710
	//end bug 208831
657
	
711
	
658
	/**
712
	/**
659
	 * This method creates the enable disable buttons	
713
	 * This method creates the enable disable buttons	
(-)src/org/eclipse/hyades/security/internal/util/messages.properties (-1 / +1 lines)
Lines 83-89 Link Here
83
_64  = Unknown
83
_64  = Unknown
84
_65  = Alias name can not be empty
84
_65  = Alias name can not be empty
85
_66  = This alias name already exists, use another one
85
_66  = This alias name already exists, use another one
86
_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.
86
_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.
87
_68  = IWAT0017E Security Certificate not available for host {0}.\n Make sure that you have the correct security certificates imported into the workspace.
87
_68  = IWAT0017E Security Certificate not available for host {0}.\n Make sure that you have the correct security certificates imported into the workspace.
88
_69  = IWAT0111E Security Certificate not found.\n To be able to connect, please import a Security Certificate into the workspace.
88
_69  = IWAT0111E Security Certificate not found.\n To be able to connect, please import a Security Certificate into the workspace.
89
_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?
89
_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?

Return to bug 208831