Example #1
0
 /**
  * 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);
 }
Example #2
0
 @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();
 }
Example #3
0
 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();
   }
 }
Example #4
0
 /**
  * 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));
 }
Example #5
0
 @Override
 protected void doAttachChildren() {
   // See comment in doDetachChildren for an explanation of this call
   decPanel.onAttach();
 }
Example #6
0
 @Override
 public void setWidget(Widget w) {
   decPanel.setWidget(w);
   maybeUpdateSize();
 }
Example #7
0
 @Override
 public boolean remove(Widget w) {
   return decPanel.remove(w);
 }
Example #8
0
 @Override
 public Iterator<Widget> iterator() {
   return decPanel.iterator();
 }
Example #9
0
 @Override
 public Widget getWidget() {
   return decPanel.getWidget();
 }
Example #10
0
 @Override
 public void clear() {
   decPanel.clear();
 }