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

Java EnumComboBoxModel类代码示例

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

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



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

示例1: getTableCellEditorComponent

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
  if (value instanceof ListWithSelection) {
    ListWithSelection options = (ListWithSelection)value;
    //noinspection unchecked
    comboBox.setModel(new ListComboBoxModel(options));

    if (options.getSelection() == null) {
      options.selectFirst();
    }
    comboBox.setSelectedItem(options.getSelection());
  }
  else {
    Enum enumValue = (Enum)value;
    Class enumClass = enumValue.getDeclaringClass();
    //noinspection unchecked
    ComboBoxModel model = comboBox.getModel();
    if (!(model instanceof EnumComboBoxModel && model.getSize() > 0 && ((Enum)model.getElementAt(0)).getDeclaringClass() == enumClass)) {
      //noinspection unchecked
      comboBox.setModel(new EnumComboBoxModel(enumClass));
    }
    comboBox.setSelectedItem(value);
  }

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


示例2: createUIComponents

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
private void createUIComponents() {
  myProtectedBranchesButton = new TextFieldWithBrowseButton.NoPathCompletion(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      Messages.showTextAreaDialog(myProtectedBranchesButton.getTextField(), "Protected Branches", "Git.Force.Push.Protected.Branches",
                                  ParametersListUtil.COLON_LINE_PARSER, ParametersListUtil.COLON_LINE_JOINER);
    }
  });
  myProtectedBranchesButton.setButtonIcon(AllIcons.Actions.ShowViewer);
  myUpdateMethodComboBox = new ComboBox(new EnumComboBoxModel<UpdateMethod>(UpdateMethod.class));
  myUpdateMethodComboBox.setRenderer(new ListCellRendererWrapper<UpdateMethod>() {
    @Override
    public void customize(JList list, UpdateMethod value, int index, boolean selected, boolean hasFocus) {
      setText(StringUtil.capitalize(StringUtil.toLowerCase(value.name().replace('_', ' '))));
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:GitVcsPanel.java


示例3: fillData

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public void fillData() {
    fillDatasourceList();

    sqlmapSuffixTextField.setText(configuration.sqlMapSuffix);

    sqlMapPackageName.setText(configuration.sqlMapPackage);
    sqlMapPackageName.setEnabled(false);

    beanPackageTextField.setText(configuration.beanPackage);
    beanPackageTextField.setEnabled(false);

    beanTemplate.setText(configuration.beanTemplate);
    sqlMapTemplate.setText(configuration.sqlMapTemplate);
    selectKeyType.setModel(new EnumComboBoxModel<SelectKeyType>(SelectKeyType.class));
    selectKeyType.setSelectedItem(configuration.selectKeyType);
    selectKeyTemplate.setText(configuration.selectKeyTemplate);
    selectKeyTemplate.setEnabled(configuration.selectKeyType != SelectKeyType.none);

    insertTemplate.setText(configuration.insertTemplate);
    selectTemplate.setText(configuration.selectTemplate);
    updateTemplate.setText(configuration.updateTemplate);
    deleteTemplate.setText(configuration.deleteTemplate);

    generateDefaultCRUDOperationsCheckBox.setSelected(configuration.generateCrudOperations);
    injectGeneratedSQLMapCheckBox.setSelected(configuration.injectCreatedSqlMap);
}
 
开发者ID:code4craft,项目名称:ibatis-plugin,代码行数:27,代码来源:IbatisConfigurationTab.java


示例4: CleanUnshelvedFilterDialog

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public CleanUnshelvedFilterDialog(@Nullable Project project) {
  super(project);
  setTitle("Clean Unshelved Changelists");
  mySystemUnshelvedButton = new JRadioButton("created automatically", true);
  myUnshelvedWithFilterButton = new JRadioButton("older than one", false);
  myAllUnshelvedButton = new JRadioButton("all", false);
  myTimePeriodComboBox = new ComboBox(new EnumComboBoxModel<>(TimePeriod.class));
  myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected());
  myUnshelvedWithFilterButton.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(ItemEvent e) {
      myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected());
    }
  });
  setOKButtonText("Delete");
  init();
  setResizable(false);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:CleanUnshelvedFilterDialog.java


示例5: createLanguageViews

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
private void createLanguageViews() {
    jlLanguage = new JLabel(Localizer.get("settings.Language"));

    comboLanguages = new ComboBox(new EnumComboBoxModel<>(Language.class));
    if (SaveUtil.reader().getLanguage() != null) {
        comboLanguages.setSelectedItem(SaveUtil.reader().getLanguage());
    }
}
 
开发者ID:CeH9,项目名称:PackageTemplates,代码行数:9,代码来源:SettingsDialog.java


示例6: Settings

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public Settings(Preferences preferences, List<UrlModifier> urlModifiers, Plugin plugin)
{
    this.preferences = preferences;

    $$$setupUI$$$();
    this.hostSelect.setModel(new EnumComboBoxModel<>(RemoteHost.class));
    this.defaultBranchTextField.setText(this.preferences.getDefaultBranch().toString());
    this.customURLPanel.setVisible(this.preferences.getRemoteHost().custom());

    this.applyLabelHelpTextStlye(this.customFileUrlLabel);
    this.applyLabelHelpTextStlye(this.customCommitUrlLabel);
    this.applyLabelHeadingStlye(this.projectSettingsLabel);
    this.applyLabelHeadingStlye(this.customUrlLabel);

    this.hostSelect.addActionListener(e -> {
        RemoteHost host = (((RemoteHost) hostSelect.getSelectedItem()));
        Settings.this.customURLPanel.setVisible((host != null && host.custom()));
    });

    for (UrlModifier modifier : urlModifiers) {
        JBCheckBox checkBox = new JBCheckBox(modifier.name());
        this.urlModifierCheckBoxes.put(modifier, checkBox);
        this.urlModifierCheckBoxPanel.add(checkBox, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    }

    this.pluginDetailsLabel.setText(plugin.toString());
    this.featureRequestLabel.setText(String.format("Submit feature requests and bug reports to %s", plugin.issueTracker()));
    this.applyLabelHelpTextStlye(this.pluginDetailsLabel);
    this.applyLabelHelpTextStlye(this.featureRequestLabel);

}
 
开发者ID:ben-gibson,项目名称:GitLink,代码行数:32,代码来源:Settings.java


示例7: MavenImportingSettingsForm

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public MavenImportingSettingsForm(boolean isImportStep, boolean isCreatingNewProject) {
  mySearchRecursivelyCheckBox.setVisible(isImportStep);
  myProjectFormatLabel.setVisible(isImportStep && isCreatingNewProject);
  myProjectFormatComboBox.setVisible(isImportStep && isCreatingNewProject);

  ActionListener listener = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      updateControls();
    }
  };
  mySeparateModulesDirCheckBox.addActionListener(listener);

  mySeparateModulesDirChooser.addBrowseFolderListener(ProjectBundle.message("maven.import.title.module.dir"), "", null,
                                                      FileChooserDescriptorFactory.createSingleFolderDescriptor());

  myUpdateFoldersOnImportPhaseComboBox.setModel(new DefaultComboBoxModel(MavenImportingSettings.UPDATE_FOLDERS_PHASES));

  myGeneratedSourcesComboBox.setModel(new EnumComboBoxModel<MavenImportingSettings.GeneratedSourcesFolder>(MavenImportingSettings.GeneratedSourcesFolder.class));
  myGeneratedSourcesComboBox.setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
      if (value instanceof MavenImportingSettings.GeneratedSourcesFolder) {
        setText(((MavenImportingSettings.GeneratedSourcesFolder)value).title);
      }
    }
  });

  LabelTextReplacingUtil.replaceText(myPanel);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:MavenImportingSettingsForm.java


示例8: ForceArrangementPanel

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public ForceArrangementPanel() {
  myForceRearrangeComboBox = new JComboBox();
  myForceRearrangeComboBox.setModel(new EnumComboBoxModel<SelectedMode>(SelectedMode.class));
  myForceRearrangeComboBox.setMaximumSize(myForceRearrangeComboBox.getPreferredSize());
  myPanel = createPanel();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ForceArrangementPanel.java


示例9: CreateResourceDirectoryDialog

import com.intellij.ui.EnumComboBoxModel; //导入依赖的package包/类
public CreateResourceDirectoryDialog(@NotNull Project project, @Nullable ResourceFolderType resType,
                                     @Nullable PsiDirectory resDirectory, @Nullable Module module) {
  super(project);
  myResDirectory = resDirectory;
  myResourceTypeComboBox.setModel(new EnumComboBoxModel<ResourceFolderType>(ResourceFolderType.class));
  myResourceTypeComboBox.setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
      if (value instanceof ResourceFolderType) {
        setText(((ResourceFolderType)value).getName());
      }
    }
  });

  myDeviceConfiguratorPanel = new DeviceConfiguratorPanel() {
    @Override
    public void applyEditors() {
      try {
        doApplyEditors();
        final FolderConfiguration config = myDeviceConfiguratorPanel.getConfiguration();
        final ResourceFolderType selectedResourceType = (ResourceFolderType)myResourceTypeComboBox.getSelectedItem();
        myDirectoryNameTextField.setText(selectedResourceType != null ? config.getFolderName(selectedResourceType) : "");
        myErrorLabel.setText("");
      }
      catch (InvalidOptionValueException e) {
        myErrorLabel.setText("<html><body><font color=\"red\">" + e.getMessage() + "</font></body></html>");
        myDirectoryNameTextField.setText("");
      }
      setOKActionEnabled(myDirectoryNameTextField.getText().length() > 0);
    }
  };

  myDeviceConfiguratorWrapper.add(myDeviceConfiguratorPanel, BorderLayout.CENTER);
  myResourceTypeComboBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      myDeviceConfiguratorPanel.applyEditors();
    }
  });

  if (resType != null) {
    myResourceTypeComboBox.setSelectedItem(resType);
    myResourceTypeComboBox.setEnabled(false);
  } else {
    // Select values by default if not otherwise specified
    myResourceTypeComboBox.setSelectedItem(ResourceFolderType.VALUES);
  }

  AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
  CreateResourceActionBase.updateSourceSetCombo(mySourceSetLabel, mySourceSetCombo, facet, myResDirectory);

  myDeviceConfiguratorPanel.updateAll();
  setOKActionEnabled(myDirectoryNameTextField.getText().length() > 0);
  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:CreateResourceDirectoryDialog.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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