treeTb.setLayoutData( fdTreeToolbar ); selectionFilterTb.setLayoutData( fdSelectionFilterToolbar );
fd.right = new FormAttachment( 100 ); fd.top = new FormAttachment( 0, 0 ); treeTb.setLayoutData( fd );
fdTb.right = new FormAttachment( 100, 0 ); fdTb.top = new FormAttachment( wFilesComp, margin ); tb.setLayoutData( fdTb );
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() );
fdexpandAll.right = new FormAttachment( 100, -margin ); fdexpandAll.top = new FormAttachment( 0, margin ); treeTb.setLayoutData( fdexpandAll );
fdTreeTb.left = new FormAttachment( 0, 0 ); fdTreeTb.top = new FormAttachment( 0, 0 ); treeTb.setLayoutData( fdTreeTb );
public void setLayoutData ( final Object layoutData ) { this.toolbar.setLayoutData ( layoutData ); }
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); }
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); }
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; }
/** * 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); }
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(); }
/** * 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); } }
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 ); }
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; }
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); }
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); }
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); }
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); }
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; }