本文整理汇总了Java中org.eclipse.core.variables.IDynamicVariable类的典型用法代码示例。如果您正苦于以下问题:Java IDynamicVariable类的具体用法?Java IDynamicVariable怎么用?Java IDynamicVariable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDynamicVariable类属于org.eclipse.core.variables包,在下文中一共展示了IDynamicVariable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
@Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
ArchToolchainPairList atlist = new ArchToolchainPairList();
atlist.doLoad();
String toolchainFile = atlist.get(argument);
if(toolchainFile == null) {
Status status = new Status(Status.INFO, Activator.PLUGIN_ID, "No CMake toolchainfile specified for architecture '" + argument +"'");
throw new CoreException(status);
}
IStringVariableManager varMgr = VariablesPlugin.getDefault().getStringVariableManager();
toolchainFile = varMgr.performStringSubstitution(toolchainFile);
return toolchainFile;
}
示例2: createKarafPlatformResources
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
private void createKarafPlatformResources(final IProgressMonitor monitor) throws CoreException {
newKarafProject.getProjectHandle().getFolder(".bin").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/etc").createLink(workingPlatformModel.getParentKarafModel().getConfigurationDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/deploy").createLink(workingPlatformModel.getParentKarafModel().getUserDeployedDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/lib").createLink(workingPlatformModel.getParentKarafModel().getRootDirectory().append("lib"), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/system").createLink(workingPlatformModel.getParentKarafModel().getPluginRootDirectory(), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/runtime").create(true, true, monitor);
// TODO: Is this the right way to add the current installation?
final IDynamicVariable eclipseHomeVariable = VariablesPlugin.getDefault().getStringVariableManager().getDynamicVariable("eclipse_home");
final String eclipseHome = eclipseHomeVariable.getValue("");
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse").create(true, true, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse/dropins").createLink(new Path(eclipseHome).append("dropins"), 0, monitor);
newKarafProject.getProjectHandle().getFolder(".bin/platform/eclipse/plugins").createLink(new Path(eclipseHome).append("plugins"), 0, monitor);
newKarafProject.getProjectHandle().setPersistentProperty(
new QualifiedName(KarafUIPluginActivator.PLUGIN_ID, "karafProject"),
"true");
newKarafProject.getProjectHandle().setPersistentProperty(
new QualifiedName(KarafUIPluginActivator.PLUGIN_ID, "karafModel"),
karafPlatformModel.getRootDirectory().toString());
}
示例3: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
String value = null;
setupDialog(argument);
VerilogPlugin.getStandardDisplay().syncExec(new Runnable() {
public void run() {
prompt();
}
});
if (dialogResultString != null) {
value = dialogResultString;
lastValue = dialogResultString;
} else {
// dialogResultString == null means prompt was cancelled
throw new DebugException(new Status(IStatus.CANCEL, VDT.ID_VDT, IStatus.CANCEL, Txt.s("Variable.Promp.Cancel.Message", new String[] { variable.getName() }), null));
}
return value;
}
示例4: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IResource resource = null;
if (argument == null) {
resource = getSelectedResource(variable);
} else {
resource = getWorkspaceRoot().findMember(new Path(argument));
}
if (resource != null && resource.exists()) {
resource = translateSelectedResource(resource);
if (resource != null && resource.exists()) {
return translateToValue(resource, variable);
}
}
abort(Txt.s("Error.Variable.Verilog.NotExist", new String[]{getReferenceExpression(variable, argument)}), null);
return null;
}
示例5: translateToValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
/**
* Translates the given resource into a value for this variable resolver.
*
* @param resource the resource applicable to this resolver's variable
* @param variable the variable being resolved
* @return variable value
* @throws CoreException if the variable name is not recognized
*/
protected String translateToValue(IResource resource, IDynamicVariable variable) throws CoreException {
String name = variable.getName();
if (name.endsWith("project_loc")) { //$NON-NLS-1$
resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
return resource.getProject().getLocation().toOSString();
} else if (name.endsWith("_loc")) { //$NON-NLS-1$
return resource.getLocation().toOSString();
} else if (name.endsWith("_path")) { //$NON-NLS-1$
return resource.getFullPath().toOSString();
} else if (name.endsWith("_name")) { //$NON-NLS-1$
return resource.getName();
}
abort(Txt.s("Error.Variable.Verilog.Unknown", new String[]{getReferenceExpression(variable, null)}), null); //$NON-NLS-1$
return null;
}
示例6: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
@Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
// String pathName = System.getenv(EngineReference.CUINA_SYSTEM_VARIABLE);
// if (pathName == null) return null;
//
// Path path = Paths.get(pathName);
// if (!path.isAbsolute())
// {
// path = getProjectPath().resolve(path);
// }
// if (Files.notExists(path))
// throwException("File not found " + path.toString(), null);
//
// if (Files.isDirectory(path))
// {
// path = path.resolve(EngineReference.ENGINE_JAR);
// if (Files.notExists(path))
// throwException("File not found " + path.toString(), null);
// }
// return path.toString();
return VALUES.get(variable.getName());
}
示例7: resolveOneVariable
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
private String resolveOneVariable(String key, IStringVariableManager variableManager, boolean dynamicAllowed) {
if (key != null) {
if (variableManager == null) {
variableManager = VariablesPlugin.getDefault().getStringVariableManager();
}
if (variableManager != null) {
// static variable
IValueVariable staticVar = variableManager.getValueVariable(key);
if (staticVar != null) {
return staticVar.getValue();
}
// dynamic variable
else if (dynamicAllowed) {
String varName = key;
String valuePar = null;
// check if parameterized and get parameter
int index = key.indexOf(':');
if (index > 1) {
varName = key.substring(0, index);
if (key.length() > index + 1)
valuePar = key.substring(index + 1);
}
// get dynamic variable
IDynamicVariable dynVar = variableManager.getDynamicVariable(varName);
if (dynVar == null)
return null;
try {
return dynVar.getValue(valuePar);
} catch (CoreException e) {
return null;
}
}
}
}
return null;
}
示例8: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
public String resolveValue(IDynamicVariable variable, String argument)
throws CoreException {
/*
* TODO: Generally, a unique ID would work, but the current logic for
* referencing back to a launch config searches each launch config's
* command-line args for this string. Having it too short (e.g. based off an
* AtomicInteger) causes that to fail. Instead of causing churn on that
* code, we revert back to using nanoTime as the unique ID.
*/
return String.valueOf(System.nanoTime());
}
示例9: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
public String resolveValue(IDynamicVariable variable, String argument)
throws CoreException {
try {
return String.valueOf(RemoteUIServer.getInstance().getPort());
} catch (Throwable e) {
CorePluginLog.logError(e, "Could not get remote UI server's port");
// We can pass an invalid value which will cause GWT's Swing UI to be used
return "-1";
}
}
示例10: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
@Override
public String resolveValue(IDynamicVariable variable, String argument)
throws CoreException {
String variableName = variable.getName();
if (variableName.equals("easyshell")) {
return handleOwnVariable(argument);
} else {
return handleEclipseVariable(variableName, argument);
}
}
示例11: getSelectedResource
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
/**
* Returns the selected resource.
*
* @param variable variable referencing a resource
* @return selected resource
* @throws CoreException if there is no selection
*/
protected IResource getSelectedResource(IDynamicVariable variable) throws CoreException {
// IResource resource = SelectedResourceManager.getDefault().getSelectedVerilogFile();
IResource resource = SelectedResourceManager.getDefault().getChosenVerilogFile();
if (resource == null) {
abort(Txt.s("Error.Variable.Verilog.NoSelection", new String[]{getReferenceExpression(variable, null)}), null);
}
return resource;
}
示例12: getReferenceExpression
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
/**
* Returns an expression used to reference the given variable and optional argument.
* For example, <code>${var_name:arg}</code>.
*
* @param variable referenced variable
* @param argument referenced argument or <code>null</code>
* @return vraiable reference expression
*/
protected String getReferenceExpression(IDynamicVariable variable, String argument) {
StringBuffer reference = new StringBuffer();
reference.append("${");
reference.append(variable.getName());
if (argument != null) {
reference.append(":");
reference.append(argument);
}
reference.append("}");
return reference.toString();
}
示例13: resolveValue
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException
{
try {
return LeJOSEV3Util.getEV3Home().getAbsolutePath();
} catch (LeJOSEV3Exception e) {
throw new CoreException(new Status(IStatus.ERROR, LeJOSEV3Plugin.ID, "could not determine EV3_HOME", e));
}
}
示例14: getDynamicVariable
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
@Override
public IDynamicVariable getDynamicVariable(String name) {
IDynamicVariable variable = dynamicVariables.get(name);
if(variable != null) {
return variable;
}
return super.getDynamicVariable(name);
}
示例15: getDynamicVariables
import org.eclipse.core.variables.IDynamicVariable; //导入依赖的package包/类
@Override
public IDynamicVariable[] getDynamicVariables() {
HashMap2<String, IDynamicVariable> newMap = dynamicVariables.copyToHashMap();
IDynamicVariable[] parentVars = super.getDynamicVariables();
for (IDynamicVariable parentVar : parentVars) {
// Do not put vars that have same name
newMap.putIfAbsent(parentVar.getName(), parentVar);
}
return newMap.getValuesView().toArray(IDynamicVariable.class);
}