本文整理汇总了Java中com.intellij.ide.actions.TemplateKindCombo类的典型用法代码示例。如果您正苦于以下问题:Java TemplateKindCombo类的具体用法?Java TemplateKindCombo怎么用?Java TemplateKindCombo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TemplateKindCombo类属于com.intellij.ide.actions包,在下文中一共展示了TemplateKindCombo类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: CustomCreateFileFromTemplateDialog
import com.intellij.ide.actions.TemplateKindCombo; //导入依赖的package包/类
protected CustomCreateFileFromTemplateDialog(@NotNull Project project) {
super(project, true);
myPanel = new JPanel();
myNameLabel = new JLabel("Name:");
myNameField = new JTextField("");
myUpDownHint = new JLabel();
myKindLabel = new JLabel("Kind:");
myKindCombo = new TemplateKindCombo();
myPanel.setLayout(new GridBagLayout());
myPanel.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
// c.gridwidth = 1;
c.weightx = 0.3;
c.gridx = 0;
c.gridy = 0;
myPanel.add(myNameLabel, c);
c.weightx = 4;
c.gridx = 1;
c.gridy = 0;
myPanel.add(myNameField, c);
c.weightx = 0.3;
c.gridx = 2;
c.gridy = 0;
c.insets = JBUI.insetsLeft(12);
myPanel.add(myUpDownHint, c);
c.insets = JBUI.insets(10, 0);
c.gridx = 0;
c.gridy = 1;
myPanel.add(myKindLabel, c);
c.gridx = 1;
c.gridwidth = 2;
c.gridy = 1;
c.insets = JBUI.insets(10, 0, 10, 12);
myPanel.add(myKindCombo, c);
myKindLabel.setLabelFor(myKindCombo);
myKindCombo.registerUpDownHint(myNameField);
myUpDownHint.setIcon(PlatformIcons.UP_DOWN_ARROWS);
setTemplateKindComponentsVisible(false);
init();
myKindCombo.getComboBox().addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
for (GravConfigurationFileType each : GravFileTypes.CONFIGURATION_FILE_TYPES) {
if (getKindCombo().getSelectedName().equalsIgnoreCase(each.getCorrespondingTemplateFile())) {
disableEnableFields(each.needsFilename());
if (!each.needsFilename()) {
getNameField().setText(each.getDefaultFilename());
} else {
getNameField().setText("");
}
}
}
}
});
}
开发者ID:PioBeat,项目名称:GravSupport,代码行数:66,代码来源:CustomCreateFileFromTemplateDialog.java
示例2: getKindCombo
import com.intellij.ide.actions.TemplateKindCombo; //导入依赖的package包/类
public TemplateKindCombo getKindCombo() {
return myKindCombo;
}
开发者ID:PioBeat,项目名称:GravSupport,代码行数:4,代码来源:CustomCreateFileFromTemplateDialog.java
注:本文中的com.intellij.ide.actions.TemplateKindCombo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论