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


Java Wrapper.setBorder方法代码示例

本文整理汇总了Java中com.intellij.ui.components.panels.Wrapper.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java Wrapper.setBorder方法的具体用法?Java Wrapper.setBorder怎么用?Java Wrapper.setBorder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.components.panels.Wrapper的用法示例。


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

示例1: MyComponent

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
private MyComponent(JComponent content, BalloonImpl balloon, EmptyBorder shapeBorder) {
  setOpaque(false);
  setLayout(null);
  myBalloon = balloon;

  setFocusCycleRoot(true);
  putClientProperty(Balloon.KEY, BalloonImpl.this);

  myContent = new JPanel(new BorderLayout(2, 2));
  Wrapper contentWrapper = new Wrapper(content);
  if (myTitle != null) {
    myTitleLabel = new JLabel(myTitle, SwingConstants.CENTER);
    myTitleLabel.setForeground(UIManager.getColor("List.background"));
    myTitleLabel.setBorder(new EmptyBorder(0, 4, 0, 4));
    myContent.add(myTitleLabel, BorderLayout.NORTH);
    contentWrapper.setBorder(new EmptyBorder(1, 1, 1, 1));
  }
  myContent.add(contentWrapper, BorderLayout.CENTER);
  myContent.setBorder(shapeBorder);
  myContent.setOpaque(false);

  add(myContent);


}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:BalloonImpl.java

示例2: MyComponent

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
private MyComponent(JComponent content, BalloonImpl balloon, EmptyBorder shapeBorder) {
  setOpaque(false);
  setLayout(null);
  myBalloon = balloon;

  setFocusCycleRoot(true);
  putClientProperty(Balloon.KEY, BalloonImpl.this);

  myContent = new JPanel(new BorderLayout(2, 2));
  Wrapper contentWrapper = new Wrapper(content);
  if (myTitle != null) {
    myTitleLabel = new JLabel(myTitle, CENTER);
    myTitleLabel.setForeground(UIManager.getColor("List.background"));
    myTitleLabel.setBorder(new EmptyBorder(0, 4, 0, 4));
    myContent.add(myTitleLabel, BorderLayout.NORTH);
    contentWrapper.setBorder(new EmptyBorder(1, 1, 1, 1));
  }
  myContent.add(contentWrapper, BorderLayout.CENTER);
  myContent.setBorder(shapeBorder);
  myContent.setOpaque(false);

  add(myContent);


}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:BalloonImpl.java

示例3: FramesPanel

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
public FramesPanel(Project project, DebuggerStateManager stateManager) {
  super(project, stateManager);
  myStateManager = stateManager;

  setLayout(new BorderLayout());

  myThreadsCombo = new ComboBoxWithWidePopup();
  myThreadsCombo.setRenderer(new DebuggerComboBoxRenderer(myThreadsCombo.getRenderer()));
  myThreadsListener = new ThreadsListener();
  myThreadsCombo.addItemListener(myThreadsListener);

  myFramesList = new FramesList(project);
  myFramesListener = new FramesListener();
  myFramesList.addListSelectionListener(myFramesListener);

  myFramesList.addMouseListener(new MouseAdapter() {
    public void mousePressed(final MouseEvent e) {
      int index = myFramesList.locationToIndex(e.getPoint());
      if (index >= 0 && myFramesList.isSelectedIndex(index)) {
        processListValue(myFramesList.getModel().getElementAt(index));
      }
    }
  });

  registerThreadsPopupMenu(myFramesList);

  setBorder(null);

  final ActionToolbar toolbar = createToolbar();
  Wrapper threads = new Wrapper();
  CustomLineBorder border = new CustomLineBorder(CaptionPanel.CNT_ACTIVE_BORDER_COLOR, 0, 0, 1, 0);
  threads.setBorder(border);
  threads.add(toolbar.getComponent(), BorderLayout.EAST);
  threads.add(myThreadsCombo, BorderLayout.CENTER);
  add(threads, BorderLayout.NORTH);
  add(ScrollPaneFactory.createScrollPane(myFramesList), BorderLayout.CENTER);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:38,代码来源:FramesPanel.java

示例4: createActionsToolbar

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
private JComponent createActionsToolbar() {
  DefaultActionGroup toolbarGroup = new DefaultActionGroup();
  toolbarGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.TOOLBAR_ACTION_GROUP));

  DefaultActionGroup mainGroup = new DefaultActionGroup();
  mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_TEXT_FILTER_SETTINGS_ACTION));
  mainGroup.add(new AnSeparator());
  mainGroup.add(myFilterUi.createActionGroup());
  mainGroup.addSeparator();
  if (BekUtil.isBekEnabled()) {
    if (BekUtil.isLinearBekEnabled()) {
      mainGroup.add(new IntelliSortChooserPopupAction());
      // can not register both of the actions in xml file, choosing to register an action for the "outer world"
      // I can of course if linear bek is enabled replace the action on start but why bother
    }
    else {
      mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_INTELLI_SORT_ACTION));
    }
  }
  mainGroup.add(toolbarGroup);
  ActionToolbar toolbar = createActionsToolbar(mainGroup);

  Wrapper textFilter = new Wrapper(myTextFilter);
  textFilter.setVerticalSizeReferent(toolbar.getComponent());
  textFilter.setBorder(JBUI.Borders.emptyLeft(5));

  ActionToolbar settings =
          createActionsToolbar(new DefaultActionGroup(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_QUICK_SETTINGS_ACTION)));
  settings.setReservePlaceAutoPopupIcon(false);
  settings.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);

  JPanel panel = new JPanel(new MigLayout("ins 0, fill", "[left]0[left, fill]push[right]", "center"));
  panel.add(textFilter);
  panel.add(toolbar.getComponent());
  panel.add(settings.getComponent());
  return panel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:MainFrame.java

示例5: MyComponent

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
private MyComponent(JComponent content, BalloonImpl balloon, EmptyBorder shapeBorder) {
  setOpaque(false);
  setLayout(null);
  myBalloon = balloon;

  // When a screen reader is active, TAB/Shift-TAB should allow moving the focus
  // outside the balloon in the event the balloon acquired the focus.
  if (!ScreenReader.isActive()) {
    setFocusCycleRoot(true);
  }
  putClientProperty(Balloon.KEY, BalloonImpl.this);

  myContent = new JPanel(new BorderLayout(2, 2));
  Wrapper contentWrapper = new Wrapper(content);
  if (myTitle != null) {
    myTitleLabel = new JLabel(myTitle, SwingConstants.CENTER);
    myTitleLabel.setForeground(UIManager.getColor("List.background"));
    myTitleLabel.setBorder(new EmptyBorder(0, 4, 0, 4));
    myContent.add(myTitleLabel, BorderLayout.NORTH);
    contentWrapper.setBorder(new EmptyBorder(1, 1, 1, 1));
  }
  myContent.add(contentWrapper, BorderLayout.CENTER);
  myContent.setBorder(shapeBorder);
  myContent.setOpaque(false);

  add(myContent);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:BalloonImpl.java

示例6: InlineProgressIndicator

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
public InlineProgressIndicator(boolean compact, @NotNull TaskInfo processInfo) {
  myCompact = compact;
  myInfo = processInfo;

  myCancelButton = new InplaceButton(new IconButton(processInfo.getCancelTooltipText(),
                                                    AllIcons.Process.Stop,
                                                    AllIcons.Process.StopHovered) {
  }, new ActionListener() {
    public void actionPerformed(final ActionEvent e) {
      cancelRequest();
    }
  }).setFillBg(true);

  myCancelButton.setVisible(myInfo.isCancellable());
  myCancelButton.setOpaque(false);
  myCancelButton.setToolTipText(processInfo.getCancelTooltipText());
  myCancelButton.setFillBg(false);

  myProgress = new JProgressBar(SwingConstants.HORIZONTAL);
  myProgress.putClientProperty("JComponent.sizeVariant", "mini");

  myComponent = new MyComponent(compact, myProcessName);
  if (myCompact) {
    myComponent.setOpaque(false);
    myComponent.setLayout(new BorderLayout(2, 0));
    final JPanel textAndProgress = new JPanel(new BorderLayout());
    textAndProgress.setOpaque(false);
    textAndProgress.add(myText, BorderLayout.CENTER);

    final NonOpaquePanel progressWrapper = new NonOpaquePanel(new GridBagLayout());
    progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
    final GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.weighty = 1;
    c.insets = new Insets(SystemInfo.isMacOSLion ? 1 : 0, 0, 1, myInfo.isCancellable() ? 0 : 4);
    c.fill = GridBagConstraints.HORIZONTAL;
    progressWrapper.add(myProgress, c);

    textAndProgress.add(progressWrapper, BorderLayout.EAST);
    myComponent.add(textAndProgress, BorderLayout.CENTER);
    myComponent.add(myCancelButton, BorderLayout.EAST);
    myComponent.setToolTipText(processInfo.getTitle() + ". " + IdeBundle.message("progress.text.clickToViewProgressWindow"));
  } else {
    myComponent.setLayout(new BorderLayout());
    myProcessName.setText(processInfo.getTitle());
    myComponent.add(myProcessName, BorderLayout.NORTH);
    myProcessName.setForeground(UIUtil.getPanelBackground().brighter().brighter());
    myProcessName.setBorder(new EmptyBorder(2, 2, 2, 2));

    final NonOpaquePanel content = new NonOpaquePanel(new BorderLayout());
    content.setBorder(new EmptyBorder(2, 2, 2, myInfo.isCancellable() ? 2 : 4));
    myComponent.add(content, BorderLayout.CENTER);

    final Wrapper cancelWrapper = new Wrapper(myCancelButton);
    cancelWrapper.setOpaque(false);
    cancelWrapper.setBorder(new EmptyBorder(0, 3, 0, 2));

    content.add(cancelWrapper, BorderLayout.EAST);
    content.add(myText, BorderLayout.NORTH);
    content.add(myProgress, BorderLayout.CENTER);
    content.add(myText2, BorderLayout.SOUTH);

    myComponent.setBorder(new EmptyBorder(2, 2, 2, 2));
  }

  if (!myCompact) {
    myProcessName.recomputeSize();
    myText.recomputeSize();
    myText2.recomputeSize();
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:73,代码来源:InlineProgressIndicator.java

示例7: InlineProgressIndicator

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
public InlineProgressIndicator(boolean compact, TaskInfo processInfo) {
  myCompact = compact;
  myInfo = processInfo;

  myCancelButton = new InplaceButton(new IconButton(processInfo.getCancelTooltipText(),
                                                    AllIcons.Process.Stop,
                                                    AllIcons.Process.StopHovered) {
  }, new ActionListener() {
    public void actionPerformed(final ActionEvent e) {
      cancelRequest();
    }
  }).setFillBg(true);

  myCancelButton.setVisible(myInfo.isCancellable());
  myCancelButton.setOpaque(false);
  myCancelButton.setToolTipText(processInfo.getCancelTooltipText());
  myCancelButton.setFillBg(false);

  myProgress = new MyProgressBar(JProgressBar.HORIZONTAL, compact);

  myComponent = new MyComponent(compact, myProcessName);
  if (myCompact) {
    myComponent.setOpaque(false);
    myComponent.setLayout(new BorderLayout(2, 0));
    final JPanel textAndProgress = new JPanel(new BorderLayout());
    textAndProgress.setOpaque(false);
    textAndProgress.add(myText, BorderLayout.CENTER);

    final NonOpaquePanel progressWrapper = new NonOpaquePanel(new GridBagLayout());
    progressWrapper.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
    final GridBagConstraints c = new GridBagConstraints();
    c.weightx = 1;
    c.weighty = 1;
    c.insets = new Insets(SystemInfo.isMacOSLion ? 1 : 0, 0, 1, myInfo.isCancellable() ? 0 : 4);
    c.fill = GridBagConstraints.HORIZONTAL;
    progressWrapper.add(myProgress, c);

    textAndProgress.add(progressWrapper, BorderLayout.EAST);
    myComponent.add(textAndProgress, BorderLayout.CENTER);
    myComponent.add(myCancelButton, BorderLayout.EAST);
    myComponent.setToolTipText(processInfo.getTitle() + ". " + IdeBundle.message("progress.text.clickToViewProgressWindow"));
    myProgress.setActive(false);
  } else {
    myComponent.setLayout(new BorderLayout());
    myProcessName.setText(processInfo.getTitle());
    myComponent.add(myProcessName, BorderLayout.NORTH);
    myProcessName.setForeground(UIUtil.getPanelBackground().brighter().brighter());
    myProcessName.setBorder(new EmptyBorder(2, 2, 2, 2));
    myProcessName.setDecorate(false);

    final NonOpaquePanel content = new NonOpaquePanel(new BorderLayout());
    content.setBorder(new EmptyBorder(2, 2, 2, myInfo.isCancellable() ? 2 : 4));
    myComponent.add(content, BorderLayout.CENTER);

    final Wrapper cancelWrapper = new Wrapper(myCancelButton);
    cancelWrapper.setOpaque(false);
    cancelWrapper.setBorder(new EmptyBorder(0, 3, 0, 2));

    content.add(cancelWrapper, BorderLayout.EAST);
    content.add(myText, BorderLayout.NORTH);
    content.add(myProgress, BorderLayout.CENTER);
    content.add(myText2, BorderLayout.SOUTH);

    myText.setDecorate(false);
    myText2.setDecorate(false);

    myComponent.setBorder(new EmptyBorder(2, 2, 2, 2));
    myProgress.setActive(false);
  }

  if (!myCompact) {
    myProcessName.recomputeSize();
    myText.recomputeSize();
    myText2.recomputeSize();
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:78,代码来源:InlineProgressIndicator.java

示例8: withBorder

import com.intellij.ui.components.panels.Wrapper; //导入方法依赖的package包/类
private static Wrapper withBorder(InplaceButton button) {
  Wrapper wrapper = new Wrapper(button);
  wrapper.setBorder(JBUI.Borders.empty(0, 3, 0, 2));
  return wrapper;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:6,代码来源:InlineProgressIndicator.java


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