本文整理匯總了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");
}