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


Java CopyProvider.performCopy方法代码示例

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


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

示例1: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
  if (provider == null) {
    return;
  }
  provider.performCopy(dataContext);
  Transferable contents = CopyPasteManager.getInstance().getContents();
  String string;
  try {
    string = contents == null? null : (String)contents.getTransferData(DataFlavor.stringFlavor);
  }
  catch (Exception ex) {
    return;
  }
  if (StringUtil.isNotEmpty(string)) {
    BrowserUtil.launchBrowser("http://www.google.com/search?q="+ URLEncoder.encode(string));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:SearchWebAction.java

示例2: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  CopyProvider provider = e.getData(PlatformDataKeys.COPY_PROVIDER);
  if (provider == null) {
    return;
  }
  provider.performCopy(dataContext);
  Transferable contents = CopyPasteManager.getInstance().getContents();
  String string;
  try {
    string = contents == null? null : (String)contents.getTransferData(DataFlavor.stringFlavor);
  }
  catch (Exception ex) {
    return;
  }
  if (StringUtil.isNotEmpty(string)) {
    BrowserUtil.browse("http://www.google.com/search?q="+ URLEncoder.encode(string));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:SearchWebAction.java

示例3: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent var1) {
    DataContext var2 = var1.getDataContext();
    CopyProvider var3 = (CopyProvider) PlatformDataKeys.COPY_PROVIDER.getData(var2);
    if (var3 != null) {
        var3.performCopy(var2);
        String var4 = (String) CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor);
        if (StringUtil.isNotEmpty(var4)) {
            BrowserUtil.browse("https://translate.google.com/#en/zh-CN/" + URLEncoder.encode(var4));
        }
    }
}
 
开发者ID:kookob,项目名称:mybatis-log-plugin,代码行数:12,代码来源:GoogleTranslateAction.java

示例4: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent var1) {
    DataContext var2 = var1.getDataContext();
    CopyProvider var3 = (CopyProvider) PlatformDataKeys.COPY_PROVIDER.getData(var2);
    if (var3 != null) {
        var3.performCopy(var2);
        String var4 = (String) CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor);
        if (StringUtil.isNotEmpty(var4)) {
            BrowserUtil.browse("https://www.baidu.com/s?wd=" + URLEncoder.encode(var4));
        }
    }
}
 
开发者ID:kookob,项目名称:mybatis-log-plugin,代码行数:12,代码来源:BaiduSearchAction.java

示例5: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
  if (provider == null) {
    return;
  }
  provider.performCopy(dataContext);
  String string = CopyPasteManager.getInstance().getContents(DataFlavor.stringFlavor);
  if (StringUtil.isNotEmpty(string)) {
    BrowserUtil.browse("http://www.google.com/search?q=" + URLEncoder.encode(string));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:SearchWebAction.java

示例6: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
  if (provider == null) {
    return;
  }
  provider.performCopy(dataContext);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:CopyAction.java

示例7: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    DataContext ctx = anActionEvent.getDataContext();

    Route[] routes = (Route[])PlatformDataKeys.SELECTED_ITEMS.getData(ctx);

    CopyProvider provider = new RoutesCopyProvider(routes) {
        @Override
        public String getCopyValue(Route route) {
            return getRouteValue(route);
        }
    };

    provider.performCopy(ctx);
}
 
开发者ID:basgren,项目名称:railways,代码行数:16,代码来源:CopyRouteActionBase.java

示例8: actionPerformed

import com.intellij.ide.CopyProvider; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  CopyProvider provider = e.getData(PlatformDataKeys.COPY_PROVIDER);
  if (provider == null) {
    return;
  }
  provider.performCopy(dataContext);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:CopyAction.java


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