fdToolbar.right = new FormAttachment( 100, 0 ); toolbarControl.setLayoutData( fdToolbar ); toolbarControl.setParent( shell );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( transPreviewComposite );
protected void addToolBar() { try { XulLoader loader = new KettleXulLoader(); loader.setSettingsManager( XulSpoonSettingsManager.getInstance() ); ResourceBundle bundle = GlobalMessages.getBundle( "org/pentaho/di/ui/spoon/messages/messages" ); XulDomContainer xulDomContainer = loader.loadXul( XUL_FILE_BROWSER_TOOLBAR, bundle ); xulDomContainer.addEventHandler( this ); toolbar = (XulToolbar) xulDomContainer.getDocumentRoot().getElementById( "nav-toolbar" ); @SuppressWarnings( "unused" ) ToolBar swtToolBar = (ToolBar) toolbar.getManagedObject(); spoon.props.setLook( swtToolBar, Props.WIDGET_STYLE_TOOLBAR ); // Add a URL back = (XulToolbarbutton) toolbar.getElementById( "browse-back" ); back.setDisabled( true ); forward = (XulToolbarbutton) toolbar.getElementById( "browse-forward" ); forward.setLabel( BaseMessages.getString( PKG, "SpoonBrowser.Dialog.Forward" ) ); forward.setDisabled( false ); location = (XulTextbox) toolbar.getElementById( "browser-address" ); Control toolbarControl = (Control) toolbar.getManagedObject(); toolbarControl.setLayoutData( new FormData() ); toolbarControl.setParent( composite ); } catch ( Exception e ) { e.printStackTrace(); new ErrorDialog( shell, BaseMessages.getString( PKG, "Spoon.Exception.ErrorReadingXULFile.Title" ), BaseMessages .getString( PKG, "Spoon.Exception.ErrorReadingXULFile.Message", XUL_FILE_BROWSER_TOOLBAR ), e ); } }
toolbarControl.setParent( this );
toolbarControl.setParent( this );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( transHistoryComposite );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( jobHistoryComposite );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( transLogComposite );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( jobLogComposite );
toolbarControl.setLayoutData( fd ); toolbarControl.setParent( transGridComposite );
public void setDragHostVisibility(boolean visible) { if (dragHost == null || dragHost.isDisposed()) return; if (visible) { if (dragHost.getChildren().length > 0 && dragHost.getChildren()[0] instanceof CTabFolder) { CTabFolder ctf = (CTabFolder) dragHost.getChildren()[0]; dragCtrl.setParent(ctf); dragHost.setVisible(true); } else { dragCtrl.setParent(dragHost); } } else { dragHost.setVisible(false); } }
public void setDragHostVisibility(boolean visible) { if (dragHost == null || dragHost.isDisposed()) { return; } if (visible) { if (dragHost.getChildren().length > 0 && dragHost.getChildren()[0] instanceof CTabFolder) { CTabFolder ctf = (CTabFolder) dragHost.getChildren()[0]; dragCtrl.setParent(ctf); dragHost.setVisible(true); } else { dragCtrl.setParent(dragHost); } } else { dragHost.setVisible(false); } }
} else { if (refWidget.getParent() != newComp) { refWidget.setParent(newComp);
public static Composite wrapTrim(Control trim) { int orientation = SWT.HORIZONTAL; if (trim instanceof ToolBar) orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL : SWT.VERTICAL; Composite parentComp = trim.getParent(); Composite wrapper = new Composite(parentComp, SWT.NONE); RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false) .spacing(0).type(orientation).create(); layout.marginLeft = 3; layout.center = true; wrapper.setLayout(layout); // Separator (aka 'drag handle') ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); new ToolItem(separatorToolBar, SWT.SEPARATOR); // Put the trim under the wrapper and ensure it's last trim.setParent(wrapper); trim.moveBelow(null); return wrapper; }
public static Composite wrapTrim(Control trim) { int orientation = SWT.HORIZONTAL; if (trim instanceof ToolBar) orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL : SWT.VERTICAL; Composite parentComp = trim.getParent(); Composite wrapper = new Composite(parentComp, SWT.NONE); RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false) .spacing(0).type(orientation).create(); layout.marginLeft = 3; layout.center = true; wrapper.setLayout(layout); // Separator (aka 'drag handle') ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT); new ToolItem(separatorToolBar, SWT.SEPARATOR); // Put the trim under the wrapper and ensure it's last trim.setParent(wrapper); trim.moveBelow(null); return wrapper; }
@Override public void createControl(Composite parent) { super.createControl(parent); final ProjectProvider projectProvider = new ProjectAdapter(); final List<ProjectSREProviderFactory> sreProviderFactories = getProviderFromExtension(); sreProviderFactories.add(new EclipseIDEProjectSREProviderFactory()); this.sreBlock = new SREConfigurationBlock(true, projectProvider, sreProviderFactories); this.sreBlock.createControl(parent); final Composite oldComp = (Composite) getControl(); final Control[] children = oldComp.getChildren(); for (final Control ctl : children) { ctl.setParent(this.sreBlock.getControl()); } setControl(this.sreBlock.getControl()); this.listener = new IPropertyChangeListener() { @Override public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent event) { updateLaunchConfigurationDialog(); } }; this.sreBlock.addPropertyChangeListener(this.listener); PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId()); }
protected void showTab(MUIElement element) { super.showTab(element); // an invisible element won't have the correct widget hierarchy if (!element.isVisible()) { return; } final CTabFolder ctf = (CTabFolder) getParentWidget(element); CTabItem cti = findItemForPart(element, null); if (cti == null) { createTab(element.getParent(), element); cti = findItemForPart(element, element.getParent()); } Control ctrl = (Control) element.getWidget(); if (ctrl != null && ctrl.getParent() != ctf) { ctrl.setParent(ctf); cti.setControl(ctrl); } else if (element.getWidget() == null) { Control tabCtrl = (Control) renderer.createGui(element); cti.setControl(tabCtrl); } ignoreTabSelChanges = true; ctf.setSelection(cti); ignoreTabSelChanges = false; // Clear out the current Top Right info MPart part = (MPart) ((element instanceof MPart) ? element : ((MPlaceholder) element).getRef()); adjustTR(ctf, part); }
ctrl.setParent(tabFolder); tabItem.setControl(ctrl); } else if (element.getWidget() == null) {