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

x33g5p2x  于2022-01-29 转载在 其他  
字(8.9k)|赞(0)|评价(0)|浏览(165)

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

ToolBar.getAccessible介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void initAccessibleChevronTb() {
  chevronTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) {
          e.result = chevronItem.getToolTipText();
        }
      }
    }
  });
}
void onKeyDown (Event event) {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void initAccessibleChevronTb() {
  chevronTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) {
          e.result = chevronItem.getToolTipText();
        }
      }
    }
  });
}
void onKeyDown (Event event) {

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void initAccessibleChevronTb() {
  chevronTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) {
          e.result = chevronItem.getToolTipText();
        }
      }
    }
  });
}
void onKeyDown (Event event) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void initAccessibleChevronTb() {
  chevronTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) {
          e.result = chevronItem.getToolTipText();
        }
      }
    }
  });
}
void onKeyDown (Event event) {

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void initAccessibleMinMaxTb() {
  minMaxTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) {
          e.result = minItem.getToolTipText();
        } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) {
          e.result = maxItem.getToolTipText();
        }
      }
    }
  });
}
void initAccessibleChevronTb() {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void initAccessibleChevronTb() {
  chevronTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) {
          e.result = chevronItem.getToolTipText();
        }
      }
    }
  });
}
void onKeyDown (Event event) {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void initAccessibleMinMaxTb() {
  minMaxTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) {
          e.result = minItem.getToolTipText();
        } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) {
          e.result = maxItem.getToolTipText();
        }
      }
    }
  });
}
void initAccessibleChevronTb() {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void initAccessibleMinMaxTb() {
  minMaxTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) {
          e.result = minItem.getToolTipText();
        } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) {
          e.result = maxItem.getToolTipText();
        }
      }
    }
  });
}
void initAccessibleChevronTb() {

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void initAccessibleMinMaxTb() {
  minMaxTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) {
          e.result = minItem.getToolTipText();
        } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) {
          e.result = maxItem.getToolTipText();
        }
      }
    }
  });
}
void initAccessibleChevronTb() {

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void initAccessibleMinMaxTb() {
  minMaxTb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      if (e.childID != ACC.CHILDID_SELF) {
        if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) {
          e.result = minItem.getToolTipText();
        } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) {
          e.result = maxItem.getToolTipText();
        }
      }
    }
  });
}
void initAccessibleChevronTb() {

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

private void initButton(Image im, final String tt) {
  toolButton.setImage(im);
  toolButton.setToolTipText(tt);
  toolbar.setVisible(true);
  toolbar.getParent().requestLayout(); // must layout
  if (currentAccessibleListener != null)
    toolbar.getAccessible().removeAccessibleListener(currentAccessibleListener);
  currentAccessibleListener = new AccessibleAdapter() {
    @Override
    public void getName(AccessibleEvent e) {
      e.result = tt;
    }
  };
  toolbar.getAccessible().addAccessibleListener(currentAccessibleListener);
}

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

private ToolBarManager getToolBarManager() {
  if (fToolBarManager != null && fToolBarManager.getControl() == null)
    return null;
  if (fToolBarManager == null) {
    final ToolBar tb = new ToolBar(this, SWT.FLAT);
    setTopCenter(tb);
    fToolBarManager = new ToolBarManager(tb);
    tb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
      @Override
      public void getName(AccessibleEvent e) {
        if (e.childID != ACC.CHILDID_SELF) {
          ToolItem item = tb.getItem(e.childID);
          if (item != null) {
            String toolTip = item.getToolTipText();
            if (toolTip != null) {
              e.result = toolTip;
            }
          }
        }
      }
    });
  }
  return fToolBarManager;
}

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

private ToolBarManager getToolBarManager() {
  if (fToolBarManager != null && fToolBarManager.getControl() == null)
    return null;
  if (fToolBarManager == null) {
    final ToolBar tb = new ToolBar(this, SWT.FLAT);
    setTopCenter(tb);
    fToolBarManager = new ToolBarManager(tb);
    tb.getAccessible().addAccessibleListener(new AccessibleAdapter() {
      public void getName(AccessibleEvent e) {
        if (e.childID != ACC.CHILDID_SELF) {
          ToolItem item = tb.getItem(e.childID);
          if (item != null) {
            String toolTip = item.getToolTipText();
            if (toolTip != null) {
              e.result = toolTip;
            }
          }
        }
      }
    });
  }
  return fToolBarManager;
}

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

/**
 * Creates and returns this manager's tool bar control. Does not create
 * a new control if one already exists and is not disposed.
 * Also create an {@link AccessibleListener} for the {@link ToolBar}.
 *
 * @param parent
 *            the parent control
 * @return the tool bar control
 */
public ToolBar createControl(Composite parent) {
  if (!toolBarExist() && parent != null) {
    toolBar = new ToolBar(parent, itemStyle);
    toolBar.setMenu(getContextMenuControl());
    update(true);
    toolBar.getAccessible().addAccessibleListener(getAccessibleListener());
  }
  return toolBar;
}

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

/**
 * Creates and returns this manager's tool bar control. Does not create
 * a new control if one already exists and is not disposed.
 * Also create an {@link AccessibleListener} for the {@link ToolBar}.
 *
 * @param parent
 *            the parent control
 * @return the tool bar control
 */
public ToolBar createControl(Composite parent) {
  if (!toolBarExist() && parent != null) {
    toolBar = new ToolBar(parent, itemStyle);
    toolBar.setMenu(getContextMenuControl());
    update(true);
    toolBar.getAccessible().addAccessibleListener(getAccessibleListener());
  }
  return toolBar;
}

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

/**
 * Adds a tool item to the toolbar.
 * Note: Only called by standalone.
 */
private ToolItem addToolItem(final ToolBar toolbar, final Tool tool) {
  final String id = tool.group + '.' + tool.name;
  ToolItem item = new ToolItem (toolbar, tool.type);
  item.setText (getResourceString(id + ".label"));
  item.setToolTipText(getResourceString(id + ".tooltip"));
  item.setImage(tool.image);
  item.addSelectionListener(widgetSelectedAdapter(e -> tool.action.run()));
  final int childID = toolbar.indexOf(item);
  toolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() {
    @Override
    public void getName(org.eclipse.swt.accessibility.AccessibleEvent e) {
      if (e.childID == childID) {
        e.result = getResourceString(id + ".description");
      }
    }
  });
  return item;
}

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

fToolBar.getAccessible().addAccessibleListener(new AccessibleAdapter() {
  @Override
  public void getName(AccessibleEvent e) {

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

menuTB.getAccessible().addAccessibleListener(AccessibleListener.getNameAdapter(e -> {
  if (e.childID != ACC.CHILDID_SELF) {
    Accessible accessible = (Accessible) e.getSource();

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

menuTB.getAccessible().addAccessibleListener(
    new AccessibleAdapter() {
      public void getName(AccessibleEvent e) {

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

perspSwitcherToolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() {
  @Override
  public void getName(AccessibleEvent e) {

相关文章

ToolBar类方法