本文整理汇总了Java中com.intellij.ide.macro.MacroManager类的典型用法代码示例。如果您正苦于以下问题:Java MacroManager类的具体用法?Java MacroManager怎么用?Java MacroManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MacroManager类属于com.intellij.ide.macro包,在下文中一共展示了MacroManager类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ToolEditorDialog
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
protected ToolEditorDialog(JComponent parent, String title) {
super(parent, true);
myOutputFiltersButton = new JButton(ToolsBundle.message("tools.filters.button"));
DataContext dataContext = DataManager.getInstance().getDataContext(parent);
myProject = CommonDataKeys.PROJECT.getData(dataContext);
MacroManager.getInstance().cacheMacrosPreview(dataContext);
setTitle(title);
init();
addListeners();
myShowConsoleOnStdOutCheckbox.setVisible(false);
myShowConsoleOnStdErrCheckbox.setVisible(false);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ToolEditorDialog.java
示例2: findTool
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
private static Tool findTool(String actionId, DataContext context) {
MacroManager.getInstance().cacheMacrosPreview(context);
for (Tool tool : getAllTools()) {
if (actionId.equals(tool.getActionId())) {
return tool;
}
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ToolAction.java
示例3: expandMacrosInName
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
public static String expandMacrosInName(Tool tool, DataContext context) {
String name = tool.getName();
try {
return MacroManager.getInstance().expandMacrosInString(name, true, context);
}
catch (Macro.ExecutionCancelledException e) {
LOG.info(e);
return name;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ToolRunProfile.java
示例4: createCommandLine
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@Nullable
public GeneralCommandLine createCommandLine(DataContext dataContext) {
if (StringUtil.isEmpty(getWorkingDirectory())) {
setWorkingDirectory("$ProjectFileDir$");
}
GeneralCommandLine commandLine = new GeneralCommandLine();
try {
String paramString = MacroManager.getInstance().expandMacrosInString(getParameters(), true, dataContext);
String workingDir = MacroManager.getInstance().expandMacrosInString(getWorkingDirectory(), true, dataContext);
String exePath = MacroManager.getInstance().expandMacrosInString(getProgram(), true, dataContext);
commandLine.getParametersList().addParametersString(
MacroManager.getInstance().expandMacrosInString(paramString, false, dataContext));
final String workDirExpanded = MacroManager.getInstance().expandMacrosInString(workingDir, false, dataContext);
if (!StringUtil.isEmpty(workDirExpanded)) {
commandLine.setWorkDirectory(workDirExpanded);
}
exePath = MacroManager.getInstance().expandMacrosInString(exePath, false, dataContext);
if (exePath == null) return null;
File exeFile = new File(exePath);
if (exeFile.isDirectory() && exeFile.getName().endsWith(".app")) {
commandLine.setExePath("open");
commandLine.getParametersList().prependAll("-a", exePath);
}
else {
exePath = PathEnvironmentVariableUtil.toLocatableExePath(exePath);
commandLine.setExePath(exePath);
}
}
catch (Macro.ExecutionCancelledException ignored) {
return null;
}
return commandLine;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:Tool.java
示例5: expandProperty
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
private void expandProperty(DataContext dataContext, BuildFileProperty property) throws Macro.ExecutionCancelledException {
String value = property.getPropertyValue();
final MacroManager macroManager = GlobalAntConfiguration.getMacroManager();
value = macroManager.expandMacrosInString(value, true, dataContext);
value = macroManager.expandMacrosInString(value, false, dataContext);
myExpandedProperties.add("-D" + property.getPropertyName() + "=" + value);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AntCommandLineBuilder.java
示例6: getExternalProperties
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@NotNull
public Map<String, String> getExternalProperties() {
Map<String, String> result = myCachedExternalProperties;
if (result == null) {
synchronized (myOptionsLock) {
result = myCachedExternalProperties;
if (result == null) {
result = new HashMap<String, String>();
final DataContext context = SimpleDataContext.getProjectContext(myProject);
final MacroManager macroManager = MacroManager.getInstance();
Iterator<BuildFileProperty> properties = ANT_PROPERTIES.getIterator(myAllOptions);
while (properties.hasNext()) {
BuildFileProperty property = properties.next();
try {
String value = property.getPropertyValue();
value = macroManager.expandSilentMarcos(value, true, context);
value = macroManager.expandSilentMarcos(value, false, context);
result.put(property.getPropertyName(), value);
}
catch (Macro.ExecutionCancelledException e) {
LOG.debug(e);
}
}
myCachedExternalProperties = result;
}
}
}
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:AntBuildFileImpl.java
示例7: testFilePathRelativeMacro
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
public void testFilePathRelativeMacro() throws Throwable {
doImport("testprojects/tests/java/org/pantsbuild/testproject/testjvms");
String classReference = "org.pantsbuild.testproject.testjvms.TestSix";
PsiClass testClass = JavaPsiFacade.getInstance(myProject).findClass(classReference, GlobalSearchScope.allScope(myProject));
assertNotNull(testClass);
// fileSelected would be testprojects/tests/java/org/pantsbuild/testproject/testjvms/TestSix.java
VirtualFile fileSelected = testClass.getContainingFile().getVirtualFile();
String actual = MacroManager.getInstance()
.expandMacrosInString("https://github.com/pantsbuild/pants/blob/master/$FileRelativePath$", false, getFakeContext(fileSelected));
assertEquals(
"https://github.com/pantsbuild/pants/blob/master/testprojects/tests/java/org/pantsbuild/testproject/testjvms/TestSix.java", actual);
}
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:15,代码来源:FilePathRelativeToBuiltRootMacroTest.java
示例8: ToolEditorDialog
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
protected ToolEditorDialog(JComponent parent, String title) {
super(parent, true);
myOutputFiltersButton = new JButton(ToolsBundle.message("tools.filters.button"));
DataContext dataContext = DataManager.getInstance().getDataContext(parent);
myProject = PlatformDataKeys.PROJECT.getData(dataContext);
MacroManager.getInstance().cacheMacrosPreview(dataContext);
setTitle(title);
init();
addListeners();
myShowConsoleOnStdOutCheckbox.setVisible(false);
myShowConsoleOnStdErrCheckbox.setVisible(false);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ToolEditorDialog.java
示例9: createCommandLine
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@Nullable
public GeneralCommandLine createCommandLine(DataContext dataContext) {
if (StringUtil.isEmpty(getWorkingDirectory())) {
setWorkingDirectory(null);
}
GeneralCommandLine commandLine = new GeneralCommandLine();
try {
String paramString = MacroManager.getInstance().expandMacrosInString(getParameters(), true, dataContext);
String workingDir = MacroManager.getInstance().expandMacrosInString(getWorkingDirectory(), true, dataContext);
String exePath = MacroManager.getInstance().expandMacrosInString(getProgram(), true, dataContext);
commandLine.getParametersList().addParametersString(
MacroManager.getInstance().expandMacrosInString(paramString, false, dataContext));
final String workDirExpanded = MacroManager.getInstance().expandMacrosInString(workingDir, false, dataContext);
if (!StringUtil.isEmpty(workDirExpanded)) {
commandLine.setWorkDirectory(workDirExpanded);
}
exePath = MacroManager.getInstance().expandMacrosInString(exePath, false, dataContext);
if (exePath == null) return null;
File exeFile = new File(exePath);
if (exeFile.isDirectory() && exeFile.getName().endsWith(".app")) {
commandLine.setExePath("open");
commandLine.getParametersList().prependAll("-a", exePath);
}
else {
commandLine.setExePath(exePath);
}
}
catch (Macro.ExecutionCancelledException e) {
return null;
}
return commandLine;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:36,代码来源:Tool.java
示例10: expandProperty
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
private void expandProperty(DataContext dataContext, BuildFileProperty property) throws Macro.ExecutionCancelledException
{
String value = property.getPropertyValue();
final MacroManager macroManager = GlobalAntConfiguration.getMacroManager();
value = macroManager.expandMacrosInString(value, true, dataContext);
value = macroManager.expandMacrosInString(value, false, dataContext);
myExpandedProperties.add("-D" + property.getPropertyName() + "=" + value);
}
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:9,代码来源:AntCommandLineBuilder.java
示例11: getExternalProperties
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@Override
@NotNull
public Map<String, String> getExternalProperties()
{
Map<String, String> result = myCachedExternalProperties;
if(result == null)
{
synchronized(myOptionsLock)
{
result = myCachedExternalProperties;
if(result == null)
{
result = new HashMap<String, String>();
final DataContext context = SimpleDataContext.getProjectContext(myProject);
final MacroManager macroManager = MacroManager.getInstance();
Iterator<BuildFileProperty> properties = ANT_PROPERTIES.getIterator(myAllOptions);
while(properties.hasNext())
{
BuildFileProperty property = properties.next();
try
{
String value = property.getPropertyValue();
value = macroManager.expandSilentMarcos(value, true, context);
value = macroManager.expandSilentMarcos(value, false, context);
result.put(property.getPropertyName(), value);
}
catch(Macro.ExecutionCancelledException e)
{
LOG.debug(e);
}
}
myCachedExternalProperties = result;
}
}
}
return result;
}
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:39,代码来源:AntBuildFileImpl.java
示例12: expand
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@NotNull
public static String expand(@NotNull Module module, @NotNull String path, boolean debugSymbols)
{
String newPath;
try
{
newPath = MacroManager.getInstance().expandSilentMarcos(path, true, createContext(module, debugSymbols));
return FileUtil.toSystemDependentName(newPath);
}
catch(Macro.ExecutionCancelledException e)
{
return path;
}
}
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:15,代码来源:DotNetMacroUtil.java
示例13: getMacroNames
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@Nonnull
public static Set<String> getMacroNames(Element root, @Nullable PathMacroFilter filter, @Nonnull final PathMacros pathMacros) {
final PathMacrosCollectorImpl collector = new PathMacrosCollectorImpl();
collector.substitute(root, true, false, filter);
final HashSet<String> result = new HashSet<String>(collector.myMacroMap.keySet());
result.removeAll(pathMacros.getSystemMacroNames());
result.removeAll(pathMacros.getLegacyMacroNames());
for (Macro macro : MacroManager.getInstance().getMacros()) {
result.remove(macro.getName());
}
result.removeAll(MacroManager.getInstance().getMacros());
result.removeAll(pathMacros.getIgnoredMacroNames());
return result;
}
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:PathMacrosCollectorImpl.java
示例14: ToolEditorDialog
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
protected ToolEditorDialog(JComponent parent, String title) {
super(parent, true);
myOutputFiltersButton = new JButton(ToolsBundle.message("tools.filters.button"));
DataContext dataContext = DataManager.getInstance().getDataContext(parent);
myProject = dataContext.getData(CommonDataKeys.PROJECT);
MacroManager.getInstance().cacheMacrosPreview(dataContext);
setTitle(title);
init();
addListeners();
myShowConsoleOnStdOutCheckbox.setVisible(false);
myShowConsoleOnStdErrCheckbox.setVisible(false);
}
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ToolEditorDialog.java
示例15: createCommandLine
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
@Nullable
public GeneralCommandLine createCommandLine(DataContext dataContext) {
if (StringUtil.isEmpty(getWorkingDirectory())) {
setWorkingDirectory("$PROJECT_DIR$");
}
GeneralCommandLine commandLine = new GeneralCommandLine();
try {
String paramString = MacroManager.getInstance().expandMacrosInString(getParameters(), true, dataContext);
String workingDir = MacroManager.getInstance().expandMacrosInString(getWorkingDirectory(), true, dataContext);
String exePath = MacroManager.getInstance().expandMacrosInString(getProgram(), true, dataContext);
commandLine.getParametersList().addParametersString(
MacroManager.getInstance().expandMacrosInString(paramString, false, dataContext));
final String workDirExpanded = MacroManager.getInstance().expandMacrosInString(workingDir, false, dataContext);
if (!StringUtil.isEmpty(workDirExpanded)) {
commandLine.setWorkDirectory(workDirExpanded);
}
exePath = MacroManager.getInstance().expandMacrosInString(exePath, false, dataContext);
if (exePath == null) return null;
File exeFile = new File(exePath);
if (exeFile.isDirectory() && exeFile.getName().endsWith(".app")) {
commandLine.setExePath("open");
commandLine.getParametersList().prependAll("-a", exePath);
}
else {
commandLine.setExePath(exePath);
}
}
catch (Macro.ExecutionCancelledException e) {
return null;
}
return commandLine;
}
开发者ID:consulo,项目名称:consulo,代码行数:36,代码来源:Tool.java
示例16: getMacroManager
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
public static MacroManager getMacroManager() {
return MacroManager.getInstance();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:GlobalAntConfiguration.java
示例17: getMacroManager
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
public static MacroManager getMacroManager()
{
return MacroManager.getInstance();
}
开发者ID:consulo,项目名称:consulo-apache-ant,代码行数:5,代码来源:GlobalAntConfiguration.java
示例18: MockApplicationEnvironment
import com.intellij.ide.macro.MacroManager; //导入依赖的package包/类
public MockApplicationEnvironment(@Nonnull Disposable parentDisposable) {
super(parentDisposable);
registerApplicationService(PathMacrosService.class, new PathMacrosServiceImpl());
registerApplicationExtensionPoint(Macro.EP_NAME, Macro.class);
registerApplicationExtensionPoint(PathMacroFilter.EP_NAME, PathMacroFilter.class);
registerApplicationComponent(PathMacros.class, new PathMacrosImpl());
registerApplicationService(MacroManager.class, new MacroManager());
registerApplicationService(UISettings.class, new UISettings());
}
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:MockApplicationEnvironment.java
注:本文中的com.intellij.ide.macro.MacroManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论