本文整理匯總了Java中org.eclipse.debug.core.ILaunchConfigurationWorkingCopy.setAttribute方法的典型用法代碼示例。如果您正苦於以下問題:Java ILaunchConfigurationWorkingCopy.setAttribute方法的具體用法?Java ILaunchConfigurationWorkingCopy.setAttribute怎麽用?Java ILaunchConfigurationWorkingCopy.setAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
的用法示例。
在下文中一共展示了ILaunchConfigurationWorkingCopy.setAttribute方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
/**
* Creates an {@link ILaunchConfiguration} containing the information of this instance, only available when run
* within the Eclipse IDE. If an {@link ILaunchConfiguration} with the same name has been run before, the instance
* from the launch manager is used. This is usually done in the {@code ILaunchShortcut}.
*
* @see #fromLaunchConfiguration(ILaunchConfiguration)
*/
public ILaunchConfiguration toLaunchConfiguration() throws CoreException {
ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
.getLaunchConfigurations(configurationType);
boolean configurationHasChanged = false;
for (ILaunchConfiguration config : configs) {
if (configName.equals(config.getName())) {
configurationHasChanged = hasConfigurationChanged(config);
if (!configurationHasChanged) {
return config;
}
}
}
IContainer container = null;
ILaunchConfigurationWorkingCopy workingCopy = configurationType.newInstance(container, configName);
workingCopy.setAttribute(XT_FILE_TO_RUN, xtFileToRun);
workingCopy.setAttribute(WORKING_DIRECTORY, workingDirectory.getAbsolutePath());
return workingCopy.doSave();
}
示例2: renameLaunch
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
private void renameLaunch(final Spec newSpec, String newModelName) {
try {
// create the model with the new name
final ILaunchConfigurationWorkingCopy copy = this.launchConfig
.copy(newSpec.getName() + SPEC_MODEL_DELIM + newModelName);
copy.setAttribute(SPEC_NAME, newSpec.getName());
copy.setAttribute(ModelHelper.MODEL_NAME, newModelName);
copy.setContainer(newSpec.getProject());
final ILaunchConfiguration renamed = copy.doSave();
// delete the old model
this.launchConfig.delete();
this.launchConfig = renamed;
} catch (CoreException e) {
TLCActivator.logError("Error renaming model.", e);
}
}
示例3: getRemoteDebugConfig
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
private ILaunchConfigurationWorkingCopy getRemoteDebugConfig(IProject activeProj) throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_REMOTE_JAVA_APPLICATION);
ILaunchConfigurationWorkingCopy config = type.newInstance(null, "Debug "+activeProj.getName());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, activeProj.getName());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_ALLOW_TERMINATE, true);
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_CONNECTOR, IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
IVMConnector connector = JavaRuntime.getVMConnector(IJavaLaunchConfigurationConstants.ID_SOCKET_ATTACH_VM_CONNECTOR);
Map<String, Argument> def = connector.getDefaultArguments();
Map<String, String> argMap = new HashMap<String, String>(def.size());
argMap.put("hostname", getHostname(activeProj));
argMap.put("port", "8348");
WPILibJavaPlugin.logInfo(argMap.toString());
config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CONNECT_MAP, argMap);
return config;
}
示例4: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String program = eiffelProgramText.getText().trim();
if (program.length() == 0)
program = null;
configuration.setAttribute(Constants.ATTR_LE_PROGRAM, program);
String seFullPath = this.seFullPathText.getText().trim();
configuration.setAttribute(Constants.ATTR_LEC_FULL_PATH, seFullPath);
//perform resource mapping for contextual launch
IResource[] resources = null;
if (program != null) {
IPath path = new Path(program);
IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path);
if (res != null) {
resources = new IResource[]{res};
}
}
configuration.setMappedResources(resources);
}
示例5: testProjectWithLibrary
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Test
public void testProjectWithLibrary() throws Exception {
IPackageFragmentRoot rootBin1 = javaProject1.createJAR(
"testdata/bin/signatureresolver.jar", "/sample.jar", new Path(
"/UnitTestProject/sample.jar"), null);
JavaProjectKit.waitForBuild();
ILaunchConfigurationWorkingCopy configuration = getJavaApplicationType()
.newInstance(javaProject1.project, "test.launch");
configuration.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, "project1");
final Collection<IPackageFragmentRoot> scope = launcher
.getOverallScope(configuration);
assertEquals(set(rootBin1), set(scope));
}
示例6: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
super.performApply(configuration);
String command = commandsCommbo.getText().trim();
if (command.length() == 0) {
configuration.setAttribute(AngularCLILaunchConstants.OPERATION, (String) null);
} else {
configuration.setAttribute(AngularCLILaunchConstants.OPERATION, command);
}
String arguments = this.argumentsField.getText().trim();
if (arguments.length() == 0) {
configuration.setAttribute(AngularCLILaunchConstants.OPERATION_PARAMETERS, (String) null);
} else {
configuration.setAttribute(AngularCLILaunchConstants.OPERATION_PARAMETERS, arguments);
}
}
示例7: createMavenPackagingLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@VisibleForTesting
static ILaunchConfiguration createMavenPackagingLaunchConfiguration(IProject project)
throws CoreException {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType launchConfigurationType = launchManager
.getLaunchConfigurationType(MavenLaunchConstants.LAUNCH_CONFIGURATION_TYPE_ID);
String launchConfigName = "CT4E App Engine flexible Maven deploy artifact packaging "
+ project.getLocation().toString().replaceAll("[^a-zA-Z0-9]", "_");
ILaunchConfigurationWorkingCopy workingCopy = launchConfigurationType.newInstance(
null /*container*/, launchConfigName);
workingCopy.setAttribute(ILaunchManager.ATTR_PRIVATE, true);
// IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND;
workingCopy.setAttribute("org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND", true);
workingCopy.setAttribute(MavenLaunchConstants.ATTR_POM_DIR, project.getLocation().toString());
workingCopy.setAttribute(MavenLaunchConstants.ATTR_GOALS, "package");
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, "${project}");
workingCopy.setAttribute(RefreshUtil.ATTR_REFRESH_RECURSIVE, true);
IPath jreContainerPath = getJreContainerPath(project);
workingCopy.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreContainerPath.toString());
return workingCopy;
}
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:27,代碼來源:FlexMavenPackagedProjectStagingDelegate.java
示例8: setDefaults
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
IPreferenceStore store = PreferenceConstants.getPreferenceStore(null);
configuration.setAttribute(GENERATE_JAVA_INTERFACE, store.getBoolean(GENERATE_JAVA_INTERFACE));
configuration.setAttribute(GENERATE_JAVA_NONBLOCKING, store.getBoolean(GENERATE_JAVA_NONBLOCKING));
configuration.setAttribute(GENERATION_JAVA_INTERFACE_TARGET, store.getString(GENERATION_JAVA_INTERFACE_TARGET));
configuration.setAttribute(GENERATION_JAVA_INTERFACE_PACKAGE_PREFIX,
store.getString(GENERATION_JAVA_INTERFACE_PACKAGE_PREFIX));
configuration.setAttribute(GENERATE_JAVA_TESTS, store.getBoolean(GENERATE_JAVA_TESTS));
configuration.setAttribute(GENERATION_JAVA_TEST_TARGET, store.getString(GENERATION_JAVA_TEST_TARGET));
String types = store.getString(GENERATION_JAVA_2_SOLIDITY_TYPES);
if (types != null) {
String[] split = types.split(",");
for (int i = 0; i < split.length; i++) {
String t = split[i];
configuration.setAttribute(GENERATION_JAVA_2_SOLIDITY_TYPE_PREFIX + t,
store.getString(GENERATION_JAVA_2_SOLIDITY_TYPE_PREFIX + t));
}
}
}
示例9: toLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
/**
* Stores the Dataflow Pipeline-specific options of this LaunchConfiguration inside the provided
* {@link ILaunchConfigurationWorkingCopy}.
*/
public void toLaunchConfiguration(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
PipelineConfigurationAttr.RUNNER_ARGUMENT.toString(), runner.getRunnerName());
configuration.setAttribute(
PipelineConfigurationAttr.USE_DEFAULT_LAUNCH_OPTIONS.toString(), useDefaultLaunchOptions);
configuration.setAttribute(
PipelineConfigurationAttr.ALL_ARGUMENT_VALUES.toString(), argumentValues);
configuration.setAttribute(
PipelineConfigurationAttr.USER_OPTIONS_NAME.toString(), userOptionsName.orNull());
try {
setEclipseProjectName(configuration);
} catch (CoreException e) {
DataflowCorePlugin.logWarning("CoreException while trying to retrieve"
+ " project name from Configuration Working Copy");
}
}
示例10: setModels
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
private void setModels(ILaunchConfigurationWorkingCopy config) throws CoreException {
StringBuffer sb = new StringBuffer();
// Main
if (fModelText.getText() == null || fModelText.getText().trim().length() == 0) {
sb.append("").append(";");
} else {
sb.append((fModelText.getText().trim())).append(";");
}
sb.append("1").append(";");
IStructuredSelection selection = (IStructuredSelection) comboViewer.getSelection();
if (selection == null || selection.getFirstElement() == null) {
sb.append("?").append(";");
} else {
sb.append(((BuildPolicy) selection.getFirstElement()).getPathGenerator()).append(";");
}
// Others
ModelData[] others = mpg.getModel();
for (int i = 0; i < others.length; i++) {
sb.append(others[i].getFullPath()).append(";");
if (others[i].isSelected()) {
sb.append("1").append(";");
} else {
sb.append("0").append(";");
}
sb.append(others[i].getSelectedPolicy()).append(";");
}
config.setAttribute(CONFIG_GRAPH_MODEL_PATHS, sb.toString());
}
示例11: setDefaults
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
// FIXME IDE-1393 move to subclass?
configuration.setAttribute(RunConfiguration.RUNNER_ID, RunnerUiUtils.getRunnerId(configuration, true));
configuration.setAttribute(RunConfiguration.IMPLEMENTATION_ID, (String) null);
}
示例12: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
/**
* From the UI widgets to the configuration.
*
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
final String wsRelativePath = txtResource.getText();
final URI uri = wsRelativePath.trim().length() > 0 ? URI.createPlatformResourceURI(wsRelativePath, true) : null;
final String uriStr = uri != null ? uri.toString() : null;
configuration.setAttribute(getResourceRunConfigKey(), uriStr);
final String implementationId = txtImplementationId.getText();
final String actualImplId = implementationId.trim().length() > 0 ? implementationId.trim() : null;
configuration.setAttribute(RunConfiguration.IMPLEMENTATION_ID, actualImplId);
}
示例13: setDefaults
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(RunConfiguration.LAUNCH_DELAY, 1000);
configuration.setAttribute(RunConfiguration.LAUNCH_MODEL_ENTRY_POINT, "");
configuration.setAttribute(RunConfiguration.LAUNCH_METHOD_ENTRY_POINT, "");
configuration.setAttribute(RunConfiguration.LAUNCH_SELECTED_LANGUAGE, "");
}
示例14: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(
AbstractDSLLaunchConfigurationDelegate.RESOURCE_URI,
this._modelLocationText.getText());
configuration.setAttribute(
AbstractDSLLaunchConfigurationDelegateSiriusUI.SIRIUS_RESOURCE_URI,
this._siriusRepresentationLocationText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_DELAY,
Integer.parseInt(_delayText.getText()));
configuration.setAttribute(RunConfiguration.LAUNCH_SELECTED_LANGUAGE,
_languageCombo.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_MELANGE_QUERY,
_melangeQueryText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_MODEL_ENTRY_POINT,
_entryPointModelElementText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_METHOD_ENTRY_POINT,
_entryPointMethodText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_INITIALIZATION_METHOD,
_modelInitializationMethodText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_INITIALIZATION_ARGUMENTS,
_modelInitializationArgumentsText.getText());
configuration.setAttribute(RunConfiguration.LAUNCH_BREAK_START,
_animationFirstBreak.getSelection());
// DebugModelID for sequential engine
configuration.setAttribute(RunConfiguration.DEBUG_MODEL_ID, Activator.DEBUG_MODEL_ID);
}
示例15: launch
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //導入方法依賴的package包/類
private void launch(IResource file, int line, IType type, String agentArgs, IMethod mainMethod)
throws CoreException {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType confType = manager.getLaunchConfigurationType(IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION);
ILaunchConfigurationWorkingCopy wc = confType.newInstance(null, file.getName() + " (PandionJ)");
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, file.getProject().getName());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, type.getFullyQualifiedName());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_STOP_IN_MAIN, false);
// if(breakPoint != null)
// breakPoint.delete();
// if(line != -1)
// breakPoint = JDIDebugModel.createLineBreakpoint(file, firstType.getFullyQualifiedName(), line, -1, -1, 0, true, null);
try {
Bundle bundle = Platform.getBundle(LaunchCommand.class.getPackage().getName());
URL find = FileLocator.find(bundle, new Path("lib/agent.jar"), null);
URL resolve = FileLocator.resolve(find);
if(!mainMethod.exists()) {
String path = resolve.getPath();
if(Platform.getOS().compareTo(Platform.OS_WIN32) == 0)
path = path.substring(1);
String args = "-javaagent:\"" + path + "=" + agentArgs + "\" -Djava.awt.headless=true";
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, args);
}
} catch (IOException e1) {
e1.printStackTrace();
}
ILaunchConfiguration config = wc.doSave();
Activator.launch(config);
}