public boolean hasAttribute(String attributeName) throws CoreException { return KEY.equals(attributeName) || delegate.hasAttribute(attributeName); }
/** * Refresh the enable state of this block using the current launch config * @param enable * @throws CoreException */ public void initialize(boolean enable) throws CoreException { // To support lazy loading of the table we need to set some launch configuration attributes when the combo changes if (fLaunchConfig != null) { fInitDefaultCheckState = enable && !fLaunchConfig.hasAttribute(IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS) && !fLaunchConfig.hasAttribute(IPDELauncherConstants.SELECTED_TARGET_PLUGINS); fTab.updateLaunchConfigurationDialog(); initializeFrom(fLaunchConfig, enable); } }
public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException { return !candidate.getAttribute(IPDEConstants.APPEND_ARGS_EXPLICITLY, false) || candidate.hasAttribute(IPDELauncherConstants.VMINSTALL); }
/** * Returns true if the specified attribute exists in the configuration. * * @param name the name of the attribute * @return true if exists * @throws CoreException on occasion */ protected boolean hasAttribute(String name) throws CoreException { try { configuration.getClass().getMethod("hasAttribute", String.class); //$NON-NLS-1$ return configuration.hasAttribute(name); } catch (SecurityException e) { JettyPlugin.error(Messages.adapter_noHasAttribute, e); } catch (NoSuchMethodException e) { JettyPlugin.warning(Messages.adapter_noDefaultScope, e); } return configuration.getAttributes().containsKey(name); }
@Override public void initializeFrom(ILaunchConfiguration configuration) { try { if (configuration.hasAttribute(ATTR_PID)) { long pid = Long.parseLong(configuration.getAttribute(ATTR_PID, Integer.toString(-1))); if (pid >= Integer.MAX_VALUE) { throw new IllegalArgumentException("too big PID value: " + pid); //$NON-NLS-1$ } // boolean sameProcess = ProcessHandle.of(pid).map(ProcessHandle::info).map(info -> info.commandLine().equals(Optional.ofNullable(configuration.getAttribute(ATTR_COMMAND, "NONSENSE")))); // if (sameProcess) { pidText.setSelection((int) pid); // } else { // String command = configuration.getAttribute(ATTR_COMMAND, ""); // if (command.trim().length() > 0) { // Optional<String> commandOptional = Optional.of(command); // ProcessHandle.allProcesses().filter(handle -> handle.info().commandLine().equals(commandOptional)).findFirst().ifPresent(handle -> pidText.setSelection((int)handle.pid()); // } // } } } catch (NumberFormatException | CoreException e) { AcutePlugin.logError(e); } }
if(orig != null) { try { hasTrueValue = orig.hasAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES) && orig.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true); } catch (CoreException e) {