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


Java NotNullProducer类代码示例

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


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

示例1: updateDetailsBorder

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private void updateDetailsBorder(@Nullable VcsFullCommitDetails data) {
  if (data == null || !myColorManager.isMultipleRoots()) {
    myMainContentPanel.setBorder(BorderFactory.createEmptyBorder());
  }
  else {
    Color color = VcsLogGraphTable.getRootBackgroundColor(data.getRoot(), myColorManager);
    myMainContentPanel.setBorder(new CompoundBorder(new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_COLORED_WIDTH, 0, 0, color),
                                                    new MatteBorder(0, VcsLogGraphTable.ROOT_INDICATOR_WHITE_WIDTH, 0, 0,
                                                                    new JBColor(new NotNullProducer<Color>() {
                                                                      @NotNull
                                                                      @Override
                                                                      public Color produce() {
                                                                        return getDetailsBackground();
                                                                      }
                                                                    }))));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DetailsPanel.java

示例2: createTextFieldWithHistoryWithBrowseButton

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@NotNull
public static TextFieldWithHistoryWithBrowseButton createTextFieldWithHistoryWithBrowseButton(@Nullable Project project,
                                                                                              @NotNull String browseDialogTitle,
                                                                                              @NotNull FileChooserDescriptor fileChooserDescriptor,
                                                                                              @Nullable NotNullProducer<List<String>> historyProvider) {
  TextFieldWithHistoryWithBrowseButton textFieldWithHistoryWithBrowseButton = new TextFieldWithHistoryWithBrowseButton();
  TextFieldWithHistory textFieldWithHistory = textFieldWithHistoryWithBrowseButton.getChildComponent();
  textFieldWithHistory.setHistorySize(-1);
  textFieldWithHistory.setMinimumAndPreferredWidth(0);
  if (historyProvider != null) {
    addHistoryOnExpansion(textFieldWithHistory, historyProvider);
  }
  installFileCompletionAndBrowseDialog(
    project,
    textFieldWithHistoryWithBrowseButton,
    browseDialogTitle,
    fileChooserDescriptor
  );
  return textFieldWithHistoryWithBrowseButton;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:SwingHelper.java

示例3: paintIcon

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
  g.setColor(new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      //noinspection UseJBColor
      return !darkBackground() ? new Color(0xffffcc) : new Color(0x675133);
    }
  }));
  g.fillRect(x, y, getIconWidth(), getIconHeight());

  g.setColor(JBColor.GRAY);
  g.drawRect(x, y, getIconWidth(), getIconHeight());

  g.setColor(EditorColorsManager.getInstance().getGlobalScheme().getDefaultForeground());
  final Font oldFont = g.getFont();
  g.setFont(MNEMONIC_FONT);

  ((Graphics2D)g).drawString(Character.toString(myMnemonic), x + 3, y + getIconHeight() - 1.5F);
  g.setFont(oldFont);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:Bookmark.java

示例4: startNioOrOio

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@Nonnull
public static BuiltInServer startNioOrOio(int workerCount,
                                          int firstPort,
                                          int portsCount,
                                          boolean tryAnyPort,
                                          @Nullable NotNullProducer<ChannelHandler> handler) throws Exception {
  BuiltInServerThreadFactory threadFactory = new BuiltInServerThreadFactory();
  NioEventLoopGroup nioEventLoopGroup;
  try {
    nioEventLoopGroup = new NioEventLoopGroup(workerCount, threadFactory);
  }
  catch (IllegalStateException e) {
    Logger.getInstance(BuiltInServer.class).warn(e);
    return start(new OioEventLoopGroup(1, threadFactory), true, 6942, 50, false, handler);
  }
  return start(nioEventLoopGroup, true, firstPort, portsCount, tryAnyPort, handler);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:BuiltInServer.java

示例5: configLintBinField

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private void configLintBinField() {
    configWithDefaults(sasslintBinField);
    SwingHelper.addHistoryOnExpansion(sasslintBinField.getChildComponent(), new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            List<File> newFiles = SassLintFinder.searchForSassLintExe(getProjectPath());
            return FileUtils.toAbsolutePath(newFiles);
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, sasslintBinField, "Select Sass Lint Exe", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:12,代码来源:SassLintSettingsPage.java

示例6: configConfigFileField

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private void configConfigFileField() {
    TextFieldWithHistory textFieldWithHistory = configWithDefaults(sassLintConfigFile);
    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            return SassLintFinder.searchForConfigFiles(getProjectPath());
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, sassLintConfigFile, "Select Sass Lint Config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:11,代码来源:SassLintSettingsPage.java

示例7: configNodeField

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private void configNodeField() {
    TextFieldWithHistory textFieldWithHistory = configWithDefaults(nodeInterpreterField);
    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, new NotNullProducer<List<String>>() {
        @NotNull
        public List<String> produce() {
            List<File> newFiles = NodeDetectionUtil.listAllPossibleNodeInterpreters();
            return FileUtils.toAbsolutePath(newFiles);
        }
    });
    SwingHelper.installFileCompletionAndBrowseDialog(project, nodeInterpreterField, "Select Node Interpreter", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:12,代码来源:SassLintSettingsPage.java

示例8: HyperlinkLabel

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
public HyperlinkLabel(String text) {
  this(text,
       PlatformColors.BLUE,
       new JBColor(new NotNullProducer<Color>() {
         @NotNull
         @Override
         public Color produce() {
           return UIUtil.getLabelBackground();
         }
       }),
       PlatformColors.BLUE);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:HyperlinkLabel.java

示例9: jbColor

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private JBColor jbColor(final Color regular, final Color dark) {
  return new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      return isDark() ? dark : regular;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ButtonlessScrollBarUI.java

示例10: paintMacThumb

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
private void paintMacThumb(Graphics g, Rectangle thumbBounds) {
  if (isMacScrollbarHiddenAndXcodeLikeScrollbar()) return;

  thumbBounds = getMacScrollBarBounds(thumbBounds, true);
  Graphics2D g2d = (Graphics2D)g;
  RenderingHints oldHints = g2d.getRenderingHints();
  g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

  JBColor baseColor = new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      return !isDark() ? Gray._0 : Gray._128;
    }
  });
  
  int arc = Math.min(thumbBounds.width, thumbBounds.height);

  if (alwaysPaintThumb()) {
    //noinspection UseJBColor
    g2d.setColor(new Color(baseColor.getRed(), baseColor.getGreen(), baseColor.getBlue(), isDark() ? 100 : 40));
    g2d.fillRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc);
    //g2d.drawRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc);
  }

  if (!myMacScrollbarHidden) {
    g2d.setColor(adjustColor(baseColor));
    g2d.fillRoundRect(thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, arc, arc);
  }
  g2d.setRenderingHints(oldHints);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ButtonlessScrollBarUI.java

示例11: getBackgroundColor

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@NotNull
public static JBColor getBackgroundColor(@NotNull final Color baseRootColor) {
  return new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      return ColorUtil.mix(baseRootColor, UIUtil.getTableBackground(), 0.75);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:VcsLogColorManagerImpl.java

示例12: getIndicatorColor

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@NotNull
public static JBColor getIndicatorColor(@NotNull final Color baseRootColor) {
  if (Registry.is("vcs.log.square.labels")) return getBackgroundColor(baseRootColor);
  return new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      if (UIUtil.isUnderDarcula()) return baseRootColor;
      return ColorUtil.darker(ColorUtil.softer(baseRootColor), 2);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:VcsLogColorManagerImpl.java

示例13: start

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@NotNull
public static BuiltInServer start(int workerCount,
                                  int firstPort,
                                  int portsCount,
                                  boolean tryAnyPort,
                                  @Nullable NotNullProducer<ChannelHandler> handler) throws Exception {
  return start(new NioEventLoopGroup(workerCount, PooledThreadExecutor.INSTANCE), true, firstPort, portsCount, tryAnyPort, handler);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:BuiltInServer.java

示例14: configureChildHandler

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
static void configureChildHandler(@NotNull ServerBootstrap bootstrap,
                                  @NotNull final ChannelRegistrar channelRegistrar,
                                  final @Nullable NotNullProducer<ChannelHandler> channelHandler) {
  final PortUnificationServerHandler portUnificationServerHandler = channelHandler == null ? new PortUnificationServerHandler() : null;
  bootstrap.childHandler(new ChannelInitializer() {
    @Override
    protected void initChannel(Channel channel) throws Exception {
      channel.pipeline().addLast(channelRegistrar, channelHandler == null ? portUnificationServerHandler : channelHandler.produce());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:BuiltInServer.java

示例15: lock

import com.intellij.util.NotNullProducer; //导入依赖的package包/类
@NotNull
public ActivateStatus lock(@NotNull final String[] args) throws Exception {
  log("enter: lock(config=%s system=%s)", myConfigPath, mySystemPath);

  return underLocks(new Callable<ActivateStatus>() {
    @Override
    public ActivateStatus call() throws Exception {
      File portMarkerC = new File(myConfigPath, PORT_FILE);
      File portMarkerS = new File(mySystemPath, PORT_FILE);

      MultiMap<Integer, String> portToPath = MultiMap.createSmart();
      addExistingPort(portMarkerC, myConfigPath, portToPath);
      addExistingPort(portMarkerS, mySystemPath, portToPath);
      if (!portToPath.isEmpty()) {
        for (Map.Entry<Integer, Collection<String>> entry : portToPath.entrySet()) {
          ActivateStatus status = tryActivate(entry.getKey(), entry.getValue(), args);
          if (status != ActivateStatus.NO_INSTANCE) {
            return status;
          }
        }
      }

      final String[] lockedPaths = {myConfigPath, mySystemPath};
      myServer = BuiltInServer.start(1, 6942, 50, false, new NotNullProducer<ChannelHandler>() {
        @NotNull
        @Override
        public ChannelHandler produce() {
          return new MyChannelInboundHandler(lockedPaths, myActivateListener);
        }
      });

      byte[] portBytes = Integer.toString(myServer.getPort()).getBytes(CharsetToolkit.UTF8_CHARSET);
      FileUtil.writeToFile(portMarkerC, portBytes);
      FileUtil.writeToFile(portMarkerS, portBytes);
      log("exit: lock(): succeed");
      return ActivateStatus.NO_INSTANCE;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:SocketLock.java


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