本文整理汇总了Java中com.intellij.openapi.ui.FixedSizeButton类的典型用法代码示例。如果您正苦于以下问题:Java FixedSizeButton类的具体用法?Java FixedSizeButton怎么用?Java FixedSizeButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FixedSizeButton类属于com.intellij.openapi.ui包,在下文中一共展示了FixedSizeButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addWorkingDirectoryBrowseAction
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
protected void addWorkingDirectoryBrowseAction(final JPanel pane,
FixedSizeButton browseDirectoryButton,
JTextField tfCommandWorkingDirectory) {
browseDirectoryButton.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
PathChooserDialog chooser = FileChooserFactory.getInstance().createPathChooser(descriptor, myProject, pane);
chooser.choose(null, new Consumer<List<VirtualFile>>() {
@Override
public void consume(List<VirtualFile> files) {
VirtualFile file = !files.isEmpty() ? files.get(0) : null;
if (file != null) {
myTfCommandWorkingDirectory.setText(file.getPresentableUrl());
}
}
});
}
}
);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ToolEditorDialog.java
示例2: createCenterPanel
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel(){
loadCombo();
JButton editTemplatesButton = new FixedSizeButton(myCbxTemplates);
JPanel centerPanel = new JPanel(new GridBagLayout());
JLabel selectTemplateLabel = new JLabel(IdeBundle.message("label.name"));
centerPanel.add(selectTemplateLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
centerPanel.add(myCbxTemplates, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 50, 0));
centerPanel.add(editTemplatesButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
editTemplatesButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
onEditTemplates();
}
});
return centerPanel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SelectTemplateDialog.java
示例3: chooseGradleHome
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@NotNull
public ChooseGradleHomeDialogFixture chooseGradleHome(@NotNull File gradleHomePath) {
FixedSizeButton browseButton = robot().finder().findByType(target(), FixedSizeButton.class, true);
robot().click(browseButton);
FileChooserDialogFixture fileChooserDialog = FileChooserDialogFixture.findDialog(robot(), new GenericTypeMatcher<JDialog>(JDialog.class) {
@Override
protected boolean isMatching(@NotNull JDialog dialog) {
Collection<JLabel> descriptionLabels = robot().finder().findAll(dialog, JLabelMatcher.withText("Gradle home:"));
return descriptionLabels.size() == 1;
}
});
VirtualFile toSelect = findFileByIoFile(gradleHomePath, true);
assertNotNull(toSelect);
fileChooserDialog.select(toSelect);
fileChooserDialog.clickOk();
return this;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ChooseGradleHomeDialogFixture.java
示例4: fixButton
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
private void fixButton(final TextFieldWithStoredHistory historyField, ComponentWithBrowseButton<TextFieldWithStoredHistory> control) {
FixedSizeButton button = control.getButton();
control.remove(button);
BorderLayout borderLayout = new BorderLayout();
JPanel buttonPanel = new JPanel(borderLayout);
buttonPanel.setBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0));
buttonPanel.add(button, BorderLayout.CENTER);
control.add(buttonPanel, BorderLayout.EAST);
button.setAttachedComponent(new JComponent() {
public Dimension getPreferredSize() {
Dimension size = historyField.getTextEditor().getPreferredSize();
return new Dimension(-1, size.height + 6);
}
});
}
开发者ID:jflex-de,项目名称:idea-jflex,代码行数:17,代码来源:JFlexSettingsForm.java
示例5: ExportDialogBase
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public ExportDialogBase(Project project, ExporterToTextFile exporter) {
super(project, true);
myProject = project;
myExporter = exporter;
myTfFile = new JTextField();
myFileButton = new FixedSizeButton(myTfFile);
setHorizontalStretch(1.5f);
setTitle(IdeBundle.message("title.export.preview"));
setOKButtonText(IdeBundle.message("button.save"));
setButtonsMargin(null);
init();
try {
myListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) {
initText();
}
};
myExporter.addSettingsChangedListener(myListener);
}
catch (TooManyListenersException e) {
LOG.error(e);
}
initText();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ExportToFileUtil.java
示例6: addWorkingDirectoryBrowseAction
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
protected void addWorkingDirectoryBrowseAction(final JPanel pane,
FixedSizeButton browseDirectoryButton,
JTextField tfCommandWorkingDirectory) {
browseDirectoryButton.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
PathChooserDialog chooser = FileChooserFactory.getInstance().createPathChooser(descriptor, myProject, pane);
chooser.choose(null, new Consumer<List<VirtualFile>>() {
@Override
public void consume(List<VirtualFile> files) {
VirtualFile file = files.size() > 0 ? files.get(0) : null;
if (file != null) {
myTfCommandWorkingDirectory.setText(file.getPresentableUrl());
}
}
});
}
}
);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:ToolEditorDialog.java
示例7: createComponentWithMacroBrowse
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@Deprecated // use MacroComboBoxWithBrowseButton instead
protected JComponent createComponentWithMacroBrowse(@Nonnull final TextFieldWithBrowseButton textAccessor) {
final FixedSizeButton button = new FixedSizeButton(textAccessor);
button.setIcon(AllIcons.RunConfigurations.Variables);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//noinspection unchecked
final JList list = new JBList(myWorkingDirectoryComboBox.getChildComponent().getModel());
JBPopupFactory.getInstance().createListPopupBuilder(list).setItemChoosenCallback(() -> {
final Object value = list.getSelectedValue();
if (value instanceof String) {
textAccessor.setText((String)value);
}
}).setMovable(false).setResizable(false).createPopup().showUnderneathOf(button);
}
});
JPanel panel = new JPanel(new BorderLayout());
panel.add(textAccessor, BorderLayout.CENTER);
panel.add(button, BorderLayout.EAST);
return panel;
}
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:CommonProgramParametersPanel.java
示例8: createCenterPanel
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel(){
loadCombo();
JButton editTemplatesButton = new FixedSizeButton(myCbxTemplates);
JPanel centerPanel = new JPanel(new GridBagLayout());
JLabel selectTemplateLabel = new JLabel(IdeBundle.message("label.name"));
centerPanel.add(selectTemplateLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
centerPanel.add(myCbxTemplates, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 50, 0));
centerPanel.add(editTemplatesButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
editTemplatesButton.addActionListener(e -> onEditTemplates());
return centerPanel;
}
开发者ID:consulo,项目名称:consulo,代码行数:18,代码来源:SelectTemplateDialog.java
示例9: getLanguageSettingsComponent
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@Nullable
@Override
public LabeledComponent<JComponent> getLanguageSettingsComponent(@NotNull Course selectedCourse) {
myModel = ProjectStructureConfigurable.getInstance(ProjectManager.getInstance().getDefaultProject()).getProjectJdksModel();
myJdkComboBox = new JdkComboBox(myModel, sdkTypeId -> sdkTypeId instanceof JavaSdkType && !((JavaSdkType)sdkTypeId).isDependent(), sdk -> true, sdkTypeId -> sdkTypeId instanceof JavaSdkType && !((JavaSdkType)sdkTypeId).isDependent(), true);
ComboboxWithBrowseButton comboboxWithBrowseButton = new ComboboxWithBrowseButton(myJdkComboBox);
FixedSizeButton setupButton = comboboxWithBrowseButton.getButton();
myJdkComboBox.setSetupButton(setupButton, null, myModel, (JdkComboBox.JdkComboBoxItem) myJdkComboBox.getModel().getSelectedItem(), null, false);
return LabeledComponent.create(comboboxWithBrowseButton, "Jdk", BorderLayout.WEST);
}
开发者ID:medvector,项目名称:educational-plugin,代码行数:11,代码来源:EduIntellijCourseProjectGeneratorBase.java
示例10: ConfigurationArgumentsHelpArea
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public ConfigurationArgumentsHelpArea() {
super(new BorderLayout());
add(myPanel);
setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 0, 0));
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new MyCopyAction());
myHelpArea.addMouseListener(
new PopupHandler(){
@Override
public void invokePopup(final Component comp,final int x,final int y){
ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group).getComponent().show(comp, x, y);
}
}
);
FixedSizeButton copyButton = new FixedSizeButton(22);
copyButton.setIcon(PlatformIcons.COPY_ICON);
copyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final StringSelection contents = new StringSelection(myHelpArea.getText().trim());
CopyPasteManager.getInstance().setContents(contents);
}
});
myToolbarPanel.add(copyButton, BorderLayout.NORTH);
myToolbarPanel.setVisible(false);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ConfigurationArgumentsHelpArea.java
示例11: constructFieldWithBrowseButton
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
private static JPanel constructFieldWithBrowseButton(final JComponent aComponent, final ActionListener aActionListener, int delta) {
JPanel result = new JPanel(new GridBagLayout());
result.add(aComponent, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0,0));
FixedSizeButton browseButton = new FixedSizeButton(aComponent.getPreferredSize().height - delta);//ignore border in case of browse button
TextFieldWithBrowseButton.MyDoClickAction.addTo(browseButton, aComponent);
result.add(browseButton, new GridBagConstraints(1, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 0,0));
browseButton.addActionListener(aActionListener);
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:GuiUtils.java
示例12: createComponent
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public void createComponent() {
removeAll();
setLayout(new GridBagLayout());
if (myLabelText != null) {
myLabel = new JLabel(myLabelText);
this.add(myLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
myLabel.setLabelFor(myComponent);
}
this.add(myComponent, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
if (myBrowseButtonActionListener != null) {
FixedSizeButton browseButton = new FixedSizeButton(getComponent());
myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(browseButton);
browseButton.setFocusable(false);
browseButton.addActionListener(myBrowseButtonActionListener);
myButtons.add(browseButton);
this.add(browseButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 0, 0), 0, 0));
}
if (myViewerDialogTitle != null) {
final FixedSizeButton showViewerButton = new FixedSizeButton(getComponent());
if (myBrowseButtonActionListener == null) {
LOG.assertTrue(myDoClickAction == null);
myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(showViewerButton);
}
showViewerButton.setFocusable(false);
showViewerButton.setIcon(PlatformIcons.OPEN_EDIT_DIALOG_ICON);
showViewerButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Viewer viewer = new Viewer();
viewer.setTitle(myViewerDialogTitle);
viewer.show();
}
});
myButtons.add(showViewerButton);
this.add(showViewerButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:AbstractFieldPanel.java
示例13: MyPathAndProjectButtonPanel
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public MyPathAndProjectButtonPanel(@NotNull EditorTextField textField,
@NotNull FixedSizeButton registeredProjectsButton)
{
super(new GridBagLayout());
myTextField = textField;
myRegisteredProjectsButton = registeredProjectsButton;
add(myTextField, new GridBag().weightx(1).fillCellHorizontally());
add(myRegisteredProjectsButton, new GridBag().insets(0, 3, 0, 0));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ExternalProjectPathField.java
示例14: MyComponent
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public MyComponent() {
super(new GridBagLayout());
myTextField = new JTextField();
myButton = new FixedSizeButton(myTextField);
add(myTextField, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
add(myButton, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:TableCellEditorWithButton.java
示例15: createUIComponents
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
private void createUIComponents() {
myColorSample = new SimpleColoredComponent();
mySamplePanel = new JPanel(new BorderLayout());
mySamplePanel.setBorder(BorderFactory.createEtchedBorder());
mySamplePanel.add(BorderLayout.CENTER, myColorSample);
myChooseColorButton = new FixedSizeButton(mySamplePanel);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ValueMarkerPresentationDialogBase.java
示例16: createComponentWithMacroBrowse
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
protected JComponent createComponentWithMacroBrowse(@NotNull final TextFieldWithBrowseButton textAccessor) {
final FixedSizeButton button = new FixedSizeButton(textAccessor);
button.setIcon(AllIcons.RunConfigurations.Variables);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
List<String> macros = new SmartList<String>(PathMacros.getInstance().getUserMacroNames());
if (myModuleContext != null || myHasModuleMacro) {
macros.add(PathMacroUtil.MODULE_DIR_MACRO_NAME);
}
final JList list = new JBList(ArrayUtil.toStringArray(macros));
JBPopupFactory.getInstance().createListPopupBuilder(list).setItemChoosenCallback(new Runnable() {
@Override
public void run() {
final Object value = list.getSelectedValue();
if (value instanceof String) {
textAccessor.setText('$' + ((String)value) + '$');
}
}
}).setMovable(false).setResizable(false).createPopup().showUnderneathOf(button);
}
});
JPanel panel = new JPanel(new BorderLayout());
panel.add(textAccessor, BorderLayout.CENTER);
panel.add(button, BorderLayout.EAST);
return panel;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:CommonProgramParametersPanel.java
示例17: addCommandBrowseAction
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
protected void addCommandBrowseAction(final JPanel pane, FixedSizeButton browseCommandButton, JTextField tfCommand) {
browseCommandButton.addActionListener(
new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFileOrExecutableAppDescriptor();
PathChooserDialog chooser = FileChooserFactory.getInstance().createPathChooser(descriptor, myProject, pane);
chooser.choose(null, new Consumer<List<VirtualFile>>() {
@Override
public void consume(List<VirtualFile> files) {
VirtualFile file = !files.isEmpty() ? files.get(0) : null;
if (file != null) {
myTfCommand.setText(file.getPresentableUrl());
String workingDirectory = myTfCommandWorkingDirectory.getText();
if (workingDirectory == null || workingDirectory.isEmpty()) {
VirtualFile parent = file.getParent();
if (parent != null && parent.isDirectory()) {
myTfCommandWorkingDirectory.setText(parent.getPresentableUrl());
}
}
}
}
});
}
}
);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:ToolEditorDialog.java
示例18: init
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
@Override
protected void init() {
setTitle(myTitle);
myTfUrl = new JTextField();
myTfPath = new JTextField();
myBtnBrowseLocalPath = new FixedSizeButton(myTfPath);
super.init();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:EditLocationDialog.java
示例19: PropertyValueCellEditor
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
public PropertyValueCellEditor() {
myComponent = new CellEditorComponentWithBrowseButton<JTextField>(new TextFieldWithBrowseButton(), this);
getChildComponent().setBorder(BorderFactory.createLineBorder(Color.black));
FixedSizeButton button = myComponent.getComponentWithButton().getButton();
button.setIcon(IconUtil.getAddIcon());
button.setToolTipText(AntBundle.message("ant.property.value.editor.insert.macro.tooltip.text"));
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
MacrosDialog dialog = new MacrosDialog(getChildComponent());
if (dialog.showAndGet() && dialog.getSelectedMacro() != null) {
JTextField textField = getChildComponent();
String macro = dialog.getSelectedMacro().getName();
int position = textField.getCaretPosition();
try {
textField.getDocument().insertString(position, "$" + macro + "$", null);
textField.setCaretPosition(position + macro.length() + 2);
}
catch (BadLocationException ex) {
LOG.error(ex);
}
textField.requestFocus();
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:AntUIUtil.java
示例20: createUIComponents
import com.intellij.openapi.ui.FixedSizeButton; //导入依赖的package包/类
private void createUIComponents() {
projectNameLabel = new HyperlinkLabelWithStateAccess();
projectNameLabel.setHyperlinkText(
GctBundle.getString("cloud.project.selector.no.selected.project"));
projectNameLabel.addHyperlinkListener(
(event) -> {
if (event.getEventType() == EventType.ACTIVATED) {
handleOpenProjectSelectionDialog();
}
});
projectAccountSeparatorLabel = new JBLabel("/");
projectAccountSeparatorLabel.setVisible(false /* only visible when project is selected. */);
accountInfoLabel = new HyperlinkLabelWithStateAccess();
accountInfoLabel.addHyperlinkListener(
(event) -> {
if (event.getEventType() == EventType.ACTIVATED) {
handleOpenProjectSelectionDialog();
}
});
hyperlinksPanel = new JPanel();
hyperlinksPanel.setBorder(UIManager.getBorder("TextField.border"));
hyperlinksPanel.setLayout(new BoxLayout(hyperlinksPanel, BoxLayout.X_AXIS));
browseButton = new FixedSizeButton(hyperlinksPanel);
browseButton.addActionListener((actionEvent) -> handleOpenProjectSelectionDialog());
browseButton.setFocusable(true);
browseButton.setToolTipText(GctBundle.getString("cloud.project.selector.open.dialog.tooltip"));
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:32,代码来源:ProjectSelector.java
注:本文中的com.intellij.openapi.ui.FixedSizeButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论