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

Java FieldPanel类代码示例

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

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



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

示例1: createAdditionalJavadocTagsPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public FieldPanel createAdditionalJavadocTagsPanel(){
  FieldPanel additionalTagsPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.label.text"), InspectionsBundle.message("inspection.javadoc.dialog.title"), null, null);
  additionalTagsPanel.setPreferredSize(new Dimension(150, additionalTagsPanel.getPreferredSize().height));
  additionalTagsPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      final Document document = e.getDocument();
      try {
        final String text = document.getText(0, document.getLength());
        if (text != null) {
          myAdditionalJavadocTags = text.trim();
        }
      }
      catch (BadLocationException e1) {
         LOG.error(e1);
      }
    }
  });
  additionalTagsPanel.setText(myAdditionalJavadocTags);
  return additionalTagsPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:JavaDocLocalInspection.java


示例2: createUIComponents

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
private void createUIComponents() {
  myLanguageLevelCombo = new LanguageLevelCombo(JavaCoreBundle.message("default.language.level.description")) {
    @Override
    protected LanguageLevel getDefaultLevel() {
      Sdk sdk = myProjectJdkConfigurable.getSelectedProjectJdk();
      if (sdk == null) return null;
      JavaSdkVersion version = JavaSdk.getInstance().getVersion(sdk);
      return version == null ? null : version.getMaxLanguageLevel();
    }
  };
  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ProjectConfigurable.java


示例3: createOptionsPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@Override
@Nullable
public JComponent createOptionsPanel() {
  JPanel panel = new JPanel(new BorderLayout());
  FieldPanel additionalAttributesPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.html.not.required.label.text"),
                                                        InspectionsBundle.message("inspection.javadoc.html.not.required.dialog.title"),
                                                        null, null);

  panel.add(additionalAttributesPanel, BorderLayout.NORTH);
  additionalAttributesPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      final Document document = e.getDocument();
      try {
        final String text = document.getText(0, document.getLength());
        if (text != null) {
          myAdditionalRequiredHtmlAttributes = text.trim();
        }
      }
      catch (BadLocationException e1) {
        LOG.error(e1);
      }
    }
  });
  additionalAttributesPanel.setText(myAdditionalRequiredHtmlAttributes);
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:RequiredAttributesInspection.java


示例4: GroovyRunConfigurationEditor

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public GroovyRunConfigurationEditor() {

    scriptPathField = new JTextField();
    final BrowseFilesListener scriptBrowseListener = new BrowseFilesListener(scriptPathField,
        "Script Path",
        "Specify path to script",
        new FileChooserDescriptor(true, false, false, false, false, false) {
          @Override
          public boolean isFileSelectable(VirtualFile file) {
            return file.getFileType() == GroovyFileType.GROOVY_FILE_TYPE;
          }
        });
    final FieldPanel scriptFieldPanel = new FieldPanel(scriptPathField, null, null, scriptBrowseListener, null);
    scriptPathPanel.setLayout(new BorderLayout());
    scriptPathPanel.add(scriptFieldPanel, BorderLayout.CENTER);

    workDirField = new JTextField();
    final BrowseFilesListener workDirBrowseFilesListener = new BrowseFilesListener(workDirField,
        "Working directory",
        "Specify working directory",
        BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR);
    final FieldPanel workDirFieldPanel = new FieldPanel(workDirField, null, null, workDirBrowseFilesListener, null);
    workDirPanel.setLayout(new BorderLayout());
    workDirPanel.add(workDirFieldPanel, BorderLayout.CENTER);

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


示例5: createUIComponents

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
private void createUIComponents() {
  myLanguageLevelCombo = new LanguageLevelCombo();
  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ProjectConfigurable.java


示例6: createOptionsPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@Override
@Nullable
public JComponent createOptionsPanel() {
  JPanel panel = new JPanel(new BorderLayout());
  FieldPanel additionalAttributesPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.html.not.required.label.text"),
                                                        InspectionsBundle.message("inspection.javadoc.html.not.required.dialog.title"),
                                                        null, null);

  panel.add(additionalAttributesPanel, BorderLayout.NORTH);
  additionalAttributesPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      final Document document = e.getDocument();
      try {
        final String text = document.getText(0, document.getLength());
        if (text != null) {
          myAdditionalRequiredHtmlAttributes = text.trim();
        }
      }
      catch (BadLocationException e1) {
        RequiredAttributesInspection.LOG.error(e1);
      }
    }
  });
  additionalAttributesPanel.setText(myAdditionalRequiredHtmlAttributes);
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:RequiredAttributesInspection.java


示例7: createOptionsPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@Override
@Nullable
public JComponent createOptionsPanel()
{
	JPanel panel = new JPanel(new BorderLayout());
	FieldPanel additionalAttributesPanel = new FieldPanel(InspectionsBundle.message("inspection.javadoc.html.not.required.label.text"), InspectionsBundle.message("inspection.javadoc.html.not" +
			".required.dialog.title"), null, null);

	panel.add(additionalAttributesPanel, BorderLayout.NORTH);
	additionalAttributesPanel.getTextField().getDocument().addDocumentListener(new DocumentAdapter()
	{
		@Override
		protected void textChanged(DocumentEvent e)
		{
			final Document document = e.getDocument();
			try
			{
				final String text = document.getText(0, document.getLength());
				if(text != null)
				{
					myAdditionalRequiredHtmlAttributes = text.trim();
				}
			}
			catch(BadLocationException e1)
			{
				LOG.error(e1);
			}
		}
	});
	additionalAttributesPanel.setText(myAdditionalRequiredHtmlAttributes);
	return panel;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:33,代码来源:RequiredAttributesInspection.java


示例8: getFieldPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public FieldPanel getFieldPanel() {
    return fieldPanel;
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:4,代码来源:ApplicationConfigForm.java


示例9: createComponentForEmptyRootCase

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
private JComponent createComponentForEmptyRootCase() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final String text = IdeBundle.message("prompt.please.specify.java.sources.directory");

  final JLabel label = new JLabel(text);
  label.setUI(new MultiLineLabelUI());
  panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myRbCreateSource = new JRadioButton(IdeBundle.message("radio.create.source.directory"), true);
  panel.add(myRbCreateSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myTfSourceDirectoryName = new JTextField(suggestSourceDirectoryName());
  final JLabel srcPathLabel = new JLabel(IdeBundle.message("prompt.enter.relative.path.to.module.content.root", File.separator));
  panel.add(srcPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 0), 0, 0));
  final FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  chooserDescriptor.withTreeRootVisible(true);
  final FieldPanel fieldPanel = createFieldPanel(myTfSourceDirectoryName, null, new BrowsePathListener(myTfSourceDirectoryName, chooserDescriptor));
  panel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 10), 0, 0));

  myRbNoSource = new JRadioButton(IdeBundle.message("radio.do.not.create.source.directory"), true);
  panel.add(myRbNoSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  final JLabel fullPathLabel = new JLabel(IdeBundle.message("label.source.directory"));
  panel.add(fullPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myTfFullPath = new JTextField();
  myTfFullPath.setEditable(false);
  myTfFullPath.setOpaque(false);
  final Insets borderInsets = myTfFullPath.getBorder().getBorderInsets(myTfFullPath);
  myTfFullPath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
  panel.add(myTfFullPath, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 8, 10), 0, 0));

  ButtonGroup group = new ButtonGroup();
  group.add(myRbCreateSource);
  group.add(myRbNoSource);
  myTfSourceDirectoryName.getDocument().addDocumentListener(new DocumentAdapter() {
    public void textChanged(DocumentEvent event) {
      updateFullPathField();
    }
  });

  myRbCreateSource.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
      final boolean enabled = e.getStateChange() == ItemEvent.SELECTED;
      srcPathLabel.setEnabled(enabled);
      fieldPanel.setEnabled(enabled);
      fullPathLabel.setVisible(enabled);
      myTfFullPath.setVisible(enabled);
      if (enabled) {
        myTfSourceDirectoryName.requestFocus();
      }
    }
  });
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:SourcePathsStep.java


示例10: NamePathComponent

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public NamePathComponent(String nameLabelText,
                         String pathLabelText,
                         final String pathChooserTitle,
                         final String pathChooserDescription,
                         boolean hideIgnored,
                         boolean bold) {
  super(new GridBagLayout());

  myTfName = new JTextField();
  myTfName.setDocument(new NameFieldDocument());
  myTfName.setPreferredSize(new Dimension(200, myTfName.getPreferredSize().height));

  myTfPath = new JTextField();
  myTfPath.setDocument(new PathFieldDocument());
  myTfPath.setPreferredSize(new Dimension(200, myTfPath.getPreferredSize().height));

  myNameLabel = new JLabel(nameLabelText);
  if (bold) myNameLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  myNameLabel.setLabelFor(myTfName);
  Insets insets = new Insets(0, 0, 5, 4);
  this.add(myNameLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                               insets, 0, 0));

  insets = new Insets(0, 0, 5, 0);
  this.add(myTfName, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                            insets, 0, 0));
  // todo: review texts
  final FileChooserDescriptor chooserDescriptor = (FileChooserDescriptor)BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR.clone();
  chooserDescriptor.setHideIgnored(hideIgnored);
  final BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(myTfPath, pathChooserTitle, pathChooserDescription, chooserDescriptor) {
    public void actionPerformed(ActionEvent e) {
      super.actionPerformed(e);
      myIsPathChangedByUser = true;
    }
  };
  myPathPanel = new FieldPanel(myTfPath, null, null, browseButtonActionListener, null);
  myPathLabel = new JLabel(pathLabelText);
  myPathLabel.setLabelFor(myTfPath);
  if (bold) myPathLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  insets = new Insets(0, 0, 5, 4);
  this.add(myPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                                 insets, 0, 0));
  insets = new Insets(0, 0, 5, 0);
  this.add(myPathPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                               insets, 0, 0));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:47,代码来源:NamePathComponent.java


示例11: getPathPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@NotNull
public FieldPanel getPathPanel() {
  return myPathPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:NamePathComponent.java


示例12: createFieldPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public static FieldPanel createFieldPanel(final JTextField field, final String labelText, final BrowseFilesListener browseButtonActionListener) {
  final FieldPanel fieldPanel = new FieldPanel(field, labelText, null, browseButtonActionListener, null);
  fieldPanel.getFieldLabel().setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  return fieldPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ModuleWizardStep.java


示例13: getComponent

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@NotNull
public JComponent getComponent() {
    final JPanel panel = new JPanel(new GridBagLayout());

    final JLabel label = new JLabel("Please specify module sources directory.");

    panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));
    myRbCreateSource = new JRadioButton("Create source directory", myBuilder.isShouldCreateSourcesDir());
    panel.add(myRbCreateSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

    myTfSourceDirectoryName = new JTextField(myBuilder.getRelativeSourcesPath());
    final JLabel srcPathLabel = new JLabel("Enter relative path to module content root:");
    panel.add(srcPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 0), 0, 0));
    final FileChooserDescriptor chooserDescriptor = new FileChooserDescriptor(false, true, false, false, false, false);
    chooserDescriptor.setIsTreeRootVisible(true);
    final FieldPanel fieldPanel = createFieldPanel(myTfSourceDirectoryName, null, new BrowsePathListener(myTfSourceDirectoryName, chooserDescriptor));
    panel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 10), 0, 0));

    myRbNoSource = new JRadioButton("Do not create source directory", !myBuilder.isShouldCreateSourcesDir());
    panel.add(myRbNoSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

    final JLabel fullPathLabel = new JLabel("The following directory will be marked as a source directory:");
    panel.add(fullPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

    myTfFullPath = new JTextField();
    myTfFullPath.setEditable(false);
    final Insets borderInsets = myTfFullPath.getBorder().getBorderInsets(myTfFullPath);
    myTfFullPath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
    panel.add(myTfFullPath, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 8, 10), 0, 0));

    ButtonGroup group = new ButtonGroup();
    group.add(myRbCreateSource);
    group.add(myRbNoSource);
    myTfSourceDirectoryName.getDocument().addDocumentListener(new DocumentAdapter() {
        public void textChanged(DocumentEvent event) {
            updateFullPathField();
        }
    });
    updateFullPathField();

    final StateUpdater stateUpdater = new StateUpdater() {
        public void updateState(final boolean shouldCreateSourcesDir) {
            srcPathLabel.setEnabled(shouldCreateSourcesDir);
            fieldPanel.setEnabled(shouldCreateSourcesDir);
            fullPathLabel.setVisible(shouldCreateSourcesDir);
            myTfFullPath.setVisible(shouldCreateSourcesDir);
            if (shouldCreateSourcesDir) {
                myTfSourceDirectoryName.requestFocus();
            }
        }
    };

    myRbCreateSource.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
            stateUpdater.updateState(e.getStateChange() == ItemEvent.SELECTED);
        }
    });
    stateUpdater.updateState(myBuilder.isShouldCreateSourcesDir());

    return panel;
}
 
开发者ID:traff,项目名称:intellij-ocaml,代码行数:62,代码来源:OCamlSourcesPathStep.java


示例14: createComponentForEmptyRootCase

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
private JComponent createComponentForEmptyRootCase() {
  final JPanel panel = new JPanel(new GridBagLayout());
  final String text = IdeBundle.message("prompt.please.specify.java.sources.directory");

  final JLabel label = new JLabel(text);
  label.setUI(new MultiLineLabelUI());
  panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myRbCreateSource = new JRadioButton(IdeBundle.message("radio.create.source.directory"), true);
  panel.add(myRbCreateSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myTfSourceDirectoryName = new JTextField(suggestSourceDirectoryName());
  final JLabel srcPathLabel = new JLabel(IdeBundle.message("prompt.enter.relative.path.to.module.content.root", File.separator));
  panel.add(srcPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 0), 0, 0));
  final FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  chooserDescriptor.setIsTreeRootVisible(true);
  final FieldPanel fieldPanel = createFieldPanel(myTfSourceDirectoryName, null, new BrowsePathListener(myTfSourceDirectoryName, chooserDescriptor));
  panel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 30, 0, 10), 0, 0));

  myRbNoSource = new JRadioButton(IdeBundle.message("radio.do.not.create.source.directory"), true);
  panel.add(myRbNoSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  final JLabel fullPathLabel = new JLabel(IdeBundle.message("label.source.directory"));
  panel.add(fullPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0));

  myTfFullPath = new JTextField();
  myTfFullPath.setEditable(false);
  myTfFullPath.setOpaque(false);
  final Insets borderInsets = myTfFullPath.getBorder().getBorderInsets(myTfFullPath);
  myTfFullPath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
  panel.add(myTfFullPath, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 8, 10), 0, 0));

  ButtonGroup group = new ButtonGroup();
  group.add(myRbCreateSource);
  group.add(myRbNoSource);
  myTfSourceDirectoryName.getDocument().addDocumentListener(new DocumentAdapter() {
    public void textChanged(DocumentEvent event) {
      updateFullPathField();
    }
  });

  myRbCreateSource.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
      final boolean enabled = e.getStateChange() == ItemEvent.SELECTED;
      srcPathLabel.setEnabled(enabled);
      fieldPanel.setEnabled(enabled);
      fullPathLabel.setVisible(enabled);
      myTfFullPath.setVisible(enabled);
      if (enabled) {
        myTfSourceDirectoryName.requestFocus();
      }
    }
  });
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:56,代码来源:SourcePathsStep.java


示例15: NameLocationStep

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public NameLocationStep(WizardContext wizardContext, JavaModuleBuilder builder,
                        ModulesProvider modulesProvider,
                        Icon icon,
                        @NonNls String helpId) {
  myWizardContext = wizardContext;
  myBuilder = builder;
  myModulesProvider = modulesProvider;
  myIcon = icon;
  myHelpId = helpId;
  myPanel = new JPanel(new GridBagLayout());
  myPanel.setBorder(BorderFactory.createEtchedBorder());

  final String text = IdeBundle.message("prompt.please.specify.module.name.and.content.root");
  final JLabel textLabel = new JLabel(text);
  textLabel.setUI(new MultiLineLabelUI());
  myPanel.add(textLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 8, 10), 0, 0));

  myNamePathComponent = new NamePathComponent(IdeBundle.message("label.module.name"), IdeBundle.message("label.module.content.root"), 'M', 'r',
                                              IdeBundle.message("title.select.module.content.root"), "");
  //if (ModuleType.J2EE_APPLICATION.equals(moduleType)) {
  //  myNamePathComponent.setPathComponentVisible(false);
  //}

  myPanel.add(myNamePathComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 0, 10), 0, 0));

  final JLabel label = new JLabel(IdeBundle.message("label.module.file.will.be.saved.in"));
  myPanel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(30, 10, 0, 10), 0, 0));

  myTfModuleFilePath = new JTextField();
  myTfModuleFilePath.setEditable(false);
  final Insets borderInsets = myTfModuleFilePath.getBorder().getBorderInsets(myTfModuleFilePath);
  myTfModuleFilePath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
  final FieldPanel fieldPanel = createFieldPanel(myTfModuleFilePath, null, null);
  myPanel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 10, 0), 0, 0));

  JButton browseButton = new JButton(IdeBundle.message("button.change.directory"));
  browseButton.addActionListener(new BrowseModuleFileDirectoryListener(myTfModuleFilePath));
  myPanel.add(browseButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 10, 10), 0, 0));

  final DocumentListener documentListener = new DocumentAdapter() {
    protected void textChanged(DocumentEvent e) {
      updateModuleFilePathField();
    }
  };
  myNamePathComponent.getNameComponent().getDocument().addDocumentListener(documentListener);
  myNamePathComponent.getPathComponent().getDocument().addDocumentListener(documentListener);
  myNamePathComponent.getPathComponent().getDocument().addDocumentListener(new DocumentAdapter() {
    public void textChanged(DocumentEvent event) {
      myWizardContext.requestWizardButtonsUpdate();
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:53,代码来源:NameLocationStep.java


示例16: init

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
private void init() {
  myPanel = new JPanel(new VerticalFlowLayout(true, false));

  final JPanel namePanel = new JPanel(new BorderLayout());
  final JLabel label = new JLabel("<html><body><b>Project name:</b></body></html>", SwingConstants.LEFT);
  namePanel.add(label, BorderLayout.NORTH);

  myProjectName = new JTextField();
  myProjectName.setColumns(40);

  final JPanel nameFieldPanel = new JPanel();
  nameFieldPanel.setLayout(new BoxLayout(nameFieldPanel, BoxLayout.X_AXIS));
  nameFieldPanel.add(Box.createHorizontalStrut(4));
  nameFieldPanel.add(myProjectName);

  namePanel.add(nameFieldPanel, BorderLayout.CENTER);
  final JPanel wrapper = new JPanel(new FlowLayout(FlowLayout.LEFT));
  wrapper.add(namePanel);
  wrapper.setAlignmentX(0);
  myPanel.add(wrapper);

  myPanel.add(new JLabel(ProjectBundle.message("project.compiler.output")));

  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);

  myProjectCompilerOutput.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      if (myFreeze) return;
      myModulesConfigurator.processModuleCompilerOutputChanged(getCompilerOutputUrl());
    }
  });

  myPanel.add(myProjectCompilerOutput);
  myPanel.add(ScrollPaneFactory.createScrollPane(myErrorsComponent, true));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:43,代码来源:ProjectConfigurable.java


示例17: NamePathComponent

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
public NamePathComponent(String nameLabelText,
                         String pathLabelText,
                         final String pathChooserTitle,
                         final String pathChooserDescription,
                         boolean hideIgnored,
                         boolean bold) {
  super(new GridBagLayout());

  myTfName = new JTextField();
  myTfName.setDocument(new NameFieldDocument());
  myTfName.setPreferredSize(new Dimension(200, myTfName.getPreferredSize().height));

  myTfPath = new JTextField();
  myTfPath.setDocument(new PathFieldDocument());
  myTfPath.setPreferredSize(new Dimension(200, myTfPath.getPreferredSize().height));

  myNameLabel = new JLabel(nameLabelText);
  if (bold) myNameLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  myNameLabel.setLabelFor(myTfName);
  Insets insets = new Insets(0, 0, 5, 4);
  this.add(myNameLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                               insets, 0, 0));

  insets = new Insets(0, 0, 5, 0);
  this.add(myTfName, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                            insets, 0, 0));
  // todo: review texts
  final FileChooserDescriptor chooserDescriptor = (FileChooserDescriptor)BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR.clone();
  chooserDescriptor.setHideIgnored(hideIgnored);
  final BrowseFilesListener browseButtonActionListener = new BrowseFilesListener(myTfPath, pathChooserTitle, pathChooserDescription, chooserDescriptor) {
    @Override
    public void actionPerformed(ActionEvent e) {
      super.actionPerformed(e);
      myIsPathChangedByUser = true;
    }
  };
  myPathPanel = new FieldPanel(myTfPath, null, null, browseButtonActionListener, null);
  myPathLabel = new JLabel(pathLabelText);
  myPathLabel.setLabelFor(myTfPath);
  if (bold) myPathLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD));
  insets = new Insets(0, 0, 5, 4);
  this.add(myPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE,
                                                 insets, 0, 0));
  insets = new Insets(0, 0, 5, 0);
  this.add(myPathPanel, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
                                               insets, 0, 0));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:48,代码来源:NamePathComponent.java


示例18: getPathPanel

import com.intellij.ui.FieldPanel; //导入依赖的package包/类
@Nonnull
public FieldPanel getPathPanel() {
  return myPathPanel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:NamePathComponent.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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