org.eclipse.swt.widgets.Label.addMouseListener()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(204)

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

Label.addMouseListener介绍

暂无

代码示例

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

wlCheckbox.addMouseListener( new MouseAdapter() {
 @Override public void mouseDown( MouseEvent mouseEvent ) {

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

fdClose.top = new FormAttachment( 0, 0 );
closeButton.setLayoutData( fdClose );
closeButton.addMouseListener( new MouseAdapter() {
 @Override
 public void mouseDown( MouseEvent e ) {
fdMinMax.top = new FormAttachment( 0, 0 );
minMaxButton.setLayoutData( fdMinMax );
minMaxButton.addMouseListener( new MouseAdapter() {
 @Override
 public void mouseDown( MouseEvent e ) {

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

fdClose.top = new FormAttachment( 0, 0 );
closeButton.setLayoutData( fdClose );
closeButton.addMouseListener( new MouseAdapter() {
 public void mouseDown( MouseEvent e ) {
  disposeExtraView();
fdMinMax.top = new FormAttachment( 0, 0 );
minMaxButton.setLayoutData( fdMinMax );
minMaxButton.addMouseListener( new MouseAdapter() {
 public void mouseDown( MouseEvent e ) {
  minMaxExtraView();

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

wAddButton.addMouseListener( new MouseAdapter() {
 @Override public void mouseUp( MouseEvent mouseEvent ) {
  MappingIODefinition definition = new MappingIODefinition();
wRemoveButton.addMouseListener( new MouseAdapter() {
 @Override public void mouseUp( MouseEvent mouseEvent ) {
  MessageBox box = new MessageBox( shell, SWT.YES | SWT.NO );

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

public void addMouseListener(MouseListener l) {
  //super.addMouseListener(l);
  label.addMouseListener(l);
}

代码示例来源:origin: BiglySoftware/BiglyBT

public void addMouseListener(MouseListener listener) {
 label.addMouseListener(listener);
}

代码示例来源:origin: BiglySoftware/BiglyBT

/**
 * Add a mouse listener to the control and also the <code>titleLabel</code>
 */
@Override
public void addMouseListener(MouseListener listener) {
  if (null != titleLabel) {
    titleLabel.addMouseListener(listener);
  }
  super.addMouseListener(listener);
}

代码示例来源:origin: stefanhaustein/flowgrid

void addParameter(String prefix, int index, final VirtualOperation.Parameter parameter) {
  MouseAdapter mouseAdapter = new MouseAdapter() {
    @Override
    public void mouseUp(MouseEvent e) {
      new ParameterDialog(VirtualOperationDialog.this, parameter).show();
    }
  };
  for (String text: new String[] {
      prefix, String.valueOf(index), parameter.name, parameter.type.name()}) {
    Label label = new Label(parameterComposite, SWT.NONE);
    label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
    label.setText(text);
    label.addMouseListener(mouseAdapter);
  }
}

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

protected Control createDialogArea(Composite parent) {
  dialogArea = new Composite(parent, SWT.NONE);
  dialogArea.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout = new GridLayout();
  layout.numColumns = 1;
  dialogArea.setLayout(layout);
  dialogArea.addMouseListener(clickListener);
  // The "click to update" label
  Label infoLabel = new Label(dialogArea, SWT.NONE);
  if (downloaded)
    infoLabel.setText(AutomaticUpdateMessages.AutomaticUpdatesPopup_ClickToReviewDownloaded);
  else
    infoLabel.setText(AutomaticUpdateMessages.AutomaticUpdatesPopup_ClickToReviewNotDownloaded);
  infoLabel.setLayoutData(new GridData(GridData.FILL_BOTH));
  infoLabel.addMouseListener(clickListener);
  createRemindSection(dialogArea);
  return dialogArea;
}

代码示例来源:origin: stefanhaustein/flowgrid

public void setListener(final Callback<Artifact> listener) {
  MouseAdapter mouseAdapter = new MouseAdapter() {
    @Override
    public void mouseUp(MouseEvent e) {
      listener.run(artifact);
    }
  };
  if (icon != null) {
    icon.addMouseListener(mouseAdapter);
  }
  label.addMouseListener(mouseAdapter);
  addMouseListener(mouseAdapter);
}

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

private Label createPaletteColorBox( Composite parent, RGB color ) {
 Label result = new Label( parent, SWT.BORDER | SWT.FLAT );
 result.setBackground( new Color( getDisplay(), color ) );
 GridData data = new GridData();
 data.widthHint = PALETTE_BOX_SIZE;
 data.heightHint = PALETTE_BOX_SIZE;
 result.setLayoutData( data );
 result.addMouseListener( new PaletteListener( color ) );
 return result;
}

代码示例来源:origin: BiglySoftware/BiglyBT

protected final void createGap(int width) {
  width = (int)(width * width_multiplier );
  // We create a label just so we can attach the menu to it.
  assertConstructing();
  Label result = new Label(splash, SWT.NONE);
  result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
  result.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
  result.setText("");
  result.addMouseListener(this.mListener);
  result.addMouseMoveListener(this.mMoveListener);
  result.setLocation(this.xSize, 0);
  result.setSize(width, hSize);
  result.setMenu(this.menu);
  this.xSize += width;
}

代码示例来源: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: infinitest/infinitest

@Override
  public void addSelectionListener(SelectionListener listener) {
    label.addMouseListener(new MouseToSelectionAdapter(listener));
    label.getParent().pack();
    label.getParent().layout();
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

public
LinkParameter(
  Composite composite,
 final String name_resource)
{
  super(name_resource);
 link_label = new Label(composite, SWT.NULL);
 Messages.setLanguageText(link_label, name_resource);
 link_label.setCursor(link_label.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
 link_label.setForeground(Colors.blue);
 link_label.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDoubleClick(MouseEvent arg0) {
   fire();
  }
  @Override
  public void mouseUp(MouseEvent arg0) {
   fire();
  }
 });
}

代码示例来源:origin: stefanhaustein/flowgrid

label.setText(property.name());
label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
label.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseUp(MouseEvent e) {

代码示例来源:origin: BiglySoftware/BiglyBT

protected final Label createFixedLabel(int width) {
  assertConstructing();
  Label result = new Label(splash, SWT.NONE);
  result.setBackground(Colors.white);
  result.setSize(width, SWT.DEFAULT );
  result.setLocation(this.xSize, 0);
  result.addMouseListener(this.mListener);
  result.addMouseMoveListener(this.mMoveListener);
  result.setMenu(this.menu);
  if (this.hSize == -1) {
    int hSizeText = result.getSize().y;
    int hSizeImage = this.lDrag.getSize().y;
    this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
  }
  this.xSize += width;
  return( result );
}

代码示例来源:origin: BiglySoftware/BiglyBT

/**
 * Alters a given label to make it appear like a launchable
 * link. This should preferably be done after all other changes
 * have been performed on the label - especially the setting of
 * the label's text.
 */
public static void makeLinkedLabel(Label label, String hyperlink) {
  label.setData(hyperlink);
  String tooltip = label.getToolTipText();
  // We only set a tooltip if one isn't set already and it isn't
  // identical to the label text.
  if (tooltip == null && !hyperlink.equals(label.getText())) {
    Utils.setTT(label,hyperlink.replaceAll("&", "&&"));
  }
  label.setCursor(label.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
  label.setForeground(Colors.blue);
  label.addMouseListener(new MouseAdapter() {
   @Override
   public void mouseDoubleClick(MouseEvent arg0) {
     Utils.launch((String) ((Label) arg0.widget).getData());
   }
   @Override
   public void mouseUp(MouseEvent arg0) {
     Utils.launch((String) ((Label) arg0.widget).getData());
   }
  });
  ClipboardCopy.addCopyToClipMenu( label );
}

代码示例来源:origin: openaudible/openaudible

l.addMouseListener(clickHandler);
d.addMouseListener(clickHandler);

代码示例来源:origin: BiglySoftware/BiglyBT

protected final Label createFixedTextLabel(String msg_key, boolean add_colon, boolean bold) {
  assertConstructing();
  Label result = new Label(splash, SWT.NONE);
  result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
  result.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
  result.setText(MessageText.getString(msg_key) + ((add_colon) ? ":" : ""));
  if (bold) {
    if (this.bold_font == null) {
      this.bold_font = createBoldFont(result.getFont());
    }
    result.setFont(this.bold_font);
  }
  result.addMouseListener(this.mListener);
  result.addMouseMoveListener(this.mMoveListener);
  result.pack();
  result.setLocation(this.xSize, 0);
  result.setMenu(this.menu);
  if (this.hSize == -1) {
    int hSizeText = result.getSize().y;
    int hSizeImage = this.lDrag.getSize().y;
    this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
  }
  this.xSize += result.getSize().x + 3;
  return( result );
}

相关文章