use of org.jetbrains.plugins.groovy.refactoring.extract.GrParameterTablePanel in project intellij-community by JetBrains.
the class GroovyExtractMethodDialog method createUIComponents.
private void createUIComponents() {
mySignature = new GrMethodSignatureComponent("", myProject);
mySignature.setPreferredSize(JBUI.size(500, 100));
mySignature.setMinimumSize(JBUI.size(500, 100));
mySignature.setBorder(IdeBorderFactory.createTitledBorder(GroovyRefactoringBundle.message("signature.preview.border.title"), false));
mySignature.setFocusable(false);
myNameField = new EditorTextField("", myProject, GroovyFileType.GROOVY_FILE_TYPE);
myVisibilityPanel = new GroovyComboboxVisibilityPanel();
String visibility = GroovyApplicationSettings.getInstance().EXTRACT_METHOD_VISIBILITY;
if (visibility == null) {
visibility = PsiModifier.PRIVATE;
}
myVisibilityPanel.setVisibility(visibility);
myVisibilityPanel.addListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
myHelper.setVisibility(myVisibilityPanel.getVisibility());
updateSignature();
}
});
myParameterTablePanel = new GrParameterTablePanel() {
@Override
protected void updateSignature() {
GroovyExtractMethodDialog.this.updateSignature();
}
@Override
protected void doEnterAction() {
GroovyExtractMethodDialog.this.clickDefaultButton();
}
@Override
protected void doCancelAction() {
GroovyExtractMethodDialog.this.doCancelAction();
}
};
}
use of org.jetbrains.plugins.groovy.refactoring.extract.GrParameterTablePanel in project intellij-community by JetBrains.
the class GrIntroduceParameterDialog method createSignaturePanel.
private JPanel createSignaturePanel() {
mySignature = new GrMethodSignatureComponent("", myProject);
myTable = new GrParameterTablePanel() {
@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;
}
Aggregations