Java Code Examples for com.intellij.util.ui.UIUtil#mergeComponentsWithAnchor()

The following examples show how to use com.intellij.util.ui.UIUtil#mergeComponentsWithAnchor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RunConfigurationJavaTab.java    From intellij-xquery with Apache License 2.0 5 votes vote down vote up
public RunConfigurationJavaTab(final Project project) {
    moduleSelector = new ConfigurationModuleSelector(project, moduleSelectorComponent.getComponent());
    commonJavaParametersPanel.setModuleContext(moduleSelector.getModule());
    moduleSelectorComponent.getComponent().addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            commonJavaParametersPanel.setModuleContext(moduleSelector.getModule());
        }
    });

    anchor = UIUtil.mergeComponentsWithAnchor(commonJavaParametersPanel, alternativeJrePanel,
            moduleSelectorComponent);
}
 
Example 2
Source File: CodeStyleBlankLinesPanel.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void init() {
  super.init();

  JPanel optionsPanel = new JPanel(new GridBagLayout());

  Map<CodeStyleSettingPresentation.SettingsGroup, List<CodeStyleSettingPresentation>> settings = CodeStyleSettingPresentation.getStandardSettings(getSettingsType());

  OptionGroup keepBlankLinesOptionsGroup = createOptionsGroup(BLANK_LINES_KEEP, settings.get(new CodeStyleSettingPresentation.SettingsGroup(BLANK_LINES_KEEP)));
  OptionGroup blankLinesOptionsGroup = createOptionsGroup(BLANK_LINES, settings.get(new CodeStyleSettingPresentation.SettingsGroup(BLANK_LINES)));
  if (keepBlankLinesOptionsGroup != null) {
    keepBlankLinesOptionsGroup.setAnchor(keepBlankLinesOptionsGroup.findAnchor());
    optionsPanel.add(keepBlankLinesOptionsGroup.createPanel(), new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
  }
  if (blankLinesOptionsGroup != null) {
    blankLinesOptionsGroup.setAnchor(blankLinesOptionsGroup.findAnchor());
    optionsPanel.add(blankLinesOptionsGroup.createPanel(), new GridBagConstraints(0, 1, 1, 1, 1, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
  }
  UIUtil.mergeComponentsWithAnchor(keepBlankLinesOptionsGroup, blankLinesOptionsGroup);

  optionsPanel.add(new JPanel(), new GridBagConstraints(0, 2, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));

  optionsPanel.setBorder(JBUI.Borders.empty(0, 10));
  JScrollPane scroll = ScrollPaneFactory.createScrollPane(optionsPanel, true);
  scroll.setMinimumSize(new Dimension(optionsPanel.getPreferredSize().width + scroll.getVerticalScrollBar().getPreferredSize().width + 5, -1));
  scroll.setPreferredSize(scroll.getMinimumSize());

  myPanel.add(scroll, new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));

  final JPanel previewPanel = createPreviewPanel();
  myPanel.add(previewPanel, new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.NORTH, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));

  installPreviewPanel(previewPanel);
  addPanelToWatch(myPanel);

  myIsFirstUpdate = false;
}
 
Example 3
Source File: BashConfigForm.java    From BashSupport with Apache License 2.0 4 votes vote down vote up
@Override
protected void setupAnchor() {
    super.setupAnchor();
    myAnchor = UIUtil.mergeComponentsWithAnchor(this, projectInterpreterLabeled, interpreterParametersComponent, interpreterPathComponent, scriptNameComponent);
}
 
Example 4
Source File: RunConfigurationMainTab.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
public RunConfigurationMainTab(final Project project) {
    this.project = project;
    anchor = UIUtil.mergeComponentsWithAnchor(moduleSelectionPanel, contextItemPanel, variablesPanel, dataSourcePanel);
}
 
Example 5
Source File: CommonJavaParametersPanel.java    From intellij-xquery with Apache License 2.0 4 votes vote down vote up
@Override
protected void setupAnchor() {
    super.setupAnchor();
    myAnchor = UIUtil.mergeComponentsWithAnchor(this, myVMParametersComponent);
}
 
Example 6
Source File: CommonProgramParametersPanel.java    From consulo with Apache License 2.0 4 votes vote down vote up
protected void setupAnchor() {
  myAnchor = UIUtil.mergeComponentsWithAnchor(myProgramParametersComponent, myWorkingDirectoryComponent, myEnvVariablesComponent);
}