|
Lines 18-25
Link Here
|
| 18 |
|
18 |
|
| 19 |
import org.eclipse.core.runtime.*; |
19 |
import org.eclipse.core.runtime.*; |
| 20 |
import org.eclipse.debug.core.*; |
20 |
import org.eclipse.debug.core.*; |
|
|
21 |
import org.eclipse.pde.internal.launching.launcher.OSGiFrameworkManager; |
| 21 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
22 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
| 22 |
import org.eclipse.pde.internal.ui.launcher.OSGiFrameworkManager; |
|
|
| 23 |
import org.eclipse.pde.ui.launcher.IPDELauncherConstants; |
23 |
import org.eclipse.pde.ui.launcher.IPDELauncherConstants; |
| 24 |
|
24 |
|
| 25 |
|
25 |
|
|
Lines 36-44
Link Here
|
| 36 |
private static final String RAP_LAUNCH_CONFIG_TYPE |
36 |
private static final String RAP_LAUNCH_CONFIG_TYPE |
| 37 |
= "org.eclipse.rap.ui.launch.RAPLauncher"; //$NON-NLS-1$ |
37 |
= "org.eclipse.rap.ui.launch.RAPLauncher"; //$NON-NLS-1$ |
| 38 |
|
38 |
|
| 39 |
private static final String EQUINOX_FRAMEWORK |
|
|
| 40 |
= "org.eclipse.pde.ui.EquinoxFramework"; //$NON-NLS-1$ |
| 41 |
|
| 42 |
private static final String EMPTY = ""; //$NON-NLS-1$ |
39 |
private static final String EMPTY = ""; //$NON-NLS-1$ |
| 43 |
|
40 |
|
| 44 |
|
41 |
|
|
Lines 57-63
Link Here
|
| 57 |
addNonOKState( states, validateUniquePort() ); |
54 |
addNonOKState( states, validateUniquePort() ); |
| 58 |
addNonOKState( states, validateURL() ); |
55 |
addNonOKState( states, validateURL() ); |
| 59 |
addNonOKState( states, validateLogLevel() ); |
56 |
addNonOKState( states, validateLogLevel() ); |
| 60 |
addNonOKState( states, validateOSGiFramework() ); |
|
|
| 61 |
} catch( CoreException e ) { |
57 |
} catch( CoreException e ) { |
| 62 |
String text |
58 |
String text |
| 63 |
= LaunchMessages.RAPLaunchConfigValidator_ErrorWhileValidating; |
59 |
= LaunchMessages.RAPLaunchConfigValidator_ErrorWhileValidating; |
|
Lines 163-178
Link Here
|
| 163 |
return result; |
159 |
return result; |
| 164 |
} |
160 |
} |
| 165 |
|
161 |
|
| 166 |
private IStatus validateOSGiFramework() throws CoreException { |
|
|
| 167 |
IStatus result = Status.OK_STATUS; |
| 168 |
String frameworkId = getOSGiFrameworkId(); |
| 169 |
if( !EQUINOX_FRAMEWORK.equals( frameworkId ) ) { |
| 170 |
String msg = LaunchMessages.RAPLaunchConfigValidator_EquinoxOnly; |
| 171 |
result = createWarning( msg, WARN_OSGI_FRAMEWORK, null ); |
| 172 |
} |
| 173 |
return result; |
| 174 |
} |
| 175 |
|
| 176 |
///////////////////////// |
162 |
///////////////////////// |
| 177 |
// Status creation helper |
163 |
// Status creation helper |
| 178 |
|
164 |
|
|
Lines 215-230
Link Here
|
| 215 |
&& !config.getName().equals( otherConfig.getName() ) |
201 |
&& !config.getName().equals( otherConfig.getName() ) |
| 216 |
&& config.getPort() == otherConfig.getPort(); |
202 |
&& config.getPort() == otherConfig.getPort(); |
| 217 |
} |
203 |
} |
| 218 |
|
|
|
| 219 |
//////////////////////////////////////////// |
| 220 |
// Helping methods for validateOSGiFramework |
| 221 |
|
| 222 |
private String getOSGiFrameworkId() throws CoreException { |
| 223 |
ILaunchConfiguration launchConfig = config.getUnderlyingLaunchConfig(); |
| 224 |
OSGiFrameworkManager manager |
| 225 |
= PDEPlugin.getDefault().getOSGiFrameworkManager(); |
| 226 |
String defaultFrameworkId = manager.getDefaultFramework(); |
| 227 |
String attributeName = IPDELauncherConstants.OSGI_FRAMEWORK_ID; |
| 228 |
return launchConfig.getAttribute( attributeName, defaultFrameworkId ); |
| 229 |
} |
| 230 |
} |
204 |
} |