Java Code Examples for org.eclipse.swt.widgets.Display#beep()

The following examples show how to use org.eclipse.swt.widgets.Display#beep() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NLSKeyHyperlink.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Shows the given message as error on the status line.
 * 
 * @param editor the editor part
 * @param message message to be displayed
 */
private static void showErrorInStatusLine(IEditorPart editor, final String message) {
	final Display display= editor.getSite().getShell().getDisplay();
	display.beep();
	final IEditorStatusLine statusLine= (IEditorStatusLine)editor.getAdapter(IEditorStatusLine.class);
	if (statusLine != null) {
		display.asyncExec(new Runnable() {
			/*
			 * @see java.lang.Runnable#run()
			 */
			public void run() {
				statusLine.setMessage(true, message, null);
			}
		});
	}
}
 
Example 2
Source File: EditorAPI.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void verifyKey(VerifyEvent event) {
  if (event.character > 0) {
    event.doit = false;

    Object adapter = getActiveEditor().getAdapter(IEditorStatusLine.class);
    if (adapter != null) {
      SarosView.showNotification(
          "Read-Only Notification",
          "You have only read access and therefore can't perform modifications.");

      Display display = SWTUtils.getDisplay();

      if (!display.isDisposed()) display.beep();
    }
  }
}
 
Example 3
Source File: PropertyKeyHyperlinkDetector.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private void showErrorInStatusLine(final String message, ITextEditor textEditor) {
	Display display= textEditor.getEditorSite().getShell().getDisplay();
	display.beep();
	final IEditorStatusLine statusLine= (IEditorStatusLine)textEditor.getAdapter(IEditorStatusLine.class);
	if (statusLine != null) {
		display.asyncExec(new Runnable() {
			/*
			 * @see java.lang.Runnable#run()
			 */
			public void run() {
				statusLine.setMessage(true, message, null);
			}
		});
	}
}