当前位置: 首页>>代码示例>>Java>>正文


Java IStringVariableManager.performStringSubstitution方法代码示例

本文整理汇总了Java中org.eclipse.core.variables.IStringVariableManager.performStringSubstitution方法的典型用法代码示例。如果您正苦于以下问题:Java IStringVariableManager.performStringSubstitution方法的具体用法?Java IStringVariableManager.performStringSubstitution怎么用?Java IStringVariableManager.performStringSubstitution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.core.variables.IStringVariableManager的用法示例。


在下文中一共展示了IStringVariableManager.performStringSubstitution方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateAbsoluteFilePath

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
/**
 * Validates that the file with the specified absolute path exists and can be opened.
 *
 * @param path The path of the file to validate
 * @return a status without error if the path is valid
 */
protected static IStatus validateAbsoluteFilePath(String path) {
	final StatusInfo status = new StatusInfo();
	IStringVariableManager variableManager = VariablesPlugin.getDefault().getStringVariableManager();
	try {
		path = variableManager.performStringSubstitution(path);
		if (path.length() > 0) {

			final File file = new File(path);
			if (!file.exists() && (!file.isAbsolute() || !file.getParentFile().canWrite()))
				status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
			else if (file.exists() && (!file.isFile() || !file.isAbsolute() || !file.canRead() || !file.canWrite()))
				status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
		}
	} catch (CoreException e) {
		status.setError(e.getLocalizedMessage());
	}
	return status;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:25,代码来源:MkSpellingConfigurationBlock.java

示例2: getIFile

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
private IFile getIFile(ILaunchConfigurationWorkingCopy configuration) {
	IFile file = null;
	if (fNewFile != null) {
		file = fNewFile;
		fNewFile = null;
	} else {
		IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
		try {
			String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null);
			if (location != null) {
				String expandedLocation = manager.performStringSubstitution(location);
				if (expandedLocation != null) {
					file = JSBuildFileUtil.getFileForLocation(expandedLocation);
				}
			}
		}
		catch (CoreException e) {
			// do nothing
		}
	}
	return file;
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:23,代码来源:JSBUildFileMainTab.java

示例3: getCommand

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
@Override
public String getCommand() {
    // anb0s: support of variables
    IStringVariableManager variableManager = VariablesPlugin.getDefault().getStringVariableManager();
    String resolved_location = null;
    try {
        resolved_location = variableManager.performStringSubstitution(this.location);
    } catch (CoreException e) {
        e.printStackTrace();
    }
    // Retrieves the real location where doxygen may be.
    File realLocation = new File(resolved_location);
    // Builds the path.
    if (realLocation.isFile() == true) {
        return realLocation.getPath();
    } else {
        return realLocation.getPath() + File.separator + COMMAND_NAME;
    }
}
 
开发者ID:anb0s,项目名称:eclox,代码行数:20,代码来源:CustomDoxygen.java

示例4: getCommandResolved

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
private String[] getCommandResolved(IStringVariableManager variableManager) throws CoreException {
	String[] commandArray = null;
	switch(commandTokenizer) {
 	case commandTokenizerSpaces:
 		commandArray = Utils.splitSpaces(commandValue);
 	break;
 	case commandTokenizerSpacesAndQuotes:
 		commandArray = Utils.splitSpacesAndQuotes(commandValue, false);
 	break;
 	case commandTokenizerSpacesAndQuotesSkip:
 		commandArray = Utils.splitSpacesAndQuotes(commandValue, true);
 	break;
 	case commandTokenizerDisabled:
 		commandArray = new String[1];
 		commandArray[0] = commandValue;
     break;
 	default:
 		throw new IllegalArgumentException();
	}
    // resolve the variables
    for (int i=0;i<commandArray.length;i++) {
    	commandArray[i] = variableManager.performStringSubstitution(commandArray[i], false);
        Activator.logDebug("exc" + i + ":>" + commandArray[i]+ "<");
    }    	
    return commandArray;
}
 
开发者ID:anb0s,项目名称:EasyShell,代码行数:27,代码来源:ActionDelegate.java

示例5: doCheckState

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的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;
}
 
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:26,代码来源:WorkbenchPreferencePage.java

示例6: checkState

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的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();
}
 
开发者ID:USESystemEngineeringBV,项目名称:cmake-eclipse-helper,代码行数:19,代码来源:WorkbenchPreferencePage.java

示例7: validateAbsoluteFilePath

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
/**
 * Validates that the file with the specified absolute path exists and can
 * be opened.
 *
 * @param path
 *                   The path of the file to validate
 * @return a status without error if the path is valid
 */
protected static IStatus validateAbsoluteFilePath(String path) {

	final StatusInfo status= new StatusInfo();
	IStringVariableManager variableManager= VariablesPlugin.getDefault().getStringVariableManager();
	try {
		path= variableManager.performStringSubstitution(path);
		if (path.length() > 0) {

			final File file= new File(path);
			if (!file.exists() && (!file.isAbsolute() || !file.getParentFile().canWrite()))
				status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
			else if (file.exists() && (!file.isFile() || !file.isAbsolute() || !file.canRead() || !file.canWrite()))
				status.setError(PreferencesMessages.SpellingPreferencePage_dictionary_error);
		}
	} catch (CoreException e) {
		status.setError(e.getLocalizedMessage());
	}
	return status;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:SpellingConfigurationBlock.java

示例8: resolveValue

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的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;
}
 
开发者ID:rungemar,项目名称:cmake4cdt,代码行数:17,代码来源:ToolchainFileResolver.java

示例9: setDefaultMessage

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
private void setDefaultMessage( String odaDesignerID )
{
	String msgExpr = Messages.getMessage( "datasource.page.title" );
	// "Define ${odadesignerid.ds.displayname} Data Source";
	String dsMsgExpr = msgExpr.replace( "odadesignerid", odaDesignerID ); //$NON-NLS-1$

	IStringVariableManager varMgr = org.eclipse.core.variables.VariablesPlugin.getDefault( )
			.getStringVariableManager( );
	try
	{
		DEFAULT_MESSAGE = varMgr.performStringSubstitution( dsMsgExpr, false );
	}
	catch ( CoreException ex )
	{
		// TODO Auto-generated catch block
	}

}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:HiveSelectionPageHelper.java

示例10: getTemplatePreference

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
/**
 * Return default template preference
 * 
 * @return String The string of default template preference
 */
public String getTemplatePreference( )
{
	String temp = PreferenceFactory.getInstance( )
			.getPreferences( this, UIUtil.getCurrentProject( ) )
			.getString( TEMPLATE_PREFERENCE );
	String str = temp;
	try
	{
		IStringVariableManager mgr = VariablesPlugin.getDefault( )
				.getStringVariableManager( );
		str = mgr.performStringSubstitution( temp );
	}
	catch ( CoreException e )
	{
		str = temp;
	}

	return str;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:25,代码来源:ReportPlugin.java

示例11: fillMapWithEnv

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
public static void fillMapWithEnv(String[] env, Map<String, String> hashMap,
        Set<String> keysThatShouldNotBeUpdated, IStringVariableManager manager) {
    if (env == null || env.length == 0) {
        // nothing to do
        return;
    }

    if (keysThatShouldNotBeUpdated == null) {
        keysThatShouldNotBeUpdated = Collections.emptySet();
    }

    for (String s : env) {
        Tuple<String, String> sp = StringUtils.splitOnFirst(s, '=');
        if (sp.o1.length() != 0 && sp.o2.length() != 0 && !keysThatShouldNotBeUpdated.contains(sp.o1)) {
            String value = sp.o2;
            if (manager != null) {
                try {
                    value = manager.performStringSubstitution(value, false);
                } catch (CoreException e) {
                    // Unreachable as false passed to reportUndefinedVariables above
                }
            }
            hashMap.put(sp.o1, value);
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:27,代码来源:InterpreterInfo.java

示例12: getInitialCommands

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
/**
 * @return the initial commands set in the preferences
 */
@Override
public String getInitialCommands() {
    String str = PydevDebugPlugin.getDefault().getPreferenceStore()
            .getString(PydevConsoleConstants.INITIAL_INTERPRETER_CMDS);
    try {
        // Expand any eclipse variables in the GUI
        IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
        str = manager.performStringSubstitution(str, false);
    } catch (CoreException e) {
        // Unreachable as false passed to reportUndefinedVariables above
        Log.log(e);
    }
    if (!str.endsWith("\n")) {
        str += "\n";
    }

    if (additionalInitialComands != null) {
        str += additionalInitialComands;
    }
    return str;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:25,代码来源:PydevConsole.java

示例13: getIFile

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
private IFile getIFile(ILaunchConfigurationWorkingCopy configuration) {
	IFile file = null;
	if (fNewFile != null) {
		file = fNewFile;
		fNewFile = null;
	} else {
		IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
		try {
			String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null);
			if (location != null) {
				String expandedLocation = manager.performStringSubstitution(location);
				if (expandedLocation != null) {
					file = NodejsCliFileHelper.getFileForLocation(expandedLocation);
				}
			}
		} catch (CoreException e) {
			// do nothing
		}
	}
	return file;
}
 
开发者ID:angelozerr,项目名称:angularjs-eclipse,代码行数:22,代码来源:MainTab.java

示例14: extractVariables

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
private void extractVariables(Map<String, String> map) throws CoreException {
	IStringVariableManager svManager = VariablesPlugin.getDefault().getStringVariableManager();
	for (String key : map.keySet()) {
		String value = map.get(key);
		String newValue = svManager.performStringSubstitution(value);
		map.put(key, newValue);
	}
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:9,代码来源:LaunchGradleCommandHandler.java

示例15: apply

import org.eclipse.core.variables.IStringVariableManager; //导入方法依赖的package包/类
public String apply(String input) {
  try {
    IStringVariableManager stringManager =
        VariablesPlugin.getDefault().getStringVariableManager();
    return stringManager.performStringSubstitution(input);
  } catch (CoreException e) {
    return "";
  }
}
 
开发者ID:alfsch,项目名称:workspacemechanic,代码行数:10,代码来源:VariableManagerStringParser.java


注:本文中的org.eclipse.core.variables.IStringVariableManager.performStringSubstitution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。