public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); Element tr = DOM.createTR(); Element td = createAlignedTd(); DOM.appendChild(tr, td); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ DOM.insertChild(getBody(), tr, beforeIndex); insert(w, td, beforeIndex, false); }
protected void prepend(Widget widget){ vp.insert(widget, 1); }
/** * Insert a {@link RadioButton} at the specified index. * * @param radio the radio button to add * @param value the value associated with the {@link RadioButton} * @param beforeIndex the index before which it will be inserted * @throws IndexOutOfBoundsException if <code>beforeIndex</code> is out of * range */ public void insertRadioButton(RadioButton radio, ColType value, int beforeIndex) throws IndexOutOfBoundsException { vpanel.insert(radio, beforeIndex); radioMap.put(radio, value); }
public void showToolbar(){ super.remove(emptySpacePanel); super.insert(toolbar, 0); } public void hideToolbar(){
@Override protected void insert(Widget widget, int beforeIndex) { if (dropTarget instanceof HorizontalPanel) { ((HorizontalPanel) dropTarget).insert(widget, beforeIndex); } else { ((VerticalPanel) dropTarget).insert(widget, beforeIndex); } }
public void hideToolbar(){ super.remove(toolbar); super.insert(emptySpacePanel,0); } @Override
protected void append(Widget widget){ vp.insert(widget, vp.getWidgetCount()); }
public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
public void insert(IsWidget w, int beforeIndex) { insert(asWidgetOrNull(w), beforeIndex); }
@Override void replaceChildWidget( IsWidget oldIsWidget, IsWidget newIsWidget ) { int idx = panel.getWidgetIndex( oldIsWidget ); panel.remove( idx ); panel.insert( newIsWidget, idx ); } }
@Override public void moveWidget(int fromIndex, int toIndex) { Widget widget = contentPanel.getWidget(fromIndex); contentPanel.remove(fromIndex); contentPanel.insert(widget, toIndex); }
@Override void replaceChildWidget( IsWidget oldIsWidget, IsWidget newIsWidget ) { int idx = panel.getWidgetIndex( oldIsWidget ); panel.remove( idx ); panel.insert( newIsWidget, idx ); } }
private void addAnnotationRow( final AnnotationMetaModel annotation ) { final AnnotationEditor editor = new AnnotationEditor( annotation, annotations ); editor.setDeleteCommand( new Command() { public void execute() { if ( Window.confirm( Constants.INSTANCE.AreYouSureYouWantToRemoveTheAnnotation0( annotation.name ) ) ) { fieldsPanel.remove( editor ); annotations.remove( annotation ); } } } ); fieldsPanel.insert( editor, findPositionOfLastAnnotation() ); }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); Element tr = DOM.createTR(); Element td = createAlignedTd(); DOM.appendChild(tr, td); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ DOM.insertChild(getBody(), tr, beforeIndex); insert(w, td, beforeIndex, false); }
public void insert(Widget w, int beforeIndex) { checkIndexBoundsForInsertion(beforeIndex); Element tr = DOM.createTR(); Element td = createAlignedTd(); DOM.appendChild(tr, td); /* * The case where we reinsert an already existing child is tricky. * * For the WIDGET, it ultimately removes first and inserts second, so we * have to adjust the index within ComplexPanel.insert(). But for the DOM, * we insert first and remove second, which means we DON'T need to adjust * the index. */ DOM.insertChild(getBody(), tr, beforeIndex); insert(w, td, beforeIndex, false); }
NodePanel() { toolbar.setModel(outlineModel); horitonalPanel.setStyleName("KS-LOHNodePanel"); super.sinkEvents(Event.ONMOUSEMOVE); super.sinkEvents(Event.ONMOUSEOUT); emptySpacePanel.setStyleName("KS-LOOutlineManagerToolbar"); Image ieHack = Theme.INSTANCE.getCommonImages().getSpacer(); emptySpacePanel.add(ieHack); super.insert(emptySpacePanel,0); }
@Override public void onLayerAdded(LayerAddedEvent event) { LayerWidget widget = new LayerWidget(event.getLayer()); layerDragController.makeDraggable(widget); layerPanel.insert(widget, mapPresenter.getLayersModel().getLayerCount() - mapPresenter.getLayersModel().getLayerPosition(event.getLayer())); }
@Override public void buildOptions(UIDL uidl) { options.clear(); firstValueIsTemporaryNullItem = false; if (isNullSelectionAllowed() && !isNullSelectionItemAvailable()) { // can't unselect last item in singleselect mode options.add(new Option("", " - ")); } boolean selected = false; for (final Iterator<?> i = uidl.getChildIterator(); i.hasNext();) { final UIDL optionUidl = (UIDL) i.next(); Option w = new Option(optionUidl.getStringAttribute("key"), optionUidl.getStringAttribute("caption")); options.add(w); if (optionUidl.hasAttribute("selected")) { w.setSelected(true); selected = true; l.setText(w.getText()); } } if (!selected && !isNullSelectionAllowed()) { // null-select not allowed, but value not selected yet; add null and // remove when something is selected Option w = new Option("", ""); w.setSelected(true); options.insert(w, 0); firstValueIsTemporaryNullItem = true; } }
@Override public void setDescription(ModelNode desc) { SafeHtmlBuilder builder = new SafeHtmlBuilder(); if (desc.get(ModelDescriptionConstants.DESCRIPTION).isDefined()) { builder.appendEscaped(desc.get(ModelDescriptionConstants.DESCRIPTION).asString()); builder.appendHtmlConstant("<p/>"); } List<String> attrs = new ArrayList<String>(Arrays.asList(attributesNames)); ModelNode values = desc.get(ModelDescriptionConstants.ATTRIBUTES); builder.appendHtmlConstant("<ul>"); for (String s : attrs) { builder.appendHtmlConstant("<li><b>"); builder.appendEscaped(s); builder.appendHtmlConstant("</b> - "); builder.appendEscaped(values.get(s, ModelDescriptionConstants.DESCRIPTION).asString()); } builder.appendHtmlConstant("</ul>"); SafeHtml safeHtml = builder.toSafeHtml(); StaticHelpPanel helpPanel = new StaticHelpPanel(safeHtml); layout.insert(helpPanel.asWidget(), isDialogue ? 0 : 1); }