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

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

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

Label.addTraverseListener介绍

暂无

代码示例

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

private Control createHeader(Composite parent, Font font, String message) {
  Composite header= new Composite(parent, SWT.NONE);
  GridLayout layout= new GridLayout();
  layout.numColumns= 2;
  layout.marginWidth= 0; layout.marginHeight= 0;
  header.setLayout(layout);
  header.setFont(font);
  Label label= new Label(header, SWT.NONE);
  label.setText(message);
  label.setFont(font);
  label.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent e) {
      if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
        e.detail= SWT.TRAVERSE_NONE;
        fFilter.setFocus();
      }
    }
  });
  GridData gd= new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(gd);
  
  createViewMenu(header);
  return header;
}

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

/**
 * Create the labels for the list and the progress. Return the list label.
 *
 * @param parent
 * @return Label
 */
private Label createLabels(Composite parent) {
  Composite labels = new Composite(parent, SWT.NONE);
  GridLayout layout = new GridLayout();
  layout.numColumns = 2;
  layout.marginWidth = 0;
  layout.marginHeight = 0;
  labels.setLayout(layout);
  Label listLabel = new Label(labels, SWT.NONE);
  listLabel
      .setText(WorkbenchMessages.FilteredItemsSelectionDialog_listLabel);
  listLabel.addTraverseListener(e -> {
    if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
      e.detail = SWT.TRAVERSE_NONE;
      list.getTable().setFocus();
    }
  });
  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  listLabel.setLayoutData(gd);
  progressLabel = new Label(labels, SWT.RIGHT);
  progressLabel.setLayoutData(gd);
  labels.setLayoutData(gd);
  return listLabel;
}

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

private Control createHeader(Composite parent, Font font, String message) {
  Composite header= new Composite(parent, SWT.NONE);
  GridLayout layout= new GridLayout();
  layout.numColumns= 2;
  layout.marginWidth= 0; layout.marginHeight= 0;
  header.setLayout(layout);
  header.setFont(font);
  Label label= new Label(header, SWT.NONE);
  label.setText(message);
  label.setFont(font);
  label.addTraverseListener(new TraverseListener() {
    @Override
    public void keyTraversed(TraverseEvent e) {
      if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
        e.detail= SWT.TRAVERSE_NONE;
        fFilter.setFocus();
      }
    }
  });
  GridData gd= new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(gd);
  
  createViewMenu(header);
  return header;
}

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

private Control createHeader(Composite parent, Font font, String message) {
  Composite header= new Composite(parent, SWT.NONE);
  GridLayout layout= new GridLayout();
  layout.numColumns= 2;
  layout.marginWidth= 0; layout.marginHeight= 0;
  header.setLayout(layout);
  header.setFont(font);
  Label label= new Label(header, SWT.NONE);
  label.setText(message);
  label.setFont(font);
  label.addTraverseListener(new TraverseListener() {
    @Override
    public void keyTraversed(TraverseEvent e) {
      if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
        e.detail= SWT.TRAVERSE_NONE;
        fFilter.setFocus();
      }
    }
  });
  GridData gd= new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(gd);
  
  createViewMenu(header);
  return header;
}

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

private Control createHeader(Composite parent, Font font, String message) {
  Composite header= new Composite(parent, SWT.NONE);
  GridLayout layout= new GridLayout();
  layout.numColumns= 2;
  layout.marginWidth= 0; layout.marginHeight= 0;
  header.setLayout(layout);
  header.setFont(font);
  Label label= new Label(header, SWT.NONE);
  label.setText(message);
  label.setFont(font);
  label.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent e) {
      if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
        e.detail= SWT.TRAVERSE_NONE;
        fFilter.setFocus();
      }
    }
  });
  GridData gd= new GridData(GridData.FILL_HORIZONTAL);
  label.setLayoutData(gd);
  
  createViewMenu(header);
  return header;
}

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

/**
 * Create a new header which is labelled by headerLabel.
 *
 * @param parent
 * @return Label the label of the header
 */
private Label createHeader(Composite parent) {
  Composite header = new Composite(parent, SWT.NONE);
  GridLayout layout = new GridLayout();
  layout.numColumns = 2;
  layout.marginWidth = 0;
  layout.marginHeight = 0;
  header.setLayout(layout);
  Label headerLabel = new Label(header, SWT.NONE);
  headerLabel.setText((getMessage() != null && getMessage().trim()
      .length() > 0) ? getMessage()
      : WorkbenchMessages.FilteredItemsSelectionDialog_patternLabel);
  headerLabel.addTraverseListener(e -> {
    if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
      e.detail = SWT.TRAVERSE_NONE;
      pattern.setFocus();
    }
  });
  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  headerLabel.setLayoutData(gd);
  createViewMenu(header);
  header.setLayoutData(gd);
  return headerLabel;
}

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

private void createPushConfigurationGroup(Composite panel) {
  pushConfigurationGroup = SWTUtils.createHFillGroup(panel,
      UIText.GerritConfigurationPage_groupPush,
      SWTUtils.MARGINS_DEFAULT, 3);
  Label branchLabel = new Label(pushConfigurationGroup, SWT.NULL);
  branchLabel
      .setText(UIText.GerritConfigurationPage_labelDestinationBranch);
  // we visualize the prefix here
  Text prefix = new Text(pushConfigurationGroup, SWT.READ_ONLY);
  prefix.setText("refs/for/"); //$NON-NLS-1$
  prefix.setEnabled(false);
  branch = SWTUtils.createText(pushConfigurationGroup);
  branch.addModifyListener(new ModifyListener() {
    public void modifyText(final ModifyEvent e) {
      checkPage();
    }
  });
  // give focus to the branch if label is activated using the mnemonic
  branchLabel.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent e) {
      branch.setFocus();
      branch.selectAll();
    }
  });
  addRefContentProposalToText(branch);
}

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

branchTextlabel.addTraverseListener(new TraverseListener() {
  public void keyTraversed(TraverseEvent e) {
    branchText.setFocus();

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

nameLabel.addTraverseListener(new TraverseListener() {
  public void keyTraversed(TraverseEvent e) {
    nameText.setFocus();

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

label.setFont(font);
label.setText(JavaUIMessages.TypeSelectionComponent_label);
label.addTraverseListener(new TraverseListener() {
  @Override
  public void keyTraversed(TraverseEvent e) {

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

label.setFont(font);
label.setText(JavaUIMessages.TypeSelectionComponent_label);
label.addTraverseListener(new TraverseListener() {
  public void keyTraversed(TraverseEvent e) {
    if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {

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

label.setFont(font);
label.setText(JavaUIMessages.TypeSelectionComponent_label);
label.addTraverseListener(new TraverseListener() {
  public void keyTraversed(TraverseEvent e) {
    if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {

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

label.setFont(font);
label.setText(JavaUIMessages.TypeSelectionComponent_label);
label.addTraverseListener(new TraverseListener() {
  @Override
  public void keyTraversed(TraverseEvent e) {

相关文章