org.eclipse.swt.dnd.Clipboard.dispose()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.eclipse.swt.dnd.Clipboard.dispose()方法的一些代码示例,展示了Clipboard.dispose()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Clipboard.dispose()方法的具体详情如下:
包路径:org.eclipse.swt.dnd.Clipboard
类名称:Clipboard
方法名:dispose

Clipboard.dispose介绍

[英]Disposes of the operating system resources associated with the clipboard. The data will still be available on the system clipboard after the dispose method is called.

NOTE: On some platforms the data will not be available once the application has exited or the display has been disposed.
[中]处置与剪贴板关联的操作系统资源。调用dispose方法后,系统剪贴板上的数据仍然可用。
注意:在某些平台上,一旦应用程序退出或显示器被释放,数据将不可用。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * @return Returns the clipboard.
 */
public Clipboard getNewClipboard() {
 if ( clipboard != null ) {
  clipboard.dispose();
  clipboard = null;
 }
 clipboard = new Clipboard( display );
 return clipboard;
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override
 public void widgetDisposed( DisposeEvent e ) {
  if ( clipboard != null ) {
   clipboard.dispose();
   clipboard = null;
  }
  if ( gridFont != null ) {
   gridFont.dispose();
  }
 }
} );

代码示例来源:origin: pentaho/pentaho-kettle

private void clipSelected() {
 if ( clipboard != null ) {
  clipboard.dispose();
  clipboard = null;
 }
 clipboard = new Clipboard( getDisplay() );
 TextTransfer tran = TextTransfer.getInstance();
 String clip = getSelectedText();
 if ( clip == null ) {
  return;
 }
 clipboard.setContents( new String[]{ clip }, new Transfer[]{ tran } );
}

代码示例来源:origin: pentaho/pentaho-kettle

@Override public void keyPressed( KeyEvent keyEvent ) {
 int state = keyEvent.stateMask, key = keyEvent.keyCode;
 boolean copyContent = state == SWT.CTRL && key == SWT.F6,
   arrowNavigation = ( state == SWT.COMMAND || state == SWT.ALT )
     && ( key == SWT.ARROW_LEFT || key == SWT.ARROW_RIGHT ),
   backslashNavigation = ( state == SWT.SHIFT && key == SWT.BS ),
   reloadContent = state == SWT.CTRL && ( key == SWT.F5 || key == 114 /* r key */ ) || key == SWT.F5,
   zoomContent = state == SWT.CTRL && ( key == SWT.KEYPAD_ADD || key == SWT.KEYPAD_SUBTRACT
     || key == 61 /* + key */ || key == 45 /* - key */ );
 if ( copyContent ) {
  Browser thisBrowser = (Browser) keyEvent.getSource();
  Clipboard clipboard = new Clipboard( thisBrowser.getDisplay() );
  clipboard.setContents( new String[] { lastNavigateURL }, new Transfer[] { TextTransfer.getInstance() } );
  clipboard.dispose();
 } else if ( arrowNavigation || backslashNavigation || reloadContent || zoomContent ) {
  keyEvent.doit = false;
 }
}

代码示例来源:origin: pentaho/pentaho-kettle

clipboard.dispose();
clipboard = null;

代码示例来源:origin: pentaho/pentaho-kettle

e.doit = false;
if ( clipboard != null ) {
 clipboard.dispose();
 clipboard = null;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

@Override
public boolean close() {
  if (clipboard != null) {
    clipboard.dispose();
  }
  return super.close();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.navigator.resources

@Override
public void dispose() {
  if (clipboard != null) {
    clipboard.dispose();
    clipboard = null;
  }
  super.dispose();
}

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

public boolean close() {
  if (clipboard != null)
    clipboard.dispose();
  return super.close();
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
public void dispose() {
  if (clipboard != null) {
    clipboard.dispose();
    clipboard = null;
  }
  super.dispose();
}

代码示例来源:origin: org.eclipse/org.eclipse.search

private void copyToClipboard(String text, Shell shell) {
  Clipboard clipboard= new Clipboard(shell.getDisplay());
  try {
    copyToClipboard(clipboard, text, shell);
  } finally {
    clipboard.dispose();
  }
}

代码示例来源:origin: org.codehaus.openxma/xmartclient

protected void handleCopy() {
  // Context menu selected: copy cell value to clipboard
  if (copyMenuClipboardText_ != null && copyMenuClipboardText_.length()>0) {
    Display display = table_.getShell().getDisplay();
    Clipboard clipboard = new Clipboard(display);
    clipboard.setContents(new String[] {copyMenuClipboardText_}, new Transfer[] {TextTransfer.getInstance()});
    clipboard.dispose();
  }
}

代码示例来源:origin: org.eclipse.egit/ui

public void run() {
    TextTransfer plainTextTransfer = TextTransfer.getInstance();
    Clipboard clipboard = new Clipboard(getShell().getDisplay());
    clipboard.setContents(new String[] { content },
        new Transfer[] { plainTextTransfer });
    clipboard.dispose();
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

@Override
  public void widgetSelected(SelectionEvent e) {
    String text = fMessageLabel.getText();
    if (text != null && text.length() > 0) {
      text = LegacyActionTools.removeMnemonics(text);
      Clipboard cp = new Clipboard(e.display);
      cp.setContents(new Object[] { text },
          new Transfer[] { TextTransfer.getInstance() });
      cp.dispose();
    }
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

protected String getClipboardText() {
  Clipboard clipboard = new Clipboard(Display.getDefault());
  try {
    TextTransfer textTransfer = TextTransfer.getInstance();
    return (String) clipboard.getContents(textTransfer);
  } finally {
    clipboard.dispose();
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.ajdt.ui

/**
 * Copy the contents of the statuses to the clipboard.
 */
private void copyToClipboard() {
  if (clipboard != null)
    clipboard.dispose();
  clipboard = new Clipboard(list.getDisplay());
  clipboard.setContents(new Object[] { longMessage },
      new Transfer[] { TextTransfer.getInstance() });
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public void dispose() {
  if (fClipboard != null) {
    fClipboard.dispose();
    fClipboard = null;
  }
  PDEPlugin.getDefault().getLabelProvider().disconnect(this);
  super.dispose();
}

代码示例来源:origin: org.eclipse.equinox.p2/ui

public void copyToClipboard(Control activeControl) {
  String text = getClipboardText(activeControl);
  if (text.length() == 0)
    return;
  Clipboard clipboard = new Clipboard(PlatformUI.getWorkbench().getDisplay());
  clipboard.setContents(new Object[] {text}, new Transfer[] {TextTransfer.getInstance()});
  clipboard.dispose();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

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();
    }
  }
}

代码示例来源:origin: org.eclipse.pde/org.eclipse.pde.ui

@Override
public void dispose() {
  PDECore.getDefault().getModelManager().removePluginModelListener(this);
  PDECore.getDefault().getSearchablePluginsManager().removePluginModelListener(this);
  PDEPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyListener);
  if (fClipboard != null) {
    fClipboard.dispose();
    fClipboard = null;
  }
  super.dispose();
}

相关文章