• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Producer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Producer类属于com.intellij.util包,在下文中一共展示了Producer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: paint

import com.intellij.util.Producer; //导入依赖的package包/类
@Override
public void paint(Graphics g) {
  final Rectangle bounds = g.getClipBounds();
  if (mySplitter instanceof OnePixelSplitter) {
    final Producer<Insets> blindZone = ((OnePixelSplitter)mySplitter).getBlindZone();
    if (blindZone != null) {
      final Insets insets = blindZone.produce();
      if (insets != null) {
        bounds.x += insets.left;
        bounds.y += insets.top;
        bounds.width -= insets.left + insets.right;
        bounds.height -= insets.top + insets.bottom;
        g.setColor(getBackground());
        g.fillRect(bounds.x, bounds.y, bounds.width, bounds.height);
        return;
      }
    }
  }
  super.paint(g);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:OnePixelDivider.java


示例2: resolveProjectInfo

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                @NotNull final String projectPath,
                                                final boolean isPreviewMode,
                                                final S settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, isPreviewMode, settings, getNotificationListener());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例3: executeTasks

import com.intellij.util.Producer; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull final String projectPath,
                         @Nullable final S settings,
                         @NotNull final List<String> vmOptions,
                         @NotNull final List<String> scriptParameters,
                         @Nullable final String debuggerSetup) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(
        id, taskNames, projectPath, settings, vmOptions, scriptParameters, debuggerSetup, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例4: createEditorContent

import com.intellij.util.Producer; //导入依赖的package包/类
protected JComponent createEditorContent() {
  final JPanel result = new JPanel(new BorderLayout());

  searchCriteriaEdit = createEditor(searchContext, mySavedEditorText != null ? mySavedEditorText : "");
  result.add(BorderLayout.CENTER, searchCriteriaEdit.getComponent());
  result.setMinimumSize(new Dimension(150, 100));

  final JPanel labelPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 0));
  labelPanel.add(new JLabel(SSRBundle.message("search.template")));

  labelPanel.add(UIUtil.createCompleteMatchInfo(new Producer<Configuration>() {
    @Nullable
    @Override
    public Configuration produce() {
      return model.getConfig();
    }
  }));
  result.add(BorderLayout.NORTH, labelPanel);

  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:SearchDialog.java


示例5: getCopiedFqn

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
private static String getCopiedFqn(final DataContext context) {
  Producer<Transferable> producer = PasteAction.TRANSFERABLE_PROVIDER.getData(context);

  if (producer != null) {
    Transferable transferable = producer.produce();
    if (transferable != null) {
      try {
        return (String)transferable.getTransferData(CopyReferenceAction.ourFlavor);
      }
      catch (Exception ignored) { }
    }
    return null;
  }

  return CopyPasteManager.getInstance().getContents(CopyReferenceAction.ourFlavor);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:PasteReferenceProvider.java


示例6: updateText

import com.intellij.util.Producer; //导入依赖的package包/类
public void updateText(@NotNull final Producer<String> contentProducer) {
  myAlarm.cancelAllRequests();
  myAlarm.addRequest(new Runnable() {
    @Override
    public void run() {
      if (!isDisposed) {
        final String newText = contentProducer.produce();
        if (StringUtil.isEmpty(newText)) {
          hide();
        }
        else if (!myEditor.getDocument().getText().equals(newText)) {
          DocumentUtil.writeInRunUndoTransparentAction(new Runnable() {
            @Override
            public void run() {
              myEditor.getDocument().setText(newText);
            }
          });
        }
      }
    }
  }, 100);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:EmmetPreviewHint.java


示例7: prevWalker

import com.intellij.util.Producer; //导入依赖的package包/类
private static Producer<PsiElement> prevWalker(final PsiElement element, final PsiElement scope) {
  return new Producer<PsiElement>() {
    PsiElement e = element;

    @Nullable
    @Override
    public PsiElement produce() {
      if (e == null || e == scope) return null;
      PsiElement prev = e.getPrevSibling();
      if (prev != null) {
        return e = PsiTreeUtil.getDeepestLast(prev);
      }
      else {
        PsiElement parent = e.getParent();
        return e = parent == scope || parent instanceof PsiFile ? null : parent;
      }
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:InjectorUtils.java


示例8: runPasteAction

import com.intellij.util.Producer; //导入依赖的package包/类
private void runPasteAction(final String toPaste) {
    final Producer<Transferable> producer = new Producer<Transferable>() {
        @Nullable
        @Override
        public Transferable produce() {
            return new StringSelection(toPaste);
        }
    };
    EditorActionManager actionManager = EditorActionManager.getInstance();
    EditorActionHandler pasteActionHandler = actionManager.getActionHandler(ACTION_EDITOR_PASTE);
    final PasteHandler pasteHandler = new PasteHandler(pasteActionHandler);
    new WriteCommandAction.Simple(getProject(), new PsiFile[0]) {
        protected void run() throws Throwable {
            Component component = myFixture.getEditor().getComponent();
            DataContext dataContext = DataManager.getInstance().getDataContext(component);
            pasteHandler.execute(myFixture.getEditor(), dataContext, producer);
        }
    }.execute();
}
 
开发者ID:platan,项目名称:idea-gradle-dependencies-formatter,代码行数:20,代码来源:MavenToGradleDependenciesCopyPasteProcessorTest.java


示例9: resolveProjectInfo

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@NotNull final ExternalSystemTaskId id,
                                                @NotNull final String projectPath,
                                                final boolean downloadLibraries,
                                                ExternalSystemExecutionSettings settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, downloadLibraries, getSettings(), getNotificationListener());
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例10: executeTasks

import com.intellij.util.Producer; //导入依赖的package包/类
@Override
public void executeTasks(@NotNull final ExternalSystemTaskId id,
                         @NotNull final List<String> taskNames,
                         @NotNull final String projectPath,
                         @Nullable final S settings,
                         @Nullable final String vmOptions) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(id, taskNames, projectPath, settings, vmOptions, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例11: resolveProjectInfo

import com.intellij.util.Producer; //导入依赖的package包/类
@javax.annotation.Nullable
@Override
public DataNode<ProjectData> resolveProjectInfo(@Nonnull final ExternalSystemTaskId id,
                                                @Nonnull final String projectPath,
                                                final boolean isPreviewMode,
                                                ExternalSystemExecutionSettings settings)
  throws ExternalSystemException, IllegalArgumentException, IllegalStateException
{
  return execute(id, new Producer<DataNode<ProjectData>>() {
    @javax.annotation.Nullable
    @Override
    public DataNode<ProjectData> produce() {
      return myDelegate.resolveProjectInfo(id, projectPath, isPreviewMode, getSettings(), getNotificationListener());
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:RemoteExternalSystemProjectResolverImpl.java


示例12: executeTasks

import com.intellij.util.Producer; //导入依赖的package包/类
@Override
public void executeTasks(@Nonnull final ExternalSystemTaskId id,
                         @Nonnull final List<String> taskNames,
                         @Nonnull final String projectPath,
                         @javax.annotation.Nullable final S settings,
                         @Nonnull final List<String> vmOptions,
                         @Nonnull final List<String> scriptParameters,
                         @javax.annotation.Nullable final String debuggerSetup) throws RemoteException, ExternalSystemException
{
  execute(id, new Producer<Object>() {
    @javax.annotation.Nullable
    @Override
    public Object produce() {
      myDelegate.executeTasks(
              id, taskNames, projectPath, settings, vmOptions, scriptParameters, debuggerSetup, getNotificationListener());
      return null;
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:RemoteExternalSystemTaskManagerImpl.java


示例13: createMap

import com.intellij.util.Producer; //导入依赖的package包/类
@Nonnull
public static <K, V> ConcurrentMap<K, V> createMap(@Nonnull final Function<K, V> computeValue, @Nonnull final Producer<ConcurrentMap<K,V>> mapCreator) {
  //noinspection deprecation
  return new ConcurrentFactoryMap<K, V>() {
    @Nullable
    @Override
    protected V create(K key) {
      return computeValue.fun(key);
    }

    @Nonnull
    @Override
    protected ConcurrentMap<K, V> createMap() {
      return mapCreator.produce();
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:ConcurrentFactoryMap.java


示例14: createMap

import com.intellij.util.Producer; //导入依赖的package包/类
@Nonnull
public static <K, V> Map<K, V> createMap(@Nonnull final Function<K, V> computeValue, @Nonnull final Producer<Map<K,V>> mapCreator) {
  //noinspection deprecation
  return new FactoryMap<K, V>() {
    @Nullable
    @Override
    protected V create(K key) {
      return computeValue.fun(key);
    }

    @Nonnull
    @Override
    protected Map<K, V> createMap() {
      return mapCreator.produce();
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:FactoryMap.java


示例15: getCopiedFqn

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
private static String getCopiedFqn(final DataContext context) {
  Producer<Transferable> producer = context.getData(PasteAction.TRANSFERABLE_PROVIDER);

  if (producer != null) {
    Transferable transferable = producer.produce();
    if (transferable != null) {
      try {
        return (String)transferable.getTransferData(CopyReferenceAction.ourFlavor);
      }
      catch (Exception ignored) { }
    }
    return null;
  }

  return CopyPasteManager.getInstance().getContents(CopyReferenceAction.ourFlavor);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:PasteReferenceProvider.java


示例16: getTransferable

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
public static Transferable getTransferable(final @NotNull Editor editor, DataContext dataContext) {
    try {
        Producer<Transferable> producer = PasteAction.TRANSFERABLE_PROVIDER.getData(dataContext);
        //noinspection UnnecessaryLocalVariable
        Transferable transferable = EditorModificationUtil.getContentsToPasteToEditor(producer);
        return transferable;
    } catch (Throwable e) {
        logger.error("error", e);
    }
    return null;
}
 
开发者ID:vsch,项目名称:MissingInActions,代码行数:13,代码来源:ClipboardCaretContent.java


示例17: getContentsToPasteToEditor

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
public static Transferable getContentsToPasteToEditor(@Nullable Producer<Transferable> producer) {
  if (producer == null) {
    CopyPasteManager manager = CopyPasteManager.getInstance();
    return manager.areDataFlavorsAvailable(DataFlavor.stringFlavor) ? manager.getContents() : null;
  }
  else {
    return producer.produce();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:EditorModificationUtil.java


示例18: getTransferable

import com.intellij.util.Producer; //导入依赖的package包/类
private static Transferable getTransferable(Producer<Transferable> producer) {
  Transferable content = null;
  if (producer != null) {
    content = producer.produce();
  }
  else {
    CopyPasteManager manager = CopyPasteManager.getInstance();
    if (manager.areDataFlavorsAvailable(DataFlavor.stringFlavor)) {
      content = manager.getContents();
    }
  }
  return content;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:EditorModificationUtil.java


示例19: getLabel

import com.intellij.util.Producer; //导入依赖的package包/类
@Nullable
public String getLabel() {
  return accessChanges(new Producer<String>() {
    @Override
    public String produce() {
      for (Change each : myChanges) {
        if (each instanceof PutLabelChange) {
          return ((PutLabelChange)each).getName();
        }
      }
      return null;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:ChangeSet.java


示例20: getLabelColor

import com.intellij.util.Producer; //导入依赖的package包/类
public int getLabelColor() {
  return accessChanges(new Producer<Integer>() {
    @Override
    public Integer produce() {
      for (Change each : myChanges) {
        if (each instanceof PutSystemLabelChange) {
          return ((PutSystemLabelChange)each).getColor();
        }
      }
      return -1;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ChangeSet.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EnchantmentDamageAll类代码示例发布时间:2022-05-22
下一篇:
Java WebJarAssetLocator类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap