本文整理汇总了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();
}
}))));
}
}
示例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;
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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;
}
});
}
示例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);
}
示例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);
}
});
}
示例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);
}
});
}
示例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);
}
示例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());
}
});
}
示例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;
}
});
}