Tabnine Logo
Label.getDisplay
Code IndexAdd Tabnine to your IDE (free)

How to use
getDisplay
method
in
org.eclipse.swt.widgets.Label

Best Java code snippets using org.eclipse.swt.widgets.Label.getDisplay (Showing top 20 results out of 315)

origin: com.github.rinde/rinsim-example

 final void update() {
  label.getDisplay().asyncExec(new Runnable() {
   @Override
   public void run() {
    label.setText(monitor.getBounds().width + " x "
     + monitor.getBounds().height + "\n" + runner.getState());
   }
  });
 }
}
origin: rinde/RinSim

 final void update() {
  label.getDisplay().asyncExec(new Runnable() {
   @Override
   public void run() {
    label.setText(monitor.getBounds().width + " x "
     + monitor.getBounds().height + "\n" + runner.getState());
   }
  });
 }
}
origin: org.xworker/xworker_swt

public void setLabel(final String text){
  if(text == null || label == null || label.isDisposed()){
    return;
  }
  
  label.getDisplay().asyncExec(new Runnable(){
    public void run(){
      label.setText(text);
    }
  });        
}
 
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * Get the system default font data.
 * @return FontData[]
 */
private FontData[] getDefaultFontData() {
  return valueControl.getDisplay().getSystemFont().getFontData();
}
origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * Get the system default font data.
 * @return FontData[]
 */
private FontData[] getDefaultFontData() {
  return valueControl.getDisplay().getSystemFont().getFontData();
}
origin: org.eclipse.platform/org.eclipse.jface

/**
 * Get the system default font data.
 * @return FontData[]
 */
private FontData[] getDefaultFontData() {
  return valueControl.getDisplay().getSystemFont().getFontData();
}
origin: org.eclipse/org.eclipse.datatools.connectivity.sqm.core.ui

  public void handleEvent(Event event) {
    if (statusMessage != null && validator != null) {
      String errorMsg = validator.isValid(group
          .getSelection());
      if (errorMsg == null || errorMsg.equals("")) { //$NON-NLS-1$
        statusMessage.setText(""); //$NON-NLS-1$
        getOkButton().setEnabled(true);
      } else {
        statusMessage.setForeground(JFaceColors
            .getErrorText(statusMessage.getDisplay()));
        statusMessage.setText(errorMsg);
        getOkButton().setEnabled(false);
      }
    }
  }
};
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

private void setArgumentLabelEnabled() {
  if (argumentsLabel != null) {
    Color color = argumentsLabel.getDisplay().getSystemColor(
        filter.hasStringArguments() ? SWT.COLOR_BLACK : SWT.COLOR_GRAY);
    argumentsLabel.setForeground(color);
  }
}
origin: org.eclipse/org.eclipse.search

private void statusMessage(boolean error, String message) {
  fStatusLabel.setText(message);

  if (error)
    fStatusLabel.setForeground(JFaceColors.getErrorText(fStatusLabel.getDisplay()));
  else
    fStatusLabel.setForeground(null);

  if (error)
    getShell().getDisplay().beep();
}

origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
public void updateLabel() {
  if (Display.getCurrent() != null) {
    super.updateLabel();
  } else {
    fLabel.getDisplay().asyncExec(() -> {
      if (!fLabel.isDisposed()) {
        super.updateLabel();
      }
    });
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

  @Override
  public void internalWorked(double work) {
    if (Display.getCurrent() != null) {
      super.internalWorked(work);
    } else {
      fLabel.getDisplay().asyncExec(() -> {
        if (!fLabel.isDisposed()) {
          super.internalWorked(work);
        }
      });
    }
  }
}
origin: org.eclipse.platform/org.eclipse.jface.text

private void createStatusLabel(final String statusFieldText, Color foreground, Color background) {
  fStatusLabel= new Label(fStatusComposite, SWT.RIGHT);
  fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  fStatusLabel.setText(statusFieldText);
  FontData[] fontDatas= JFaceResources.getDialogFont().getFontData();
  for (FontData fontData : fontDatas) {
    fontData.setHeight(fontData.getHeight() * 9 / 10);
  }
  fStatusLabelFont= new Font(fStatusLabel.getDisplay(), fontDatas);
  fStatusLabel.setFont(fStatusLabelFont);
  setStatusLabelColors(foreground, background);
  setColor(fStatusComposite, foreground, background);
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.ide

@Override
public void setMessage(String message) {
  super.setMessage(message);
  if (statusMessageLabel != null) {
    if (message == null) {
      statusMessageLabel.setText("");//$NON-NLS-1$
      statusMessageLabel.setToolTipText("");//$NON-NLS-1$
      getOkButton().setEnabled(true);
    } else {
      statusMessageLabel.setForeground(JFaceColors
          .getErrorText(statusMessageLabel.getDisplay()));
      statusMessageLabel.setText(message);
      statusMessageLabel.setToolTipText(message);
      getOkButton().setEnabled(false);
    }
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

private void createStatusLabel(final String statusFieldText, Color foreground, Color background) {
  fStatusLabel= new Label(fStatusComposite, SWT.RIGHT);
  fStatusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  fStatusLabel.setText(statusFieldText);
  FontData[] fontDatas= JFaceResources.getDialogFont().getFontData();
  for (int i= 0; i < fontDatas.length; i++) {
    fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
  }
  fStatusLabelFont= new Font(fStatusLabel.getDisplay(), fontDatas);
  fStatusLabel.setFont(fStatusLabelFont);
  
  fStatusLabelForeground= new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f));
  setColor(fStatusLabel, fStatusLabelForeground, background);
  setColor(fStatusComposite, foreground, background);
}
origin: BiglySoftware/BiglyBT

  protected void
  copyToClipboard()
  {
    new Clipboard(control_val_pk.getDisplay()).setContents(new Object[] {control_val_pk.getData( "key" )}, new Transfer[] {TextTransfer.getInstance()});
  }
});
origin: BiglySoftware/BiglyBT

  public static void makeLinkedLabel(Label label, Runnable runnable) {
    
    label.setCursor(label.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    label.setForeground(Colors.blue);
    label.addMouseListener(new MouseAdapter() {
     @Override
     public void mouseDoubleClick(MouseEvent arg0) {
       runnable.run();
     }
     @Override
     public void mouseUp(MouseEvent arg0) {
       runnable.run();
     }
    });
  }
}
origin: BiglySoftware/BiglyBT

  @Override
  public void mouseUp(MouseEvent e) {
    boolean vis = !config.getBooleanParameter(keys[f_i] + ".vis", true );
    config.setParameter(keys[f_i] + ".vis", vis );
    listener.visibilityChange( vis, f_i );
    lblDesc.setForeground(vis?Colors.getSystemColor(lblDesc.getDisplay(), SWT.COLOR_BLACK ):Colors.grey );
  }
});
origin: org.eclipse.platform/org.eclipse.ui.workbench.texteditor

/**
 * Sets the given status message in the status line.
 *
 * @param error <code>true</code> if it is an error
 * @param message the error message
 */
private void statusMessage(boolean error, String message) {
  fStatusLabel.setText(message);
  if (error)
    fStatusLabel.setForeground(JFaceColors.getErrorText(fStatusLabel.getDisplay()));
  else
    fStatusLabel.setForeground(null);
  IEditorStatusLine statusLine= getStatusLineManager();
  if (statusLine != null)
    statusLine.setMessage(error, message, null);
  if (error)
    getShell().getDisplay().beep();
}
origin: org.eclipse.platform/org.eclipse.jface.text

private void setStatusLabelColors(Color foreground, Color background) {
  if (foreground == null || background == null) return;
  if (fStatusLabelForeground != null) {
    fStatusLabelForeground.dispose();
  }
  fStatusLabelForeground = new Color(fStatusLabel.getDisplay(), Colors.blend(background.getRGB(), foreground.getRGB(), 0.56f));
  fStatusLabel.setForeground(fStatusLabelForeground);
  fStatusLabel.setBackground(background);
}
origin: ystrot/glance

protected void applyFonts(final Composite composite) {
  Dialog.applyDialogFont(composite);
  if (info != null) {
    final Font font = info.getFont();
    final FontData[] fontDatas = font.getFontData();
    for (int i = 0; i < fontDatas.length; i++) {
      fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
    }
    infoFont = new Font(info.getDisplay(), fontDatas);
    info.setFont(infoFont);
  }
}
org.eclipse.swt.widgetsLabelgetDisplay

Popular methods of Label

  • <init>
    Constructs a new instance of this class given its parent and a style value describing its behavior a
  • setText
    Sets the receiver's text. This method sets the widget label. The label may include the mnemonic char
  • setLayoutData
  • setImage
    Sets the receiver's image to the argument, which may be null indicating that no image should be disp
  • setFont
  • setEnabled
  • setBackground
  • setForeground
  • setVisible
  • setToolTipText
  • computeSize
  • getText
    Returns the receiver's text, which will be an empty string if it has never been set or if the receiv
  • computeSize,
  • getText,
  • isDisposed,
  • setData,
  • dispose,
  • getFont,
  • setBounds,
  • addMouseListener,
  • getLayoutData

Popular in Java

  • Reading from database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • Menu (java.awt)
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ImageIO (javax.imageio)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now