本文整理汇总了Java中org.eclipse.core.variables.VariablesPlugin.getStringVariableManager方法的典型用法代码示例。如果您正苦于以下问题:Java VariablesPlugin.getStringVariableManager方法的具体用法?Java VariablesPlugin.getStringVariableManager怎么用?Java VariablesPlugin.getStringVariableManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.variables.VariablesPlugin
的用法示例。
在下文中一共展示了VariablesPlugin.getStringVariableManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doCheckState
import org.eclipse.core.variables.VariablesPlugin; //导入方法依赖的package包/类
@Override
public boolean doCheckState() {
VariablesPlugin variablesPlugin = VariablesPlugin.getDefault();
String value = getStringValue();
IStringVariableManager manager = variablesPlugin.getStringVariableManager();
// check if there are substitutions
String result;
try {
result = manager.performStringSubstitution(value, false);
if(!result.equals(getStringValue())) {
// string substitution present ... field editor cannot validate the value.
return true;
}
} catch (CoreException e) {
// replacement failed (but there are replaceable variables present)
return true;
}
if ( new File(value).isAbsolute()) {
return super.doCheckState();
}
return true;
}
示例2: checkState
import org.eclipse.core.variables.VariablesPlugin; //导入方法依赖的package包/类
@Override
public boolean checkState() {
VariablesPlugin variablesPlugin = VariablesPlugin.getDefault();
IStringVariableManager manager = variablesPlugin.getStringVariableManager();
// check if there are substitutions
String result;
try {
result = manager.performStringSubstitution(getStringValue(), false);
if(!result.equals(getStringValue())) {
// string substitution present ... field editor cannot validate the value.
return true;
}
} catch (CoreException e) {
e.printStackTrace();
}
return super.doCheckState();
}
示例3: registerResolvers
import org.eclipse.core.variables.VariablesPlugin; //导入方法依赖的package包/类
/**
* Register all resolvers of this plugin.
*/
private void registerResolvers() {
JavaPlugin javaPlugin = JavaPlugin.getDefault();
Assert.isNotNull(javaPlugin);
addResolver(javaPlugin, new MavenVersionResolver());
addResolver(javaPlugin, new MavenArtifactIdResolver());
VariablesPlugin variablesPlugin = VariablesPlugin.getDefault();
IStringVariableManager stringVariableManager = variablesPlugin.getStringVariableManager();
IValueVariable[] variables = stringVariableManager.getValueVariables();
for (IValueVariable variable : variables) {
addResolver(javaPlugin, new StringValueTemplateVariableResolver(variable));
}
stringVariableManager.addValueVariableListener(new ValueVariableListener());
}
示例4: replacePathVariables
import org.eclipse.core.variables.VariablesPlugin; //导入方法依赖的package包/类
private static String replacePathVariables(String path) {
VariablesPlugin variablesPlugin = VariablesPlugin.getDefault();
IStringVariableManager manager = variablesPlugin.getStringVariableManager();
try {
return manager.performStringSubstitution(path, false);
} catch (CoreException e) {
return path;
}
}
示例5: getStringVariableManager
import org.eclipse.core.variables.VariablesPlugin; //导入方法依赖的package包/类
private IStringVariableManager getStringVariableManager() {
if (SharedCorePlugin.inTestMode()) {
return stringVariableManagerForTests;
}
VariablesPlugin variablesPlugin = VariablesPlugin.getDefault();
return variablesPlugin.getStringVariableManager();
}