public String getSelectionText() { return styledText.getSelectionText(); }
private void setSearchText() { if ( this.text != null && !Utils.isEmpty( this.text.getSelectionText() ) ) { searchText.setText( this.text.getSelectionText() ); } searchText.setFocus(); }
private void setSearchText() { if ( this.text != null && !Utils.isEmpty( this.text.getSelectionText() ) ) { searchText.setText( this.text.getSelectionText() ); } searchText.setFocus(); }
public void copyLogSelectedText( StyledText text ) { toClipboard( text.getSelectionText() ); }
private void execSelect() { clearData(); String[] cmds = inputCmd.getSelectionText().split( inputCmd.getLineDelimiter()); for (String cmd : cmds) { if (execCmd(cmd)) break; } }
public void widgetSelected( SelectionEvent event ) { String selection = text.getSelectionText(); if ( !Utils.isEmpty( selection ) ) { GUIResource.getInstance().toClipboard( selection ); } } } );
@Override public void mouseDown(MouseEvent e) { text = cmdResult; menu.getItem(0).setEnabled(false); menu.getItem(2).setEnabled(false); if(cmdResult.getSelectionText().length() > 0){ menu.getItem(1).setEnabled(true); }else{ menu.getItem(1).setEnabled(false); } cmdResult.setMenu(menu); } });
if ( text.getSelectionText() != null ) { String tt = text.getSelectionText(); if ( tt.indexOf( '\n' ) < 0 ) { searchText.setText( text.getSelectionText() );
if ( text.getSelectionText() != null ) { searchText.setText( text.getSelectionText() ); replaceText.setFocus();
@Override public void mouseDown(MouseEvent e) { text = inputCmd; final Clipboard cb = new Clipboard(tabFolder.getShell().getDisplay()); TextTransfer transfer = TextTransfer.getInstance(); String data = (String) cb.getContents(transfer); if(data != null) menu.getItem(2).setEnabled(true); else menu.getItem(2).setEnabled(false); if(inputCmd.getSelectionText().length() > 0){ menu.getItem(0).setEnabled(true); menu.getItem(1).setEnabled(true); }else{ menu.getItem(0).setEnabled(false); menu.getItem(1).setEnabled(false); } inputCmd.setMenu(menu); } });
@Override public void widgetSelected(SelectionEvent e) { copyAction.setEnabled(fNoSourceTextWidget.getSelectionText().length() > 0); } @Override
@Override public void widgetSelected(SelectionEvent e) { copyAction.setEnabled(fNoSourceTextWidget.getSelectionText().length() > 0); } @Override
@Override public void dragSetData(DragSourceEvent event) { if (TextTransfer.getInstance().isSupportedType(event.dataType)) { event.data = text.getSelectionText(); } }
public ISelection getSelection() { if (fControl instanceof StyledText) { IDocument document= new Document(((StyledText)fControl).getSelectionText()); return new TextSelection(document, 0, document.getLength()); } else { // FIXME: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63022 return StructuredSelection.EMPTY; } }
@Override public void widgetSelected(SelectionEvent e) { if (text.getSelectionText().length() == 0) { if (copyAction != null && !copyAction.isDisposed()) { copyAction.setEnabled(false); } } else { if (copyAction != null && !copyAction.isDisposed()) { copyAction.setEnabled(true); } } }
@Override public ISelection getSelection() { if (fControl instanceof StyledText) { IDocument document= new Document(((StyledText)fControl).getSelectionText()); return new TextSelection(document, 0, document.getLength()); } else { // FIXME: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63022 return StructuredSelection.EMPTY; } }
@Override public ISelection getSelection() { if (fControl instanceof StyledText) { IDocument document= new Document(((StyledText)fControl).getSelectionText()); return new TextSelection(document, 0, document.getLength()); } else { // FIXME: see https://bugs.eclipse.org/bugs/show_bug.cgi?id=63022 return StructuredSelection.EMPTY; } }
@Override public void dragStart(DragSourceEvent event) { fTextDragAndDropToken= null; try { fSelection= st.getSelection(); event.doit= isLocationSelected(new Point(event.x, event.y)); ISelection selection= selectionProvider.getSelection(); if (selection instanceof ITextSelection) fSelectedText= ((ITextSelection)selection).getText(); else // fallback to widget fSelectedText= st.getSelectionText(); } catch (IllegalArgumentException ex) { event.doit= false; } }
public void mouseUp(MouseEvent e) { if (commitLink.getSelectionText().length() != 0) return; try { getShell().dispose(); CommitEditor.open(new RepositoryCommit(revision .getRepository(), revision.getCommit())); } catch (PartInitException pie) { Activator.logError(pie.getLocalizedMessage(), pie); } } });
private void copyToClipboard() { Clipboard clipboard = null; try { clipboard = new Clipboard(text.getDisplay()); clipboard.setContents(new Object[] { text.getSelectionText() }, new Transfer[] { TextTransfer.getInstance() }); } finally { if (clipboard != null) { clipboard.dispose(); } } }