/** Sets if design time is turned on for a Container in {@link ContainerWrapper}. * @param cw The container to set design time for. <code>null</code> is legal and can be used as * a key to turn on/off design time "in general". Note though that design time "in general" is * always on as long as there is at least one ContainerWrapper with design time. * <p> * <strong>If this method has not ever been called it will default to what * <code>Beans.isDesignTime()</code> returns.</strong> This means that if you call * this method you indicate that you will take responsibility for the design time value. * @param b <code>true</code> means design time on. */ public static void setDesignTime(ContainerWrapper cw, boolean b) { if (DT_MAP == null) DT_MAP = new WeakHashMap<Object, Boolean>(); DT_MAP.put((cw != null ? cw.getComponent() : null), b); }
private ContainerWrapper checkParent(Composite parent) { if (parent == null) return null; if (cacheParentW == null || cacheParentW.getComponent() != parent) cacheParentW = new SwtContainerWrapper(parent); return cacheParentW; }
private ContainerWrapper checkParent(Container parent) { if (parent == null) return null; if (cacheParentW == null || cacheParentW.getComponent() != parent) cacheParentW = new SwingContainerWrapper(parent); return cacheParentW; }
/** Returns if design time is turned on for a Container in {@link ContainerWrapper}. * @param cw The container to set design time for. <code>null</code> is legal will return <code>true</code> * if there is at least one <code>ContainerWrapper</code> (or <code>null</code>) that have design time * turned on. * @return If design time is set for <code>cw</code>. */ public static boolean isDesignTime(ContainerWrapper cw) { if (DT_MAP == null) return HAS_BEANS && Beans.isDesignTime(); // assume design time "in general" (cw is null) if there is at least one container with design time // (for storing constraints creation strings in method putCCString()) if (cw == null && DT_MAP != null && !DT_MAP.isEmpty() ) return true; if (cw != null && DT_MAP.containsKey(cw.getComponent()) == false) cw = null; Boolean b = DT_MAP.get(cw != null ? cw.getComponent() : null); return b != null && b; }
/** Sets the debugging state for this layout manager instance. If debug is turned on a timer will repaint the last laid out parent * with debug information on top. * <p> * Red fill and dashed dark red outline is used to indicate occupied cells in the grid. Blue dashed outline indicate * component bounds set. * <p> * Note that debug can also be set on the layout constraints. There it will be persisted. The value set here will not. See the class * JavaDocs for information. * @param parentW The parent. Never <code>null</code>. * @param b <code>true</code> means debug is turned on. */ private synchronized void setDebug(final ComponentWrapper parentW, boolean b) { if (b && (debugTimer == null || curDelay != getDebugMillis())) { if (debugTimer != null) debugTimer.cancel(); debugTimer = new Timer(true); curDelay = getDebugMillis(); debugTimer.schedule(new MyDebugRepaintTask(this), curDelay, curDelay); ContainerWrapper pCW = parentW.getParent(); Composite parent = pCW != null ? (Composite) pCW.getComponent() : null; if (parent != null) parent.layout(); } else if (!b && debugTimer != null) { debugTimer.cancel(); debugTimer = null; } }
final Component parent = pCW != null ? (Component) pCW.getComponent() : null;
return; Container packable = getPackable((Component) parent.getComponent()); Component pc = (Component) parent.getComponent();
ixArr[ix++] = i; putSizesAndIndexes(container.getComponent(), rowColSizes, ixArr, isRows);
lastSize = newSize; final ContainerWrapper containerWrapper = checkParent(parent); Window win = ((Window) SwingUtilities.getAncestorOfClass(Window.class, (Component)containerWrapper.getComponent())); if (win != null) { if (win.isVisible()) {