Search in sources :

Example 1 with GroovyComboboxVisibilityPanel

use of org.jetbrains.plugins.groovy.refactoring.ui.GroovyComboboxVisibilityPanel 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();
        }
    };
}
Also used : GrMethodSignatureComponent(org.jetbrains.plugins.groovy.refactoring.ui.GrMethodSignatureComponent) ChangeEvent(javax.swing.event.ChangeEvent) GrParameterTablePanel(org.jetbrains.plugins.groovy.refactoring.extract.GrParameterTablePanel) EditorTextField(com.intellij.ui.EditorTextField) ChangeListener(javax.swing.event.ChangeListener) GroovyComboboxVisibilityPanel(org.jetbrains.plugins.groovy.refactoring.ui.GroovyComboboxVisibilityPanel)

Aggregations

EditorTextField (com.intellij.ui.EditorTextField)1 ChangeEvent (javax.swing.event.ChangeEvent)1 ChangeListener (javax.swing.event.ChangeListener)1 GrParameterTablePanel (org.jetbrains.plugins.groovy.refactoring.extract.GrParameterTablePanel)1 GrMethodSignatureComponent (org.jetbrains.plugins.groovy.refactoring.ui.GrMethodSignatureComponent)1 GroovyComboboxVisibilityPanel (org.jetbrains.plugins.groovy.refactoring.ui.GroovyComboboxVisibilityPanel)1