/** * Creates an empty decorated popup panel using the specified style names. * * @param autoHide <code>true</code> if the popup should be automatically hidden when the user * clicks outside of it * @param modal <code>true</code> if keyboard or mouse events that do not target the PopupPanel or * its children should be ignored * @param prefix the prefix applied to child style names */ DecoratedPopupPanel(boolean autoHide, boolean modal, String prefix) { super(autoHide, modal); String[] rowStyles = new String[] {prefix + "Top", prefix + "Middle", prefix + "Bottom"}; decPanel = new DecoratorPanel(rowStyles, 1); decPanel.setStyleName(""); setStylePrimaryName(DEFAULT_STYLENAME); super.setWidget(decPanel); setStyleName(getContainerElement(), "popupContent", false); setStyleName(decPanel.getContainerElement(), prefix + "Content", true); }
@Override protected void doDetachChildren() { // We need to detach the decPanel because it is not part of the iterator of // Widgets that this class returns (see the iterator() method override). // Detaching the decPanel detaches both itself and its children. We do not // call super.onDetachChildren() because that would detach the decPanel's // children (redundantly) without detaching the decPanel itself. // This is similar to a {@link ComplexPanel}, but we do not want to expose // the decPanel widget, as its just an internal implementation. decPanel.onDetach(); }
public void init() { if (!_initialized) { Thread.yield(); JPanel blurb = new JPanel(); blurb.setLayout(new BoxLayout(blurb, BoxLayout.Y_AXIS)); blurb.add(new JLabel(Bundle.getMessage("addTextAndAttrs"))); blurb.add(new JLabel(Bundle.getMessage("ToolTipDragText"))); blurb.add(Box.createVerticalStrut(ItemPalette.STRUT_SIZE)); blurb.add(new JLabel(Bundle.getMessage("ToLinkToURL", "Text"))); blurb.add(new JLabel(Bundle.getMessage("enterPanel"))); blurb.add(new JLabel(Bundle.getMessage("enterURL"))); JPanel p = new JPanel(); p.add(blurb); add(p); DragDecoratorLabel sample = new DragDecoratorLabel(Bundle.getMessage("sample"), _editor); _decorator = new DecoratorPanel(_editor, null); _decorator.initDecoratorPanel(sample); add(_decorator); initLinkPanel(); _paletteFrame.pack(); super.init(); } }
/** * Get a specific Element from the panel. * * @param row the row index * @param cell the cell index * @return the Element at the given row and cell */ protected com.google.gwt.user.client.Element getCellElement(int row, int cell) { return DOM.asOld(decPanel.getCellElement(row, cell)); }
@Override protected void doAttachChildren() { // See comment in doDetachChildren for an explanation of this call decPanel.onAttach(); }
@Override public void setWidget(Widget w) { decPanel.setWidget(w); maybeUpdateSize(); }
@Override public boolean remove(Widget w) { return decPanel.remove(w); }
@Override public Iterator<Widget> iterator() { return decPanel.iterator(); }
@Override public Widget getWidget() { return decPanel.getWidget(); }
@Override public void clear() { decPanel.clear(); }