本文整理匯總了Java中com.intellij.util.ui.UIUtil.replaceMnemonicAmpersand方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.replaceMnemonicAmpersand方法的具體用法?Java UIUtil.replaceMnemonicAmpersand怎麽用?Java UIUtil.replaceMnemonicAmpersand使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.util.ui.UIUtil
的用法示例。
在下文中一共展示了UIUtil.replaceMnemonicAmpersand方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addButtonRunnable
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void addButtonRunnable(int index, final Runnable runnable, String text) {
if (getBorder() == null) setBorder(IdeBorderFactory.createBorder(SideBorder.TOP));
final JButton button = new JButton(UIUtil.replaceMnemonicAmpersand(text));
DialogUtil.registerMnemonic(button);
DumbService.getInstance(myProject).makeDumbAware(button, UsageViewImpl.this);
button.setFocusable(false);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
runnable.run();
}
});
add(button, index);
invalidate();
if (getParent() != null) {
getParent().validate();
}
}
示例2: createNamePanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JPanel createNamePanel() {
final GridBag c = new GridBag().setDefaultAnchor(GridBagConstraints.WEST).setDefaultInsets(1, 1, 1, 1);
final JPanel namePanel = new JPanel(new GridBagLayout());
final JLabel typeLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Type:"));
c.nextLine().next().weightx(0).fillCellNone();
namePanel.add(typeLabel, c);
myTypeComboBox = GrTypeComboBox.createTypeComboBoxFromExpression(myExpression, GroovyApplicationSettings.getInstance().INTRODUCE_LOCAL_SELECT_DEF);
c.next().weightx(1).fillCellHorizontally();
namePanel.add(myTypeComboBox, c);
typeLabel.setLabelFor(myTypeComboBox);
final JLabel nameLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Name:"));
c.nextLine().next().weightx(0).fillCellNone();
namePanel.add(nameLabel, c);
myNameField = setUpNameComboBox();
c.next().weightx(1).fillCellHorizontally();
namePanel.add(myNameField, c);
nameLabel.setLabelFor(myNameField);
GrTypeComboBox.registerUpDownHint(myNameField, myTypeComboBox);
return namePanel;
}
示例3: createFieldPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JPanel createFieldPanel() {
myDoNotReplaceRadioButton = new JBRadioButton(UIUtil.replaceMnemonicAmpersand("Do n&ot replace"));
myReplaceFieldsInaccessibleInRadioButton = new JBRadioButton(UIUtil.replaceMnemonicAmpersand("Replace fields &inaccessible in usage context"));
myReplaceAllFieldsRadioButton = new JBRadioButton(UIUtil.replaceMnemonicAmpersand("&Replace all fields"));
myDoNotReplaceRadioButton.setFocusable(false);
myReplaceFieldsInaccessibleInRadioButton.setFocusable(false);
myReplaceAllFieldsRadioButton.setFocusable(false);
final ButtonGroup group = new ButtonGroup();
group.add(myDoNotReplaceRadioButton);
group.add(myReplaceFieldsInaccessibleInRadioButton);
group.add(myReplaceAllFieldsRadioButton);
final JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.add(myDoNotReplaceRadioButton);
panel.add(myReplaceFieldsInaccessibleInRadioButton);
panel.add(myReplaceAllFieldsRadioButton);
panel.setBorder(IdeBorderFactory.createTitledBorder("Replace fields used in expression with their getters", true));
return panel;
}
示例4: createNamePanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JPanel createNamePanel() {
final GridBag c = new GridBag().setDefaultAnchor(GridBagConstraints.WEST).setDefaultInsets(1, 1, 1, 1);
final JPanel namePanel = new JPanel(new GridBagLayout());
final JLabel typeLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Type:"));
c.nextLine().next().weightx(0).fillCellNone();
namePanel.add(typeLabel, c);
myTypeComboBox = createTypeComboBox(GroovyIntroduceParameterUtil.findVar(myInfo), GroovyIntroduceParameterUtil.findExpr(myInfo), findStringPart());
c.next().weightx(1).fillCellHorizontally();
namePanel.add(myTypeComboBox, c);
typeLabel.setLabelFor(myTypeComboBox);
final JLabel nameLabel = new JLabel(UIUtil.replaceMnemonicAmpersand("&Name:"));
c.nextLine().next().weightx(0).fillCellNone();
namePanel.add(nameLabel, c);
myNameSuggestionsField = createNameField(GroovyIntroduceParameterUtil.findVar(myInfo));
c.next().weightx(1).fillCellHorizontally();
namePanel.add(myNameSuggestionsField, c);
nameLabel.setLabelFor(myNameSuggestionsField);
GrTypeComboBox.registerUpDownHint(myNameSuggestionsField, myTypeComboBox);
return namePanel;
}
示例5: ResourceRootPropertiesDialog
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private ResourceRootPropertiesDialog(@NotNull JComponent parentComponent, @NotNull JavaResourceRootProperties properties) {
super(parentComponent, true);
myProperties = properties;
setTitle(ProjectBundle.message("module.paths.edit.properties.title"));
myRelativeOutputPathField = new JTextField();
myIsGeneratedCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("For &generated resources"));
myMainPanel = FormBuilder.createFormBuilder()
.addLabeledComponent("Relative output &path:", myRelativeOutputPathField)
.addComponent(myIsGeneratedCheckBox)
.getPanel();
myRelativeOutputPathField.setText(myProperties.getRelativeOutputPath());
myRelativeOutputPathField.setColumns(25);
myIsGeneratedCheckBox.setSelected(myProperties.isForGeneratedSources());
init();
}
示例6: createActions
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
@Override
protected Action[] createActions() {
Action[] actions = new Action[myOptions.length];
for (int i = 0; i < myOptions.length; i++) {
String option = myOptions[i];
final int exitCode = i;
actions[i] = new AbstractAction(UIUtil.replaceMnemonicAmpersand(option)) {
@Override
public void actionPerformed(ActionEvent e) {
close(exitCode, true);
}
};
if (i == myDefaultOptionIndex) {
actions[i].putValue(DEFAULT_ACTION, Boolean.TRUE);
}
if (i == myFocusedOptionIndex) {
actions[i].putValue(FOCUSED_ACTION, Boolean.TRUE);
}
UIUtil.assignMnemonic(option, actions[i]);
}
return actions;
}
示例7: SourceRootPropertiesDialog
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private SourceRootPropertiesDialog(@NotNull JComponent parentComponent, @NotNull JavaSourceRootProperties properties) {
super(parentComponent, true);
myProperties = properties;
setTitle(ProjectBundle.message("module.paths.edit.properties.title"));
myPackagePrefixField = new JTextField();
myIsGeneratedCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("For &generated sources"));
myMainPanel = FormBuilder.createFormBuilder()
.addLabeledComponent("Package &prefix:", myPackagePrefixField)
.addComponent(myIsGeneratedCheckBox)
.getPanel();
myPackagePrefixField.setText(myProperties.getPackagePrefix());
myPackagePrefixField.setColumns(25);
myIsGeneratedCheckBox.setSelected(myProperties.isForGeneratedSources());
init();
}
示例8: createCBPanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JPanel createCBPanel() {
final JPanel panel = new JPanel(new FlowLayout());
myCbIsFinal = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Declare &final"));
panel.add(myCbIsFinal);
myCbReplaceAllOccurrences = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Replace &all occurrences"));
panel.add(myCbReplaceAllOccurrences);
return panel;
}
示例9: createSignaturePanel
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private JPanel createSignaturePanel() {
mySignature = new GrMethodSignatureComponent("", myProject);
myTable = new ParameterTablePanel() {
@Override
protected void updateSignature() {
GrIntroduceParameterDialog.this.updateSignature();
}
@Override
protected void doEnterAction() {
clickDefaultButton();
}
@Override
protected void doCancelAction() {
GrIntroduceParameterDialog.this.doCancelAction();
}
};
mySignature.setBorder(IdeBorderFactory.createTitledBorder(GroovyRefactoringBundle.message("signature.preview.border.title"), false));
Splitter splitter = new Splitter(true);
splitter.setFirstComponent(myTable);
splitter.setSecondComponent(mySignature);
mySignature.setPreferredSize(JBUI.size(500, 100));
mySignature.setSize(JBUI.size(500, 100));
splitter.setShowDividerIcon(false);
final JPanel panel = new JPanel(new BorderLayout());
panel.add(splitter, BorderLayout.CENTER);
myForceReturnCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Use e&xplicit return statement"));
panel.add(myForceReturnCheckBox, BorderLayout.NORTH);
return panel;
}
示例10: createCheckBoxes
import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void createCheckBoxes(JPanel panel) {
myDeclareFinalCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("Declare &final"));
myDeclareFinalCheckBox.setFocusable(false);
panel.add(myDeclareFinalCheckBox);
myDelegateViaOverloadingMethodCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("De&legate via overloading method"));
myDelegateViaOverloadingMethodCheckBox.setFocusable(false);
panel.add(myDelegateViaOverloadingMethodCheckBox);
for (Object o : toRemoveCBs.keys()) {
final JCheckBox cb = (JCheckBox)o;
cb.setFocusable(false);
panel.add(cb);
}
}