@Override public void controlResized(ControlEvent e) { inputCmd.setFocus(); } });
private boolean execCmd(String cmd) { if (cmd.trim().length() == 0) { inputCmd.setFocus(); return false; } Command command = getCommand(cmd); command.execute(); if(command instanceof DataCommand) dataCmds.add((DataCommand) command); return !command.canContinue(); }
public void dragOver( DropTargetEvent e ) { styledText.setFocus(); Point location = xParent.getDisplay().map( null, styledText, e.x, e.y ); location.x = Math.max( 0, location.x ); location.y = Math.max( 0, location.y ); try { int offset = styledText.getOffsetAtLocation( new Point( location.x, location.y ) ); styledText.setCaretOffset( offset ); } catch ( IllegalArgumentException ex ) { int maxOffset = styledText.getCharCount(); Point maxLocation = styledText.getLocationAtOffset( maxOffset ); if ( location.y >= maxLocation.y ) { if ( location.x >= maxLocation.x ) { styledText.setCaretOffset( maxOffset ); } else { int offset = styledText.getOffsetAtLocation( new Point( location.x, maxLocation.y ) ); styledText.setCaretOffset( offset ); } } else { styledText.setCaretOffset( maxOffset ); } } }
public void execute(){ long start, end; start = System.currentTimeMillis(); try { result = console.getSession().execute(cmd); } catch (IOException e1) { throw new RuntimeException(e1.getLocalizedMessage(),e1); } end = System.currentTimeMillis(); console.getInputCmd().setFocus(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS", Locale.getDefault()); String time = df.format(new Date()); printKeyValue(console.getCmdResult(), RedisClient.i18nFile.getText(I18nFile.COMMAND) + ": ", cmd); printKeyValue(console.getCmdResult(), RedisClient.i18nFile.getText(I18nFile.TIME) + ": ", time); printKeyValue(console.getCmdResult(), RedisClient.i18nFile.getText(I18nFile.DURATION) + "(ms): ", String.valueOf(end-start)); if(printResult()) printKeyValue(console.getCmdResult(), RedisClient.i18nFile.getText(I18nFile.RESULT) + ":\r\n", result.getResult()); console.getCmdResult().append(console.getCmdResult().getLineDelimiter()); }
inputCmd.setFocus();
@Override public boolean setFocus(){ if (fSourceViewer != null){ fSourceViewer.getTextWidget().setFocus(); return true; } return false; }
@Override public void handleEvent(Event event) { if (event.keyCode != SWT.ESC) return; if (!isBreadcrumbEvent(event)) return; fTextViewer.getTextWidget().setFocus(); } };
@Override public void widgetSelected(SelectionEvent e) { searchText.setText(""); searchText.setFocus(); } });
@Override public void setFocus() { fShell.forceFocus(); fText.setFocus(); }
@Override public void setFocus() { StyledText styledText = getTextWidget(); if (styledText != null) { styledText.setFocus(); } }
/** * */ public boolean setFocus() { return getTextWidget().setFocus(); }
@Override public void run() { fJavaEditor.getViewer().getTextWidget().setFocus(); } }
@Override public void widgetSelected(SelectionEvent e) { fPatternEditor.getTextWidget().setFocus(); fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); }
@Override public void widgetSelected(SelectionEvent e) { fPatternEditor.getTextWidget().setFocus(); fPatternEditor.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS); }
@Override public void setFocus() { if (fSourceViewer != null && fSourceViewer.getTextWidget() != null) fSourceViewer.getTextWidget().setFocus(); }
protected XtextEditor openEditor(String string) throws Exception { int cursor = string.indexOf('|'); String fileExtension = getFileExtension(); IFile file = createFile("foo/myfile" + files.size() + "." + fileExtension, string.replace("|", "")); files.add(file); XtextEditor editor = openEditor(file); editor.getInternalSourceViewer().setSelectedRange(cursor, 0); editor.getInternalSourceViewer().getTextWidget().setFocus(); return editor; }
@Override public void setFocus() { fSourceViewer.getTextWidget().setFocus(); updateSelection(fSourceViewer.getSelection()); }
@Override public void setFocus() { fSourceViewer.getTextWidget().setFocus(); updateSelection(fSourceViewer.getSelection()); }
protected XtextEditor openEditor(String content) throws Exception { int cursor = content.indexOf('|'); String fileExtension = getFileExtension(); IFile file = createFile("foo/myfile" + files.size() + "." + fileExtension, content.replace("|", "")); files.add(file); XtextEditor editor = openEditor(file); editor.getInternalSourceViewer().setSelectedRange(cursor, 0); editor.getInternalSourceViewer().getTextWidget().setFocus(); return editor; }
public void setVisible(boolean visible) { super.setVisible(visible); String pattern = getPatternValue(); getFlags(); value.setText(pattern); updateMatchStatus(); testString.setFocus(); }