本文整理汇总了Java中com.intellij.util.ui.JBUI类的典型用法代码示例。如果您正苦于以下问题:Java JBUI类的具体用法?Java JBUI怎么用?Java JBUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JBUI类属于com.intellij.util.ui包,在下文中一共展示了JBUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TablePanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
public TablePanel(Table table) {
$$$setupUI$$$();
rootPanel.setBorder(IdeBorderFactory.createTitledBorder(table.getTableName(), false));
//不可整列移动
fieldTable.getTableHeader().setReorderingAllowed(false);
//不可拉动表格
fieldTable.getTableHeader().setResizingAllowed(false);
fieldTable.getEmptyText().setText("No Columns");
JPanel panel = ToolbarDecorator.createDecorator(fieldTable)
.setAddAction(it -> addAction())
.setRemoveAction(it -> removeAction())
.setEditAction(it -> editAction())
.createPanel();
panel.setPreferredSize(JBUI.size(300, 200));
columnsPanel.setBorder(IdeBorderFactory.createTitledBorder("Columns", false));
columnsPanel.add(panel, BorderLayout.CENTER);
mainPanel.add(columnsPanel);
modelTextField.setText(table.getModelName());
tableTextField.setText(table.getTableName());
initFields(table.getFields());
this.getRootComponent().registerKeyboardAction(e -> this.getRootComponent().disable(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
}
示例2: createEditorPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
public static StacktraceEditorPanel createEditorPanel(Project project, @NotNull Disposable parentDisposable) {
EditorFactory editorFactory = EditorFactory.getInstance();
Document document = editorFactory.createDocument("");
Editor editor = editorFactory.createEditor(document, project);
EditorSettings settings = editor.getSettings();
settings.setFoldingOutlineShown(false);
settings.setLineMarkerAreaShown(false);
settings.setIndentGuidesShown(false);
settings.setLineNumbersShown(false);
settings.setRightMarginShown(false);
StacktraceEditorPanel editorPanel = new StacktraceEditorPanel(project, editor);
editorPanel.setPreferredSize(JBUI.size(600, 400));
Disposer.register(parentDisposable, editorPanel);
return editorPanel;
}
示例3: createCenterPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
JPanel panel = new JPanel(new BorderLayout(0, 2));
panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH);
@NonNls StringBuilder buf = new StringBuilder();
for (String description : myConflictDescriptions) {
buf.append(description);
buf.append("<br><br>");
}
JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, buf.toString());
messagePane.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.setPreferredSize(JBUI.size(500, 400));
panel.add(scrollPane, BorderLayout.CENTER);
if (getOKAction().isEnabled()) {
panel.add(new JLabel(RefactoringBundle.message("do.you.wish.to.ignore.them.and.continue")), BorderLayout.SOUTH);
}
return panel;
}
示例4: createCenterPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
protected JComponent createCenterPanel() {
JPanel contentPanel = new JPanel(new BorderLayout());
Box mainPanel = Box.createHorizontalBox();
myClassFilterEditor = new ClassFilterEditor(myProject, myChooserFilter, "reference.viewBreakpoints.classFilters.newPattern");
myClassFilterEditor.setPreferredSize(JBUI.size(400, 200));
myClassFilterEditor.setBorder(IdeBorderFactory.createTitledBorder(
DebuggerBundle.message("class.filters.dialog.inclusion.filters.group"), false));
mainPanel.add(myClassFilterEditor);
myClassExclusionFilterEditor = new ClassFilterEditor(myProject, myChooserFilter, "reference.viewBreakpoints.classFilters.newPattern");
myClassExclusionFilterEditor.setPreferredSize(JBUI.size(400, 200));
myClassExclusionFilterEditor.setBorder(IdeBorderFactory.createTitledBorder(
DebuggerBundle.message("class.filters.dialog.exclusion.filters.group"), false));
mainPanel.add(myClassExclusionFilterEditor);
contentPanel.add(mainPanel, BorderLayout.CENTER);
return contentPanel;
}
示例5: paintCheckSign
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
protected void paintCheckSign(Graphics2D g, boolean enabled, int w, int h) {
g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
g.setStroke(new BasicStroke(1 * JBUI.scale(2.0f), BasicStroke.CAP_ROUND,BasicStroke.JOIN_ROUND));
g.setPaint(getShadowColor(enabled, true));
final int x1 = JBUI.scale(4);
final int y1 = JBUI.scale(7);
final int x2 = JBUI.scale(7);
final int y2 = JBUI.scale(11);
final int x3 = w;
final int y3 = JBUI.scale(2);
g.drawLine(x1, y1, x2, y2);
g.drawLine(x2, y2, x3, y3);
g.setPaint(getCheckSignColor(enabled, true));
g.translate(0, -2);
g.drawLine(x1, y1, x2, y2);
g.drawLine(x2, y2, x3, y3);
g.translate(0, 2);
}
示例6: createCenterPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
myList = new JBList(myNamedElements);
myList.setCellRenderer(new FQNameCellRenderer());
panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);
panel.add(new JBLabel(myContainsClassesOnly ?
CodeInsightBundle.message("dialog.paste.on.import.text") :
CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH);
final JPanel buttonPanel = new JPanel(new VerticalFlowLayout());
final JButton okButton = new JButton(CommonBundle.getOkButtonText());
getRootPane().setDefaultButton(okButton);
buttonPanel.add(okButton);
final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText());
buttonPanel.add(cancelButton);
panel.setPreferredSize(JBUI.size(500, 400));
return panel;
}
示例7: DirDiffFrame
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
public DirDiffFrame(Project project, DirDiffTableModel model) {
super(project, "DirDiffDialog");
setSize(JBUI.size(800, 600));
setTitle(model.getTitle());
myPanel = new DirDiffPanel(model, new DirDiffWindow(this));
Disposer.register(this, myPanel);
setComponent(myPanel.getPanel());
if (project != null) {
setProject(project);
}
closeOnEsc();
DataManager.registerDataProvider(myPanel.getPanel(), new DataProvider() {
@Override
public Object getData(@NonNls String dataId) {
if (PlatformDataKeys.HELP_ID.is(dataId)) {
return "reference.dialogs.diff.folder";
}
return null;
}
});
}
示例8: SearchTextArea
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
public SearchTextArea(boolean search) {
myTextArea = new JTextArea();
setBorder(JBUI.Borders.empty(6, 6, 6, 8));
setLayout(new BorderLayout(JBUI.scale(4), 0));
myTextArea.addPropertyChangeListener("background", this);
myTextArea.addFocusListener(this);
myTextArea.setBorder(null);
myTextArea.setOpaque(false);
JBScrollPane scrollPane = new JBScrollPane(myTextArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
scrollPane.getVerticalScrollBar().setBackground(UIUtil.TRANSPARENT_COLOR);
scrollPane.getViewport().setBorder(null);
scrollPane.getViewport().setOpaque(false);
scrollPane.setBorder(JBUI.Borders.emptyRight(2));
scrollPane.setOpaque(false);
ShowHistoryAction historyAction = new ShowHistoryAction(search);
ActionButton button =
new ActionButton(historyAction, historyAction.getTemplatePresentation(), ActionPlaces.UNKNOWN, new Dimension(JBUI.scale(16), JBUI.scale(16)));
button.setLook(new InplaceActionButtonLook());
JPanel p = new NonOpaquePanel(new BorderLayout());
p.add(button, BorderLayout.NORTH);
add(p, BorderLayout.WEST);
add(scrollPane, BorderLayout.CENTER);
}
示例9: createForcePushInfoLabel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@NotNull
private JComponent createForcePushInfoLabel() {
JPanel text = new JPanel();
text.setLayout(new BoxLayout(text, BoxLayout.X_AXIS));
JLabel label = new JLabel("You can enable and configure Force Push in " + ShowSettingsUtil.getSettingsMenuName() + ".");
label.setEnabled(false);
label.setFont(JBUI.Fonts.smallFont());
text.add(label);
ActionLink here = new ActionLink("Configure", new AnAction() {
@Override
public void actionPerformed(AnActionEvent e) {
Project project = myController.getProject();
VcsPushDialog.this.doCancelAction(e.getInputEvent());
ShowSettingsUtilImpl.showSettingsDialog(project, "vcs.Git", "force push");
}
});
here.setFont(JBUI.Fonts.smallFont());
text.add(here);
return JBUI.Panels.simplePanel().addToRight(text).withBorder(JBUI.Borders.emptyBottom(4));
}
示例10: createArrowButton
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@Override
protected JButton createArrowButton() {
final Color bg = myComboBox.getBackground();
final Color fg = myComboBox.getForeground();
JButton button = new BasicArrowButton(SwingConstants.SOUTH, bg, fg, fg, fg) {
@Override
public void paint(Graphics g2) {
Icon icon = MacIntelliJIconCache.getIcon("comboRight", false, myComboBox.hasFocus(), myComboBox.isEnabled());
icon.paintIcon(this, g2, 0, 0);
}
@Override
public Dimension getPreferredSize() {
return JBUI.size(DEFAULT_ICON.getIconWidth(), DEFAULT_ICON.getIconHeight());
}
};
button.setBorder(BorderFactory.createEmptyBorder());
button.setOpaque(false);
return button;
}
示例11: createCenterPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
protected JComponent createCenterPanel() {
JTextArea licenseTextArea = new JTextArea(myText, 20, 50);
licenseTextArea.getCaret().setDot(0);
licenseTextArea.setFont(myFont);
licenseTextArea.setLineWrap(true);
licenseTextArea.setWrapStyleWord(true);
licenseTextArea.setEditable(false);
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(licenseTextArea);
JPanel agreePanel = new JPanel(new GridLayout(1, 1));
agreePanel.setBorder(JBUI.Borders.empty(10, 5, 5, 5));
myAcceptCheckBox = new JCheckBox(myBundle.getString("license.agreement.accept.checkbox"));
myAcceptCheckBox.setMnemonic(myAcceptCheckBox.getText().charAt(0));
myAcceptCheckBox.setFont(myFont);
agreePanel.add(myAcceptCheckBox);
myAcceptCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
getOKAction().setEnabled(myAcceptCheckBox.isSelected());
}
});
return JBUI.Panels.simplePanel()
.addToCenter(scrollPane)
.addToBottom(agreePanel);
}
示例12: minimumLayoutSize
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@Override
public Dimension minimumLayoutSize(Container container) {
Dimension dimension = JBUI.emptySize();
for(int i = 0; i < container.getComponentCount(); i++){
Component component = container.getComponent(i);
if (!component.isVisible()) continue;
Dimension dimension1 = component.getMinimumSize();
dimension.width = Math.max(dimension.width, dimension1.width);
if (i > 0){
dimension.height += vGap;
}
dimension.height += dimension1.height;
}
addInsets(dimension, container);
return dimension;
}
示例13: createNorthPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
@Override
protected JComponent createNorthPanel() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints gc = new GridBagConstraints();
gc.gridx = 0;
gc.gridy = 0;
gc.weightx = 0;
gc.insets = new Insets(5, 0, 5, 5);
panel.add(new JLabel(ApplicationBundle.message("label.name")), gc);
gc = new GridBagConstraints();
gc.gridx = 1;
gc.gridy = 0;
gc.weightx = 1;
gc.fill = GridBagConstraints.HORIZONTAL;
gc.gridwidth = 2;
gc.insets = new Insets(0, 0, 5, 0);
panel.add(mySchemeName, gc);
panel.setPreferredSize(JBUI.size(220, 40));
return panel;
}
示例14: paintProgress
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
private void paintProgress(Graphics g) {
final Color color = getProgressColor();
if (color == null) return;
if (!mySplashIsVisible) {
myImage.paintIcon(this, g, 0, 0);
mySplashIsVisible = true;
}
int totalWidth = myImage.getIconWidth() - getProgressX();
if (Registry.is("ide.new.about")) {
totalWidth +=3;
}
final int progressWidth = (int)(totalWidth * myProgress);
final int width = progressWidth - myProgressLastPosition;
g.setColor(color);
g.fillRect(getProgressX(), getProgressY(), width, getProgressHeight());
if (myProgressTail != null) {
myProgressTail.paintIcon(this, g, (int)(width - (myProgressTail.getIconWidth() / JBUI.scale(1f) / 2f * JBUI.scale(1f))),
(int)(getProgressY() - (myProgressTail.getIconHeight() - getProgressHeight()) / JBUI.scale(1f) / 2f * JBUI.scale(1f))); //I'll buy you a beer if you understand this line without playing with it
}
myProgressLastPosition = progressWidth;
}
示例15: NewRecentProjectPanel
import com.intellij.util.ui.JBUI; //导入依赖的package包/类
public NewRecentProjectPanel(Disposable parentDisposable) {
super(parentDisposable);
setBorder(null);
setBackground(FlatWelcomeFrame.getProjectsBackground());
JScrollPane scrollPane = UIUtil.findComponentOfType(this, JScrollPane.class);
if (scrollPane != null) {
scrollPane.setBackground(FlatWelcomeFrame.getProjectsBackground());
final int width = 300;
final int height = 460;
scrollPane.setSize(JBUI.size(width, height));
scrollPane.setMinimumSize(JBUI.size(width, height));
scrollPane.setPreferredSize(JBUI.size(width, height));
}
ListWithFilter panel = UIUtil.findComponentOfType(this, ListWithFilter.class);
if (panel != null) {
panel.setBackground(FlatWelcomeFrame.getProjectsBackground());
}
}