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

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

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

ToolBar.setLayoutData介绍

暂无

代码示例

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

treeTb.setLayoutData( fdTreeToolbar );
selectionFilterTb.setLayoutData( fdSelectionFilterToolbar );

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

fd.right = new FormAttachment( 100 );
fd.top = new FormAttachment( 0, 0 );
treeTb.setLayoutData( fd );

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

fdTb.right = new FormAttachment( 100, 0 );
fdTb.top = new FormAttachment( wFilesComp, margin );
tb.setLayoutData( fdTb );

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

FormData fdToolbarLeft = new FormData();
fdToolbarLeft.top = new FormAttachment( 0, MARGIN );
toolbarLeft.setLayoutData( fdToolbarLeft );
toolbarLeft.setCursor( cursorEnabled );
toolbarLeft.setBackground( toolbarLeft.getParent().getBackground() );
fdToolbarRight.top = new FormAttachment( 0, MARGIN );
fdToolbarRight.right = new FormAttachment( 100, -1 * TOOL_ITEM_SPACING );
toolbarRight.setLayoutData( fdToolbarRight );
toolbarRight.setCursor( cursorEnabled );
toolbarRight.setBackground( toolbarRight.getParent().getBackground() );

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

fdexpandAll.right = new FormAttachment( 100, -margin );
fdexpandAll.top = new FormAttachment( 0, margin );
treeTb.setLayoutData( fdexpandAll );

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

fdTreeTb.left = new FormAttachment( 0, 0 );
fdTreeTb.top = new FormAttachment( 0, 0 );
treeTb.setLayoutData( fdTreeTb );

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.vi.ui.user

public void setLayoutData ( final Object layoutData )
{
  this.toolbar.setLayoutData ( layoutData );
}

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

private void createToolBar(ToolBarManager toolBarManager) {
  final Composite bars= new Composite(fStatusComposite, SWT.NONE);
  bars.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
  GridLayout layout= new GridLayout(3, false);
  layout.marginHeight= 0;
  layout.marginWidth= 0;
  layout.horizontalSpacing= 0;
  layout.verticalSpacing= 0;
  bars.setLayout(layout);
  fToolBar= toolBarManager.createControl(bars);
  GridData gd= new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
  fToolBar.setLayoutData(gd);
  Composite spacer= new Composite(bars, SWT.NONE);
  gd= new GridData(SWT.FILL, SWT.FILL, true, true);
  gd.widthHint= 0;
  gd.heightHint= 0;
  spacer.setLayoutData(gd);
  addMoveSupport(spacer);
  addResizeSupportIfNecessary(bars);
}

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

private void createToolBar(ToolBarManager toolBarManager) {
  final Composite bars= new Composite(fStatusComposite, SWT.NONE);
  bars.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
  GridLayout layout= new GridLayout(3, false);
  layout.marginHeight= 0;
  layout.marginWidth= 0;
  layout.horizontalSpacing= 0;
  layout.verticalSpacing= 0;
  bars.setLayout(layout);
  fToolBar= toolBarManager.createControl(bars);
  GridData gd= new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
  fToolBar.setLayoutData(gd);
  Composite spacer= new Composite(bars, SWT.NONE);
  gd= new GridData(SWT.FILL, SWT.FILL, true, true);
  gd.widthHint= 0;
  gd.heightHint= 0;
  spacer.setLayoutData(gd);
  addMoveSupport(spacer);
  addResizeSupportIfNecessary(bars);
}

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

public static LineWrapPreference create(Composite parentComposite, String label, String key, String wrapBeforeKey, Images images) {
  ToolBar toolBar= new ToolBar(parentComposite, SWT.FLAT);
  toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
  LineWrapPreference lineWrapPreference= new LineWrapPreference(toolBar, label, key, wrapBeforeKey, images);
  lineWrapPreference.addLabel(label, true, 0);
  return lineWrapPreference;
}

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

/**
 * Creates the navigation buttons for this viewer.
 */
protected void createNavigationButtons() {
  GridData gid;
  GridLayout layout;
  // Define layout.
  layout = new GridLayout();
  layout.marginHeight = layout.marginWidth = layout.horizontalSpacing = layout.verticalSpacing = 0;
  setLayout(layout);
  // Create a toolbar.
  toolBarMgr = new ToolBarManager(SWT.FLAT);
  ToolBar toolBar = toolBarMgr.createControl(this);
  gid = new GridData();
  gid.horizontalAlignment = GridData.FILL;
  gid.verticalAlignment = GridData.BEGINNING;
  toolBar.setLayoutData(gid);
}

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

BookButtonBar(Composite parent, int gridStyle) {
  toolbar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
  gd = new GridData(gridStyle);
  toolbar.setLayoutData(gd);
  
  for (Command cmd : cmds) {
    addIconButton(toolbar, cmd);
  }
  BookNotifier.getInstance().addListener(this);
  refresh();
}

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

/**
 * Set the layout of the widgets for the no progress case.
 *
 */
private void setLayoutsForNoProgress() {
  FormData buttonData = new FormData();
  buttonData.top = new FormAttachment(progressLabel, 0, SWT.TOP);
  buttonData.right = new FormAttachment(100,
      IDialogConstants.HORIZONTAL_SPACING * -1);
  actionBar.setLayoutData(buttonData);
  if (taskEntries.size() > 0) {
    FormData linkData = new FormData();
    linkData.top = new FormAttachment(progressLabel,
        IDialogConstants.VERTICAL_SPACING);
    linkData.left = new FormAttachment(progressLabel, 0, SWT.LEFT);
    linkData.right = new FormAttachment(actionBar, 0, SWT.LEFT);
    taskEntries.get(0).setLayoutData(linkData);
  }
}

代码示例来源:origin: com.eclipsesource.tabris/tabris

private void createPageSwitcher() {
 pageSwitcher = new ToolBar( uiParent, SWT.NONE );
 pageSwitcher.setData( RWT.CUSTOM_VARIANT, CUSTOM_VARIANT_TABRIS_UI );
 pageSwitcher.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, false, false ) );
 ToolItem pageSwitcherDropDown = new ToolItem( pageSwitcher, SWT.DROP_DOWN );
 pageSwitcherDropDown.setData( RWT.CUSTOM_VARIANT, CUSTOM_VARIANT_TABRIS_UI );
 pageSwitcherDropDown.addListener( SWT.Selection, new PageSwitcherSelectionListener() );
 pageSwitcherMenu = new Menu( uiParent.getShell(), SWT.POP_UP );
 pageSwitcherMenu.setData( RWT.CUSTOM_VARIANT, CUSTOM_VARIANT_TABRIS_UI );
}

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

private ToolBar createHelpImageButton(Composite parent, Image image) {
  ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
  ((GridLayout) parent.getLayout()).numColumns++;
  toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
  toolBar.setCursor(parent.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
  fHelpButton = new ToolItem(toolBar, SWT.CHECK);
  fHelpButton.setImage(image);
  fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
  fHelpButton.addSelectionListener(widgetSelectedAdapter(e -> helpPressed()));
  return toolBar;
}

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

private void createViewMenu(Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  fToolItem= new ToolItem(fToolBar, SWT.PUSH, 0);
  GridData data= new GridData();
  data.horizontalAlignment= GridData.END;
  fToolBar.setLayoutData(data);
  fToolItem.setImage(JavaPluginImages.get(JavaPluginImages.IMG_ELCL_VIEW_MENU));
  fToolItem.setDisabledImage(JavaPluginImages.get(JavaPluginImages.IMG_DLCL_VIEW_MENU));
  fToolItem.setToolTipText(JavaUIMessages.TypeSelectionComponent_menu);
  fToolItem.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showViewMenu();
    }
  });
  
  fMenuManager= new MenuManager();
  fillViewMenu(fMenuManager);
  // ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class);
  // IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
}

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

private void createViewMenu(Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  fToolItem= new ToolItem(fToolBar, SWT.PUSH, 0);
  GridData data= new GridData();
  data.horizontalAlignment= GridData.END;
  fToolBar.setLayoutData(data);
  fToolItem.setImage(JavaPluginImages.get(JavaPluginImages.IMG_ELCL_VIEW_MENU));
  fToolItem.setDisabledImage(JavaPluginImages.get(JavaPluginImages.IMG_DLCL_VIEW_MENU));
  fToolItem.setToolTipText(JavaUIMessages.TypeSelectionComponent_menu);
  fToolItem.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      showViewMenu();
    }
  });
  
  fMenuManager= new MenuManager();
  fillViewMenu(fMenuManager);
  // ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class);
  // IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
}

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

private void createViewMenu(Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  fToolItem= new ToolItem(fToolBar, SWT.PUSH, 0);
  GridData data= new GridData();
  data.horizontalAlignment= GridData.END;
  fToolBar.setLayoutData(data);
  fToolItem.setImage(JavaPluginImages.get(JavaPluginImages.IMG_ELCL_VIEW_MENU));
  fToolItem.setDisabledImage(JavaPluginImages.get(JavaPluginImages.IMG_DLCL_VIEW_MENU));
  fToolItem.setToolTipText(JavaUIMessages.TypeSelectionComponent_menu);
  fToolItem.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      showViewMenu();
    }
  });
  
  fMenuManager= new MenuManager();
  fillViewMenu(fMenuManager);
  // ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class);
  // IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
}

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

private void createViewMenu(Composite parent) {
  fToolBar= new ToolBar(parent, SWT.FLAT);
  fToolItem= new ToolItem(fToolBar, SWT.PUSH, 0);
  GridData data= new GridData();
  data.horizontalAlignment= GridData.END;
  fToolBar.setLayoutData(data);
  fToolItem.setImage(JavaPluginImages.get(JavaPluginImages.IMG_ELCL_VIEW_MENU));
  fToolItem.setDisabledImage(JavaPluginImages.get(JavaPluginImages.IMG_DLCL_VIEW_MENU));
  fToolItem.setToolTipText(JavaUIMessages.TypeSelectionComponent_menu);
  fToolItem.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      showViewMenu();
    }
  });
  
  fMenuManager= new MenuManager();
  fillViewMenu(fMenuManager);
  // ICommandService commandService= (ICommandService)PlatformUI.getWorkbench().getAdapter(ICommandService.class);
  // IHandlerService handlerService= (IHandlerService)PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
}

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

private ToolBar createHelpImageButton(Composite parent, Image image) {
  ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
  ((GridLayout) parent.getLayout()).numColumns++;
  toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
  final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
  toolBar.setCursor(cursor);
  toolBar.addDisposeListener(e -> cursor.dispose());
  fHelpButton = new ToolItem(toolBar, SWT.CHECK);
  fHelpButton.setImage(image);
  fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
  fHelpButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      helpPressed();
    }
  });
  return toolBar;
}

相关文章

ToolBar类方法