For IntelliJ IDEA,
Android Studio or Eclipse



private void myMethod () {}
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes String newname = text.getText(); if ( renameDirectory( repdir, name, newname ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void widgetSelected(SelectionEvent e) { if (currentText) { imageType.setEnabled(true); textType.setEnabled(false); if (text != null && !text.isDisposed()) { text.setVisible(false); text.dispose(); } label = new Label(grpValue, SWT.NONE); label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); label.setAlignment(SWT.CENTER); tranformImage(imageType, label); currentText = false; } } });
public void handleEvent(final Event e) { switch (e.type) { case SWT.FocusOut: item.setText(column, text.getText()); text.dispose(); break; case SWT.Traverse: switch (e.detail) { case SWT.TRAVERSE_RETURN: item.setText(column, text.getText()); // FALL THROUGH case SWT.TRAVERSE_ESCAPE: text.dispose(); e.doit = false; } break; } } };
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { if ( ti.getText().equals( name ) ) { // Only if the name wasn't changed already. String newname = text.getText(); if ( renameDatabase( name, newname ) ) { ti.setText( newname ); } text.dispose(); } } } } );
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { String newname = text.getText(); if ( renameJob( name, repdir, newname ) ) { ti.setText( newname ); } text.dispose(); } } } );
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes String newname = text.getText(); if ( renameJob( fname, newname, frepdir ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { String newname = text.getText(); if ( renameUser( name, newname ) ) { ti.setText( newname ); } text.dispose(); } } } );
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes String newname = text.getText(); if ( renameUser( name, newname ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { String newname = text.getText(); if ( renameDirectory( repdir, name, newname ) ) { ti.setText( newname ); } text.dispose(); } } } );
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes. String newname = text.getText(); if ( renameTransformation( fname, newname, frepdir ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes String newname = text.getText(); if ( renameJob( name, repdir, newname ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { String newname = text.getText(); if ( renameJob( fname, newname, frepdir ) ) { ti.setText( newname ); } text.dispose(); } } } );
@Override public void focusLost( FocusEvent arg0 ) { // Focus is lost: apply changes String newname = text.getText(); if ( renameDatabase( name, newname ) ) { ti.setText( newname ); } text.dispose(); } } );
@Override public void keyPressed( KeyEvent e ) { // ESC --> Don't change tree item... if ( e.keyCode == SWT.ESC ) { text.dispose(); } // ENTER --> Save changes... if ( e.character == SWT.CR ) { String newname = text.getText(); if ( renameTransformation( fname, newname, frepdir ) ) { ti.setText( newname ); } text.dispose(); } } } );