本文整理汇总了Java中org.eclipse.debug.core.ILaunchConfigurationWorkingCopy.getAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunchConfigurationWorkingCopy.getAttribute方法的具体用法?Java ILaunchConfigurationWorkingCopy.getAttribute怎么用?Java ILaunchConfigurationWorkingCopy.getAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
的用法示例。
在下文中一共展示了ILaunchConfigurationWorkingCopy.getAttribute方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDefaults
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
/**
* Initializes the given launch configuration with
* default values for this tab. This method
* is called when a new launch configuration is created
* such that the configuration can be initialized with
* meaningful values. This method may be called before this
* tab's control is created.
*
* If the configuration parameter contains an attribute named
* 'viewerCurrent', the tab is initialized with the default values
* for the given viewer. The given viewer is expected to exist.
*
* @param configuration launch configuration
*/
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
try {
String viewer = configuration.getAttribute("viewerCurrent", registry.getActiveViewer());
registry.setActiveViewer(viewer);
configuration.setAttribute(ViewerAttributeRegistry.VIEWER_CURRENT, viewer);
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_COMMAND, registry.getCommand());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_ARGUMENTS, registry.getArguments());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_VIEW_COMMAND, registry.getDDEViewCommand());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_VIEW_SERVER, registry.getDDEViewServer());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_VIEW_TOPIC, registry.getDDEViewTopic());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_CLOSE_COMMAND, registry.getDDECloseCommand());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_CLOSE_SERVER, registry.getDDECloseServer());
configuration.setAttribute(viewer + ViewerAttributeRegistry.ATTRIBUTE_DDE_CLOSE_TOPIC, registry.getDDECloseTopic());
} catch (CoreException e) {
TexlipsePlugin.log("Initializing launch configuration", e);
}
}
示例2: performApply
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
try {
{// check if a new table must be created
String newProject = configuration.getAttribute(CAL_PROJECT.longName(), "");
String newXdf = configuration.getAttribute(CAL_XDF.longName(), "");
String newConfig = configStamp(newProject, newXdf);
config = configuration.getAttribute(LOADED_CONFIGURATION, "");
if (!newConfig.equals(config)) {
config = newConfig;
configuration.setAttribute(LOADED_CONFIGURATION, config);
loadConnections(newProject, newXdf);
loadXdfMapping();
viewer.setInput(connections);
}
}
configuration.setAttribute(getId(), getValue());
} catch (CoreException e) {
e.printStackTrace();
}
}
示例3: createLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
@Override
protected final ILaunchConfiguration[] createLaunchConfiguration(IResource file, EObject firstInstruction, String mode)
throws CoreException {
ILaunchConfiguration[] launchConfigs = super.createLaunchConfiguration(file, firstInstruction, mode);
if (launchConfigs.length == 1) {
// open configuration for further editing
if (launchConfigs[0] instanceof ILaunchConfigurationWorkingCopy) {
ILaunchConfigurationWorkingCopy configuration = (ILaunchConfigurationWorkingCopy) launchConfigs[0];
String selectedLanguage = configuration.getAttribute(RunConfiguration.LAUNCH_SELECTED_LANGUAGE, "");
if (selectedLanguage.equals("")) {
// TODO try to infer possible language and other attribute
// from project content and environment
setDefaultsLaunchConfiguration(configuration);
final ILaunchGroup group = DebugUITools.getLaunchGroup(configuration, mode);
if (group != null) {
ILaunchConfiguration savedLaunchConfig = configuration.doSave();
// open configuration for user validation and inputs
DebugUITools.openLaunchConfigurationDialogOnGroup(PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getShell(), new StructuredSelection(savedLaunchConfig),
group.getIdentifier(), null);
// DebugUITools.openLaunchConfigurationDialog(PlatformUI.getWorkbench()
// .getActiveWorkbenchWindow().getShell(),
// savedLaunchConfig, group.getIdentifier(), null);
}
}
}
}
return launchConfigs;
}
示例4: extractAndInstallAgent
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
private File extractAndInstallAgent(ILaunchConfigurationWorkingCopy configCopy) throws CoreException {
File agentJar;
try {
agentJar = extractAgent();
String vmArgs = configCopy.getAttribute("org.eclipse.jdt.launching.VM_ARGUMENTS", "");
vmArgs = vmArgs + " -javaagent:" + agentJar.getAbsolutePath();
configCopy.setAttribute("org.eclipse.jdt.launching.VM_ARGUMENTS", vmArgs);
} catch (IOException e) {
throw new RuntimeException("Couldn't install visuflow agent", e);
}
return agentJar;
}
示例5: launch
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
public static void launch(NgCommand ngCommand, IProject project, String mode) throws CoreException {
String workingDir = AngularCLILaunchHelper.getWorkingDir(project);
String operation = ngCommand.name().toLowerCase();
// Check if configuration already exists
ILaunchConfiguration ngConfiguration = chooseLaunchConfiguration(workingDir, operation);
if (ngConfiguration != null) {
ILaunchConfigurationWorkingCopy wc = ngConfiguration.getWorkingCopy();
// Update nodejs file path if needed
if (wc.getAttribute(AngularCLILaunchConstants.NODE_FILE_PATH, (String) null) == null) {
updateNodeFilePath(project, wc);
}
// Update ng file path
if (wc.getAttribute(AngularCLILaunchConstants.NG_FILE_PATH, (String) null) == null) {
updateNgFilePath(project, wc);
}
ngConfiguration = wc.doSave();
DebugUITools.launch(ngConfiguration, mode);
} else {
// Creating Launch Configuration from scratch
ILaunchConfigurationWorkingCopy newConfiguration = createEmptyLaunchConfiguration(project.getName(),
operation);
// nodejs file to use
updateNodeFilePath(project, newConfiguration);
// ng file to use
updateNgFilePath(project, newConfiguration);
newConfiguration.setAttribute(AngularCLILaunchConstants.WORKING_DIR, workingDir);
newConfiguration.setAttribute(AngularCLILaunchConstants.OPERATION, operation);
// newConfiguration.setAttribute(AngularCLILaunchConstants.OPERATION_PARAMETERS,
// "--live-reload-port 65535");
newConfiguration.doSave();
DebugUITools.launch(newConfiguration, mode);
}
}
示例6: setupLaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; //导入方法依赖的package包/类
@Override
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor)
throws CoreException {
IServer server = ServerUtil.getServer(workingCopy);
if (server == null) {
return;
}
String projectName = workingCopy.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
if (projectName == null) {
projectName = server.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
}
IJavaProject proj = JavaRuntime.getJavaProject(workingCopy);
Collection<String> mainClasses = MainClassDetector.findMainClasses(proj, monitor);
if (mainClasses.isEmpty()) {
return;
}
if ( mainClasses.size() > 1) {
//TODO handle multiple Main classes
}
String mainClass = mainClasses.iterator().next();
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, mainClass);
StringBuilder vmArgs = new StringBuilder(DEVAULT_VM_ARGS);
int targetPort = 8080;
int portOffset = SocketUtil.detectPortOffset(targetPort);
if (portOffset > 0) {
targetPort += portOffset;
vmArgs.append(" -Dswarm.port.offset=").append(portOffset);
}
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, vmArgs.toString());
final ControllableServerBehavior behavior = (ControllableServerBehavior)JBossServerBehaviorUtils.getControllableBehavior(server);
//TODO parse Main class AST to detect default context root?
if (behavior != null) {
//XXX seems weird/wrong
behavior.putSharedData("welcomePage", "http://localhost:"+targetPort+"/");
}
//if m2e project only
workingCopy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_CLASSPATH_PROVIDER, "org.jboss.tools.servers.wildfly.swarm.launchconfig.classpathProvider");
}