/** * Stores the page of the given parentComposite for using in exception handling. * Exceptions thrown in component {@link #enter()} or {@link #leave()} methods * are shown using this page * @param parentComposite used to determine its corresponding page. * May be null; in this case no page is stored. * @since 2.2.0 */ protected void setInvokingPage(Composite parentComposite) { invokingPage=(PageClient) parentComposite.getData(); }
@Override public Object getData( String key ) { return( browser.getData( key )); }
/** * Returns true if we need to show the standby part. False in all other * cases. This basically overrides the workbench behavior of Standby/normal * states. The design here is that if the showStandbyPart flag is set, then * we always need to show the standby part. * * @return <code>true</code> if we need to show the standby part */ private boolean isStandbyPartNeeded() { return container.getData(IIntroConstants.SHOW_STANDBY_PART) == null ? false : true; }
/** * Add the listener that gets notified of page changes (to automatically * update context help). * * @param parent the Composite to hook the listener to */ private void hookPageChangeListener(Composite parent) { Object data = parent.getData(); if (data instanceof IPageChangeProvider) { ((IPageChangeProvider)data).addPageChangedListener(this); } }
/** * Remove the listener that gets notified of page changes (to automatically * update context help). * * @param parent the Composite that had the listener */ private void unhookPageChangeListener(Composite parent) { Object data = parent.getData(); if (data instanceof IPageChangeProvider) { ((IPageChangeProvider)data).removePageChangedListener(this); } } }
@Override protected State<Composite> getState( Composite container, SwtMetawidget metawidget ) { @SuppressWarnings( "unchecked" ) State<Composite> state = (State<Composite>) container.getData( getClass().getName() ); if ( state == null ) { state = new State<Composite>(); container.setData( getClass().getName(), state ); } return state; }
@Override protected State getState( Composite container, SwtMetawidget metawidget ) { State state = (State) container.getData( getClass().getName() ); if ( state == null ) { state = new State(); container.setData( getClass().getName(), state ); } return state; }
private State getState( Composite container ) { State state = (State) container.getData( MigLayout.class.getName() ); if ( state == null ) { state = new State(); container.setData( MigLayout.class.getName(), state ); } return state; }
private GridLayout getLayout(Control control) { if (control == null) return null; Composite parent = control.getParent(); if (parent == null) return null; if(parent.getData(CSSSWTConstants.MARGIN_WRAPPER_KEY) == null) return null; Layout layout = parent.getLayout(); if (layout == null || ! (layout instanceof GridLayout)) return null; return (GridLayout) layout; }
@Override public void widgetSelected(SelectionEvent ev){ Composite c = (Composite)tf.getSelection().getControl(); Object o = c.getData(); if ( o instanceof Runnable ){ ((Runnable)o).run(); c.setData(null); } } });
public DragHost(Shell shell) { dragWindow = (MWindow) shell.getData(AbstractPartRenderer.OWNING_ME); baseWindow = (MWindow) shell.getParent().getData( AbstractPartRenderer.OWNING_ME); dragElement = dragWindow.getChildren().get(0); }
public DragHost(Shell shell) { dragWindow = (MWindow) shell.getData(AbstractPartRenderer.OWNING_ME); baseWindow = (MWindow) shell.getParent().getData( AbstractPartRenderer.OWNING_ME); dragElement = dragWindow.getChildren().get(0); }
@Override public void widgetSelected(SelectionEvent ev){ Composite c = (Composite)tf.getSelection().getControl(); Object o = c.getData(); if ( o instanceof Runnable ){ ((Runnable)o).run(); c.setData(null); } } });
/** * Returns a <code>java.awt.Frame</code> which is the embedded frame * associated with the specified composite. * * @param parent the parent <code>Composite</code> of the <code>java.awt.Frame</code> * @return a <code>java.awt.Frame</code> the embedded frame or <code>null</code>. * * @exception IllegalArgumentException <ul> * <li>ERROR_NULL_ARGUMENT - if the parent is null</li> * </ul> * * @since 3.2 */ public static Frame getFrame (Composite parent) { if (parent == null) SWT.error (SWT.ERROR_NULL_ARGUMENT); if ((parent.getStyle () & SWT.EMBEDDED) == 0) return null; return (Frame)parent.getData(EMBEDDED_FRAME_KEY); }
@Override public void reset() { Composite composite = getComposite(); if (composite.getData(BACKGROUND_OVERRIDDEN_BY_CSS_MARKER) != null) { composite.setData(BACKGROUND_OVERRIDDEN_BY_CSS_MARKER, null); } super.reset(); }
@Override protected void createButtons(Composite parent, FormToolkit toolkit) { super.createButtons(parent, toolkit); enableButtons(); if (parent.getData("filtered") != null) { //$NON-NLS-1$ GridLayout layout = (GridLayout) fButtonContainer.getLayout(); layout.marginHeight = 28; } }
public static Control getRootControl(Control control, Thing rootThing){ Composite parent = control.getParent(); if(parent != null){// && !(control instanceof Shell)){ String thingPath = (String) parent.getData(Designer.DATA_THING); Thing thing = World.getInstance().getThing(thingPath); if(thing != null && thing.getRoot() == rootThing){ return getRootControl(parent, rootThing); } } return control; }
@Override protected void layout(Composite composite, boolean flushCache) { Rectangle area= composite.getClientArea(); Table table= getTable(composite); int tableWidth= table.getSize().x; int trim= computeTrim(area, table, tableWidth); int width= Math.max(0, area.width - trim); if (width > 1) layoutTable(table, width, area, tableWidth < area.width); if( composite.getData(RECALCULATE_LAYOUT) == null ) { composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE); composite.layout(); } }
protected void layout(Composite composite, boolean flushCache) { Rectangle area= composite.getClientArea(); Table table= getTable(composite); int tableWidth= table.getSize().x; int trim= computeTrim(area, table, tableWidth); int width= Math.max(0, area.width - trim); if (width > 1) layoutTable(table, width, area, tableWidth < area.width); if( composite.getData(RECALCULATE_LAYOUT) == null ) { composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE); composite.layout(); } }
@Override protected void layout(Composite composite, boolean flushCache) { Rectangle area= composite.getClientArea(); Table table= getTable(composite); int tableWidth= table.getSize().x; int trim= computeTrim(area, table, tableWidth); int width= Math.max(0, area.width - trim); if (width > 1) layoutTable(table, width, area, tableWidth < area.width); if( composite.getData(RECALCULATE_LAYOUT) == null ) { composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE); composite.layout(); } }