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

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

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

ToolBar.addMouseListener介绍

暂无

代码示例

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

private ToolBar addViewMenu(final Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  final ToolItem menuButton = new ToolItem(fToolBar, SWT.PUSH, 0);
  fMenuImage= JavaPluginImages.DESC_ELCL_VIEW_MENU.createImage();
  menuButton.setImage(fMenuImage);
  menuButton.setToolTipText(ReorgMessages.RenameInformationPopup_menu);
  fToolBar.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      showMenu(fToolBar);
    }
  });
  menuButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showMenu(fToolBar);
    }
  });
  fToolBar.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
  fToolBar.pack();
  return fToolBar;
}

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

private ToolBar addViewMenu(final Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  final ToolItem menuButton = new ToolItem(fToolBar, SWT.PUSH, 0);
  fMenuImage= JavaPluginImages.DESC_ELCL_VIEW_MENU.createImage();
  menuButton.setImage(fMenuImage);
  menuButton.setToolTipText(ReorgMessages.RenameInformationPopup_menu);
  fToolBar.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      showMenu(fToolBar);
    }
  });
  menuButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showMenu(fToolBar);
    }
  });
  fToolBar.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
  fToolBar.pack();
  return fToolBar;
}

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

private void hookupDnD(ToolBar bar) {
  bar.addMouseListener(new MouseListener() {
    @Override
    public void mouseUp(MouseEvent e) {

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

private ToolBar addViewMenu(final Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  final ToolItem menuButton = new ToolItem(fToolBar, SWT.PUSH, 0);
  fMenuImage= JavaPluginImages.DESC_ELCL_VIEW_MENU.createImage();
  menuButton.setImage(fMenuImage);
  menuButton.setToolTipText(ReorgMessages.RenameInformationPopup_menu);
  fToolBar.addMouseListener(new MouseAdapter() {
    public void mouseDown(MouseEvent e) {
      showMenu(fToolBar);
    }
  });
  menuButton.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      showMenu(fToolBar);
    }
  });
  fToolBar.pack();
  return fToolBar;
}

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

protected ToolBar addViewMenu(final Composite parent) {
  toolBar = new ToolBar(parent, SWT.FLAT);
  final ToolItem menuButton = new ToolItem(toolBar, SWT.PUSH, 0);
  menuImage = Activator.getImageDescriptor("icons/elcl16/view_menu.gif").createImage();
  menuButton.setImage(menuImage);
  menuButton.setToolTipText("Menu");
  toolBar.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      showMenu(toolBar);
    }
  });
  menuButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showMenu(toolBar);
    }
  });
  toolBar.pack();
  return toolBar;
}

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

manager.getControl().addMouseListener(new MouseAdapter() {

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

manager.getControl().addMouseListener(new MouseAdapter() {

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

toolBar.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDown(MouseEvent e) {

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

manager.getControl().addMouseListener(new MouseAdapter() {

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

ToolBarManager tbm= (ToolBarManager) mgr;
final ToolBar tb= tbm.getControl();
tb.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDown(MouseEvent e) {

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

toolBar.setLayoutData(data);
toolBar.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDown(MouseEvent e) {

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

/**
 * Create the dialog's menu for the move and resize actions.
 *
 * @param parent
 *            The parent composite.
 */
private void createDialogMenu(Composite parent) {
  toolBar = new ToolBar(parent, SWT.FLAT);
  ToolItem viewMenuButton = new ToolItem(toolBar, SWT.PUSH, 0);
  GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(toolBar);
  viewMenuButton.setImage(JFaceResources.getImage(POPUP_IMG_MENU));
  viewMenuButton.setDisabledImage(JFaceResources.getImage(POPUP_IMG_MENU_DISABLED));
  viewMenuButton.setToolTipText(JFaceResources.getString("PopupDialog.menuTooltip")); //$NON-NLS-1$
  viewMenuButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showDialogMenu();
    }
  });
  // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=177183
  toolBar.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      showDialogMenu();
    }
  });
}

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

/**
 * Create the dialog's menu for the move and resize actions.
 * 
 * @param parent
 *            The parent composite.
 */
private void createDialogMenu(Composite parent) {
  toolBar = new ToolBar(parent, SWT.FLAT);
  ToolItem viewMenuButton = new ToolItem(toolBar, SWT.PUSH, 0);
  GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(
      toolBar);
  viewMenuButton.setImage(JFaceResources.getImage(POPUP_IMG_MENU));
  viewMenuButton.setDisabledImage(JFaceResources
      .getImage(POPUP_IMG_MENU_DISABLED));
  viewMenuButton.setToolTipText(JFaceResources
      .getString("PopupDialog.menuTooltip")); //$NON-NLS-1$
  viewMenuButton.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      showDialogMenu();
    }
  });
  // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=177183
  toolBar.addMouseListener(new MouseAdapter() {
    public void mouseDown(MouseEvent e) {
      showDialogMenu();
    }
  });
}

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

/**
 * Create the dialog's menu for the move and resize actions.
 *
 * @param parent
 *            The parent composite.
 */
private void createDialogMenu(Composite parent) {
  toolBar = new ToolBar(parent, SWT.FLAT);
  ToolItem viewMenuButton = new ToolItem(toolBar, SWT.PUSH, 0);
  GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(toolBar);
  viewMenuButton.setImage(JFaceResources.getImage(POPUP_IMG_MENU));
  viewMenuButton.setDisabledImage(JFaceResources.getImage(POPUP_IMG_MENU_DISABLED));
  viewMenuButton.setToolTipText(JFaceResources.getString("PopupDialog.menuTooltip")); //$NON-NLS-1$
  viewMenuButton.addSelectionListener(widgetSelectedAdapter(e -> showDialogMenu()));
  // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=177183
  toolBar.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDown(MouseEvent e) {
      showDialogMenu();
    }
  });
}

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

protected Control createTitleMenuArea(Composite parent) {
  Composite titleComposite = (Composite) super.createTitleMenuArea(parent);
  titleComposite.addMouseListener(clickListener);
  ToolBar toolBar = new ToolBar(titleComposite, SWT.FLAT);
  ToolItem closeButton = new ToolItem(toolBar, SWT.PUSH, 0);
  GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).applyTo(toolBar);
  closeButton.setImage(AutomaticUpdatePlugin.getDefault().getImageRegistry().get((AutomaticUpdatePlugin.IMG_TOOL_CLOSE)));
  closeButton.setHotImage(AutomaticUpdatePlugin.getDefault().getImageRegistry().get((AutomaticUpdatePlugin.IMG_TOOL_CLOSE_HOT)));
  closeButton.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      close();
    }
  });
  // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=177183
  toolBar.addMouseListener(new MouseAdapter() {
    public void mouseDown(MouseEvent e) {
      close();
    }
  });
  return titleComposite;
}

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

toolBar.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseDown(MouseEvent e) {

相关文章

ToolBar类方法