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


Java CopyProvider类代码示例

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


CopyProvider类属于com.intellij.ide包,在下文中一共展示了CopyProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: update

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
public void update(AnActionEvent var1) {
    Presentation var2 = var1.getPresentation();
    DataContext var3 = var1.getDataContext();
    CopyProvider var4 = (CopyProvider) PlatformDataKeys.COPY_PROVIDER.getData(var3);
    boolean var5 = var4 != null && var4.isCopyEnabled(var3) && var4.isCopyVisible(var3);
    var2.setEnabled(var5);
    var2.setVisible(var5);
}
 
开发者ID:kookob,项目名称:mybatis-log-plugin,代码行数:9,代码来源:GoogleTranslateAction.java

示例5: 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

示例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);
  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

示例7: update

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  DataContext dataContext = event.getDataContext();
  CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
  boolean available = provider != null && provider.isCopyEnabled(dataContext) && provider.isCopyVisible(dataContext);
  presentation.setEnabled(available);
  presentation.setVisible(available);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:SearchWebAction.java

示例8: 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

示例9: update

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  DataContext dataContext = event.getDataContext();
  CopyProvider provider = PlatformDataKeys.COPY_PROVIDER.getData(dataContext);
  presentation.setEnabled(provider != null && provider.isCopyEnabled(dataContext));
  if (event.getPlace().equals(ActionPlaces.EDITOR_POPUP) && provider != null) {
    presentation.setVisible(provider.isCopyVisible(dataContext));
  }
  else {
    presentation.setVisible(true);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:CopyAction.java

示例10: 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

示例11: update

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  DataContext dataContext = event.getDataContext();
  CopyProvider provider = event.getData(PlatformDataKeys.COPY_PROVIDER);
  boolean available = provider != null && provider.isCopyEnabled(dataContext) && provider.isCopyVisible(dataContext);
  presentation.setEnabled(available);
  presentation.setVisible(available);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:SearchWebAction.java

示例12: 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

示例13: update

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
public void update(AnActionEvent event) {
  Presentation presentation = event.getPresentation();
  DataContext dataContext = event.getDataContext();
  CopyProvider provider = event.getData(PlatformDataKeys.COPY_PROVIDER);
  presentation.setEnabled(provider != null && provider.isCopyEnabled(dataContext));
  if (event.getPlace().equals(ActionPlaces.EDITOR_POPUP) && provider != null) {
    presentation.setVisible(provider.isCopyVisible(dataContext));
  }
  else {
    presentation.setVisible(true);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:13,代码来源:CopyAction.java

示例14: getData

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
@Override
public CopyProvider getData(@Nonnull DataProvider dataProvider) {
  final Editor editor = dataProvider.getDataUnchecked(PlatformDataKeys.EDITOR);
  if (editor instanceof EditorEx) {
    return ((EditorEx) editor).getCopyProvider();
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:CopyProviderRule.java

示例15: getCopyProvider

import com.intellij.ide.CopyProvider; //导入依赖的package包/类
@Override
public CopyProvider getCopyProvider() {
  return myDelegate.getCopyProvider();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:EditorWindowImpl.java


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