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

Java UIBundle类代码示例

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

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



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

示例1: ComponentWithBrowseButton

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public ComponentWithBrowseButton(Comp component, @Nullable ActionListener browseActionListener) {
  super(new BorderLayout(SystemInfo.isMac ? 0 : 2, 0));

  myComponent = component;
  // required! otherwise JPanel will occasionally gain focus instead of the component
  setFocusable(false);
  add(myComponent, BorderLayout.CENTER);

  myBrowseButton = new FixedSizeButton(myComponent);
  if (browseActionListener != null) {
    myBrowseButton.addActionListener(browseActionListener);
  }
  // don't force FixedSizeButton to occupy the whole height
  add(wrapWithoutResize(myBrowseButton), BorderLayout.EAST);

  myBrowseButton.setToolTipText(UIBundle.message("component.with.browse.button.browse.button.tooltip.text"));

  // FixedSizeButton isn't focusable but it should be selectable via keyboard.
  if (ApplicationManager.getApplication() != null) {  // avoid crash at design time
    new MyDoClickAction(myBrowseButton).registerShortcut(myComponent);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ComponentWithBrowseButton.java


示例2: updateState

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private void updateState() {
  if (!isShowing()) {
    return;
  }

  final Runtime runtime = Runtime.getRuntime();
  final long total = runtime.totalMemory() / MEGABYTE;
  final long used = total - runtime.freeMemory() / MEGABYTE;

  if (total != myLastTotal || used != myLastUsed) {
    myLastTotal = total;
    myLastUsed = used;
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        myBufferedImage = null;
        repaint();
      }
    });

    setToolTipText(UIBundle.message("memory.usage.panel.statistics.message", total, used));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:MemoryUsagePanel.java


示例3: addNotify

import com.intellij.ui.UIBundle; //导入依赖的package包/类
@Override
public void addNotify() {
  super.addNotify();
  final String key = "toolwindow.stripes.buttons.info.shown";
  if (UISettings.getInstance().HIDE_TOOL_STRIPES && !PropertiesComponent.getInstance().isTrueValue(key)) {
    PropertiesComponent.getInstance().setValue(key, String.valueOf(true));
    final Alarm alarm = new Alarm();
    alarm.addRequest(new Runnable() {
      @Override
      public void run() {
        GotItMessage.createMessage(UIBundle.message("tool.window.quick.access.title"), UIBundle.message(
          "tool.window.quick.access.message"))
          .setDisposable(ToolWindowsWidget.this)
          .show(new RelativePoint(ToolWindowsWidget.this, new Point(10, 0)), Balloon.Position.above);
        Disposer.dispose(alarm);
      }
    }, 20000);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ToolWindowsWidget.java


示例4: getClickConsumer

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public Consumer<MouseEvent> getClickConsumer() {
  return new Consumer<MouseEvent>() {
    public void consume(MouseEvent mouseEvent) {
      final VirtualFile file = getCurrentFile();
      if (!isReadOnlyApplicableForFile(file)) {
        return;
      }
      FileDocumentManager.getInstance().saveAllDocuments();

      ApplicationManager.getApplication().runWriteAction(new Runnable() {
        public void run() {
          try {
            ReadOnlyAttributeUtil.setReadOnlyAttribute(file, file.isWritable());
            myStatusBar.updateWidget(ID());
          }
          catch (IOException e) {
            Messages.showMessageDialog(getProject(), e.getMessage(), UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
          }
        }
      });
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ToggleReadOnlyAttributePanel.java


示例5: getClickConsumer

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public Consumer<MouseEvent> getClickConsumer() {
  return new Consumer<MouseEvent>() {
    public void consume(MouseEvent mouseEvent) {
      final Project project = getProject();
      if (project == null) return;
      final Editor editor = getEditor();
      if (editor == null) return;
      final CommandProcessor processor = CommandProcessor.getInstance();
      processor.executeCommand(
        project, new Runnable() {
          public void run() {
            final GotoLineNumberDialog dialog = new GotoLineNumberDialog(project, editor);
            dialog.show();
            IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation();
          }
        },
        UIBundle.message("go.to.line.command.name"),
        null
      );
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:PositionPanel.java


示例6: createFileNamePanel

import com.intellij.ui.UIBundle; //导入依赖的package包/类
protected JComponent createFileNamePanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(new JLabel(UIBundle.message("file.chooser.save.dialog.file.name")), BorderLayout.WEST);
  myFileName.setText("");
  myFileName.getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      updateOkButton();
    }
  });

  panel.add(myFileName, BorderLayout.CENTER);
  if (myExtensions.getModel().getSize() > 0) {
    myExtensions.setSelectedIndex(0);
    panel.add(myExtensions, BorderLayout.EAST);
  }
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:FileSaverDialogImpl.java


示例7: createNewFile

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private static void createNewFile(FileSystemTree fileSystemTree, final FileType fileType, final String initialContent) {
  final VirtualFile file = fileSystemTree.getNewFileParent();
  if (file == null || !file.isDirectory()) return;

  String newFileName;
  while (true) {
    newFileName = Messages.showInputDialog(UIBundle.message("create.new.file.enter.new.file.name.prompt.text"),
                                             UIBundle.message("new.file.dialog.title"), Messages.getQuestionIcon());
    if (newFileName == null) {
      return;
    }
    if ("".equals(newFileName.trim())) {
      Messages.showMessageDialog(UIBundle.message("create.new.file.file.name.cannot.be.empty.error.message"),
                                 UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
      continue;
    }
    Exception failReason = ((FileSystemTreeImpl)fileSystemTree).createNewFile(file, newFileName, fileType, initialContent);
    if (failReason != null) {
      Messages.showMessageDialog(UIBundle.message("create.new.file.could.not.create.file.error.message", newFileName),
                                 UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
      continue;
    }
    return;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:NewFileAction.java


示例8: createNewFolder

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private static void createNewFolder(FileSystemTree fileSystemTree) {
  final VirtualFile file = fileSystemTree.getNewFileParent();
  if (file == null || !file.isDirectory()) return;

  final InputValidatorEx validator = new NewFolderValidator(file);
  final String newFolderName = Messages.showInputDialog(UIBundle.message("create.new.folder.enter.new.folder.name.prompt.text"),
                                                        UIBundle.message("new.folder.dialog.title"), Messages.getQuestionIcon(),
                                                        "", validator);
  if (newFolderName == null) {
    return;
  }
  Exception failReason = ((FileSystemTreeImpl)fileSystemTree).createNewFolder(file, newFolderName);
  if (failReason != null) {
    Messages.showMessageDialog(UIBundle.message("create.new.folder.could.not.create.folder.error.message", newFolderName),
                               UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:NewFolderAction.java


示例9: ComponentWithBrowseButton

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public ComponentWithBrowseButton(Comp component, @Nullable ActionListener browseActionListener) {
  super(new BorderLayout(SystemInfo.isMac? 0 : 2, 0));
  myComponent = component;
  // required! otherwise JPanel will occasionally gain focus instead of the component
  setFocusable(false);
  add(myComponent, BorderLayout.CENTER);

  myBrowseButton=new FixedSizeButton(myComponent);
  if (browseActionListener != null)
    myBrowseButton.addActionListener(browseActionListener);
  add(myBrowseButton, BorderLayout.EAST);

  myBrowseButton.setToolTipText(UIBundle.message("component.with.browse.button.browse.button.tooltip.text"));

  // FixedSizeButton isn't focusable but it should be selectable via keyboard.
  if (ApplicationManager.getApplication() != null) {  // avoid crash at design time
    new MyDoClickAction(myBrowseButton).registerShortcut(myComponent);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ComponentWithBrowseButton.java


示例10: createFileNamePanel

import com.intellij.ui.UIBundle; //导入依赖的package包/类
protected JComponent createFileNamePanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(new JLabel(UIBundle.message("file.chooser.save.dialog.file.name")), BorderLayout.WEST);
  myFileName.setText("");
  myFileName.getDocument().addDocumentListener(new DocumentAdapter() {
    protected void textChanged(DocumentEvent e) {
      updateOkButton();
    }
  });

  panel.add(myFileName, BorderLayout.CENTER);
  if (myExtensions.getModel().getSize() > 0) {
    myExtensions.setSelectedIndex(0);
    panel.add(myExtensions, BorderLayout.EAST);
  }
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:FileSaverDialogImpl.java


示例11: createNewFolder

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private static void createNewFolder(FileSystemTree fileSystemTree) {
  final VirtualFile file = fileSystemTree.getNewFileParent();
  if (file == null || !file.isDirectory()) return;

  String newFolderName;
  while (true) {
    newFolderName = Messages.showInputDialog(UIBundle.message("create.new.folder.enter.new.folder.name.prompt.text"),
                                             UIBundle.message("new.folder.dialog.title"), Messages.getQuestionIcon());
    if (newFolderName == null) {
      return;
    }
    if ("".equals(newFolderName.trim())) {
      Messages.showMessageDialog(UIBundle.message("create.new.folder.folder.name.cannot.be.empty.error.message"),
                                 UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
      continue;
    }
    Exception failReason = ((FileSystemTreeImpl)fileSystemTree).createNewFolder(file, newFolderName);
    if (failReason != null) {
      Messages.showMessageDialog(UIBundle.message("create.new.folder.could.not.create.folder.error.message", newFolderName),
                                 UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
      continue;
    }
    return;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:NewFolderAction.java


示例12: ComponentWithBrowseButton

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public ComponentWithBrowseButton(Comp component, @Nullable ActionListener browseActionListener) {
  super(new BorderLayout(SystemInfo.isMac ? 0 : 2, 0));

  myComponent = component;
  // required! otherwise JPanel will occasionally gain focus instead of the component
  setFocusable(false);
  add(myComponent, BorderLayout.CENTER);

  myBrowseButton = new FixedSizeButton(myComponent);
  if (browseActionListener != null) {
    myBrowseButton.addActionListener(browseActionListener);
  }
  add(centerComponentVertically(myBrowseButton), BorderLayout.EAST);

  myBrowseButton.setToolTipText(UIBundle.message("component.with.browse.button.browse.button.tooltip.text"));
  // FixedSizeButton isn't focusable but it should be selectable via keyboard.
  if (ApplicationManager.getApplication() != null) {  // avoid crash at design time
    new MyDoClickAction(myBrowseButton).registerShortcut(myComponent);
  }
  if (ScreenReader.isActive()) {
    myBrowseButton.setFocusable(true);
    myBrowseButton.getAccessibleContext().setAccessibleName("Browse");
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:ComponentWithBrowseButton.java


示例13: updateState

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private void updateState() {
  if (!isShowing()) {
    return;
  }

  final Runtime runtime = Runtime.getRuntime();
  final long total = runtime.totalMemory() / MEGABYTE;
  final long used = total - runtime.freeMemory() / MEGABYTE;

  if (total != myLastTotal || used != myLastUsed) {
    myLastTotal = total;
    myLastUsed = used;
    //noinspection SSBasedInspection
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        myBufferedImage = null;
        repaint();
      }
    });

    setToolTipText(UIBundle.message("memory.usage.panel.statistics.message", total, used));
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:MemoryUsagePanel.java


示例14: getClickConsumer

import com.intellij.ui.UIBundle; //导入依赖的package包/类
@Override
public Consumer<MouseEvent> getClickConsumer() {
  return mouseEvent -> {
    final VirtualFile file = getCurrentFile();
    if (!isReadOnlyApplicableForFile(file)) {
      return;
    }
    FileDocumentManager.getInstance().saveAllDocuments();

    try {
      WriteAction.run(() -> ReadOnlyAttributeUtil.setReadOnlyAttribute(file, file.isWritable()));
      myStatusBar.updateWidget(ID());
    }
    catch (IOException e) {
      Messages.showMessageDialog(getProject(), e.getMessage(), UIBundle.message("error.dialog.title"), Messages.getErrorIcon());
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:ToggleReadOnlyAttributePanel.java


示例15: getClickConsumer

import com.intellij.ui.UIBundle; //导入依赖的package包/类
@Override
public Consumer<MouseEvent> getClickConsumer() {
  return mouseEvent -> {
    final Project project = getProject();
    if (project == null) return;
    final Editor editor = getEditor();
    if (editor == null) return;
    final CommandProcessor processor = CommandProcessor.getInstance();
    processor.executeCommand(
            project, () -> {
      final GotoLineNumberDialog dialog = new GotoLineNumberDialog(project, editor);
      dialog.show();
      IdeDocumentHistory.getInstance(project).includeCurrentCommandAsNavigation();
    },
            UIBundle.message("go.to.line.command.name"),
            null
    );
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:PositionPanel.java


示例16: ClassFilterEditorAddDialog

import com.intellij.ui.UIBundle; //导入依赖的package包/类
public ClassFilterEditorAddDialog(Project project, @Nullable String helpId) {
  super(project, true);
  myProject = project;
  myHelpId = helpId;
  setTitle(UIBundle.message("class.filter.editor.add.dialog.title"));
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ClassFilterEditorAddDialog.java


示例17: createCenterPanel

import com.intellij.ui.UIBundle; //导入依赖的package包/类
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final JLabel header = new JLabel(UIBundle.message("label.class.filter.editor.add.dialog.filter.pattern"));
  myClassName = new TextFieldWithBrowseButton(new JTextField(35));
  final JLabel iconLabel = new JLabel(Messages.getQuestionIcon());
  
  panel.add(header, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 10, 0, 0), 0, 0));
  panel.add(myClassName, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 10, 0, 0), 0, 0));
  panel.add(iconLabel, new GridBagConstraints(0, 0, 1, 2, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(15, 0, 0, 0), 0, 0));

  myClassName.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      PsiClass currentClass = getSelectedClass();
      TreeClassChooser chooser = TreeClassChooserFactory.getInstance(myProject).createNoInnerClassesScopeChooser(
        UIBundle.message("class.filter.editor.choose.class.title"), GlobalSearchScope.allScope(myProject), null, null);
      if (currentClass != null) {
        PsiFile containingFile = currentClass.getContainingFile();
        if (containingFile != null) {
          PsiDirectory containingDirectory = containingFile.getContainingDirectory();
          if (containingDirectory != null) {
            chooser.selectDirectory(containingDirectory);
          }
        }
      }
      chooser.showDialog();
      PsiClass selectedClass = chooser.getSelected();
      if (selectedClass != null) {
        myClassName.setText(selectedClass.getQualifiedName());
      }
    }
  });

  myClassName.setEnabled(myProject != null);

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


示例18: doHelpAction

import com.intellij.ui.UIBundle; //导入依赖的package包/类
/**
 * Invoked by default implementation of "Help" action.
 * Note that the method does nothing if "Help" action isn't enabled.
 * <p/>
 * The default implementation shows the help page with id returned
 * by {@link #getHelpId()}. If that method returns null,
 * a message box with message "no help available" is shown.
 */
protected void doHelpAction() {
  if (myHelpAction.isEnabled()) {
    String helpId = getHelpId();
    if (helpId != null) {
      HelpManager.getInstance().invokeHelp(helpId);
    }
    else {
      Messages.showMessageDialog(getContentPane(), UIBundle.message("there.is.no.help.for.this.dialog.error.message"),
                                 UIBundle.message("no.help.available.dialog.title"), Messages.getInformationIcon());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:DialogWrapper.java


示例19: updateStatus

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private void updateStatus() {
  final Editor editor = getEditor();
  if (editor == null || !editor.isColumnMode()) {
    myTextPanel.setBorder(null);
    myTextPanel.setVisible(false);
  } else {
    myTextPanel.setBorder(WidgetBorder.INSTANCE);
    myTextPanel.setVisible(true);
    myTextPanel.setText(UIBundle.message("status.bar.column.status.text"));
    myTextPanel.setToolTipText("Column selection mode");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:InsertOverwritePanel.java


示例20: getPositionText

import com.intellij.ui.UIBundle; //导入依赖的package包/类
private String getPositionText(@NotNull Editor editor) {
  if (!editor.isDisposed() && myStatusBar != null) {
    StringBuilder message = new StringBuilder();

    SelectionModel selectionModel = editor.getSelectionModel();
    int caretCount = editor.getCaretModel().getCaretCount();
    if (caretCount > 1) {
      message.append(UIBundle.message("position.panel.caret.count", caretCount));
    }
    else {
      if (selectionModel.hasSelection()) {
        int selectionStart = selectionModel.getSelectionStart();
        int selectionEnd = selectionModel.getSelectionEnd();
        if (selectionEnd > selectionStart) {
          message.append(UIBundle.message("position.panel.selected.chars.count", selectionEnd - selectionStart));
          int selectionStartLine = editor.getDocument().getLineNumber(selectionStart);
          int selectionEndLine = editor.getDocument().getLineNumber(selectionEnd);
          if (selectionEndLine > selectionStartLine) {
            message.append(", ");
            message.append(UIBundle.message("position.panel.selected.lines.count", selectionEndLine - selectionStartLine + 1));
          }
          message.append("     ");
        }
      }
      LogicalPosition caret = editor.getCaretModel().getLogicalPosition();
      message.append(caret.line + 1).append(":").append(caret.column + 1);
    }

    return message.toString();
  }
  else {
    return "";
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:PositionPanel.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java X9ECParametersHolder类代码示例发布时间:2022-05-22
下一篇:
Java Injector类代码示例发布时间: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