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


Java EnvironmentVariablesComponent.setLabelLocation方法代码示例

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


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

示例1: initComponents

import com.intellij.execution.configuration.EnvironmentVariablesComponent; //导入方法依赖的package包/类
protected void initComponents() {
  myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(),
                                                         ExecutionBundle.message("run.configuration.program.parameters"));

  FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  //noinspection DialogTitleCapitalization
  fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
  myWorkingDirectoryComboBox = new MacroComboBoxWithBrowseButton(fileChooserDescriptor, getProject());

  myWorkingDirectoryComponent = LabeledComponent.create(myWorkingDirectoryComboBox, ExecutionBundle.message("run.configuration.working.directory.label"));
  myEnvVariablesComponent = new EnvironmentVariablesComponent();

  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
  myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);

  addComponents();

  setPreferredSize(new Dimension(10, 10));

  copyDialogCaption(myProgramParametersComponent);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:CommonProgramParametersPanel.java

示例2: initComponents

import com.intellij.execution.configuration.EnvironmentVariablesComponent; //导入方法依赖的package包/类
protected void initComponents() {
  myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(),
                                                         ExecutionBundle.message("run.configuration.program.parameters"));

  FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  //noinspection DialogTitleCapitalization
  fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
  myWorkingDirectoryField = new TextFieldWithBrowseButton();
  myWorkingDirectoryField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(fileChooserDescriptor, getProject()) {
    @Override
    public void actionPerformed(ActionEvent e) {
      myFileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
      setProject(getProject());
      super.actionPerformed(e);
    }
  });

  myWorkingDirectoryComponent = LabeledComponent.create(createComponentWithMacroBrowse(myWorkingDirectoryField), ExecutionBundle.message("run.configuration.working.directory.label"));
  myEnvVariablesComponent = new EnvironmentVariablesComponent();

  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
  myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);

  addComponents();

  setPreferredSize(new Dimension(10, 10));

  setAnchor(myEnvVariablesComponent.getLabel());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:31,代码来源:CommonProgramParametersPanel.java

示例3: createComponent

import com.intellij.execution.configuration.EnvironmentVariablesComponent; //导入方法依赖的package包/类
public JComponent createComponent() {
  JPanel panel = new JPanel(new GridBagLayout());

  GridBagConstraints c = new GridBagConstraints();
  c.fill = GridBagConstraints.HORIZONTAL;
  c.anchor = GridBagConstraints.WEST;
  c.insets.bottom = 5;

  myRunInBackgroundCheckbox = new JCheckBox("Run in background");
  myRunInBackgroundCheckbox.setMnemonic('b');
  if (!myRunConfigurationMode) {
    c.gridx = 0;
    c.gridy++;
    c.weightx = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;

    panel.add(myRunInBackgroundCheckbox, c);
  }
  c.gridwidth = 1;

  JLabel labelVMParameters = new JLabel("VM Options:");
  labelVMParameters.setDisplayedMnemonic('v');
  labelVMParameters.setLabelFor(myVMParametersEditor = new RawCommandLineEditor());
  myVMParametersEditor.setDialogCaption(labelVMParameters.getText());

  c.gridx = 0;
  c.gridy++;
  c.weightx = 0;
  panel.add(labelVMParameters, c);

  c.gridx = 1;
  c.weightx = 1;
  c.insets.left = 10;
  panel.add(myVMParametersEditor, c);
  c.insets.left = 0;

  JLabel jdkLabel = new JLabel("JRE:");
  jdkLabel.setDisplayedMnemonic('j');
  jdkLabel.setLabelFor(myJdkCombo = new ExternalSystemJdkComboBox(myProject));
  c.gridx = 0;
  c.gridy++;
  c.weightx = 0;
  panel.add(jdkLabel, c);
  c.gridx = 1;
  c.weightx = 1;
  c.fill = GridBagConstraints.NONE;
  c.insets.left = 10;
  panel.add(myJdkCombo, c);
  c.insets.left = 0;
  c.fill = GridBagConstraints.HORIZONTAL;

  myEnvVariablesComponent = new EnvironmentVariablesComponent();
  myEnvVariablesComponent.setPassParentEnvs(true);
  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  c.gridx = 0;
  c.gridy++;
  c.weightx = 1;
  c.gridwidth = 2;
  panel.add(myEnvVariablesComponent, c);
  c.gridwidth = 1;

  JPanel propertiesPanel = new JPanel(new BorderLayout());
  propertiesPanel.setBorder(IdeBorderFactory.createTitledBorder("Properties", false));

  propertiesPanel.add(mySkipTestsCheckBox = new JCheckBox("Skip tests"), BorderLayout.NORTH);
  mySkipTestsCheckBox.setMnemonic('t');

  collectProperties();
  propertiesPanel.add(myPropertiesPanel = new MavenPropertiesPanel(myProperties), BorderLayout.CENTER);
  myPropertiesPanel.getEmptyText().setText("No properties defined");

  c.gridx = 0;
  c.gridy++;
  c.weightx = c.weighty = 1;
  c.gridwidth = c.gridheight = GridBagConstraints.REMAINDER;
  c.fill = GridBagConstraints.BOTH;
  panel.add(propertiesPanel, c);

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

示例4: initComponents

import com.intellij.execution.configuration.EnvironmentVariablesComponent; //导入方法依赖的package包/类
protected void initComponents() {
  myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(),
                                                         ExecutionBundle.message("run.configuration.program.parameters"));

  final JPanel panel = new JPanel(new BorderLayout());
  myWorkingDirectoryField = new TextFieldWithBrowseButton(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
      fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
      fileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
      Project project = myModuleContext != null ? myModuleContext.getProject() : null;
      VirtualFile file = FileChooser.chooseFile(fileChooserDescriptor, myWorkingDirectoryComponent, project, null);
      if (file != null) {
        setWorkingDirectory(file.getPresentableUrl());
      }
    }
  }) {
    @Override
    protected void installPathCompletion(FileChooserDescriptor fileChooserDescriptor) {
      super.installPathCompletion(FileChooserDescriptorFactory.createSingleFolderDescriptor());
    }
  };
  panel.add(myWorkingDirectoryField, BorderLayout.CENTER);

  final FixedSizeButton button = new FixedSizeButton(myWorkingDirectoryField);
  button.setIcon(AllIcons.RunConfigurations.Variables);
  button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final List<String> macros = new ArrayList<String>(PathMacros.getInstance().getUserMacroNames());
      if (myHaveModuleContext) macros.add("MODULE_DIR");

      final JList list = new JBList(ArrayUtil.toStringArray(macros));
      final JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list).setItemChoosenCallback(new Runnable() {
        @Override
        public void run() {
          final Object value = list.getSelectedValue();
          if (value instanceof String) {
            setWorkingDirectory("$" + value + "$");
          }
        }
      }).setMovable(false).setResizable(false).createPopup();
      popup.showUnderneathOf(button);
    }
  });
  panel.add(button, BorderLayout.EAST);

  myWorkingDirectoryComponent = LabeledComponent.create(panel, ExecutionBundle.message("run.configuration.working.directory.label"));
  myEnvVariablesComponent = new EnvironmentVariablesComponent();

  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
  myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);

  addComponents();

  setPreferredSize(new Dimension(10, 10));

  setAnchor(myEnvVariablesComponent.getLabel());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:62,代码来源:CommonProgramParametersPanel.java


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