public TextWord(PlatformContext context, WordPresenter presenter, FileModel fmodel) { super(context, presenter); this.model = fmodel; if (fmodel.isAdmin() || context.getUser().isSuper()) { add(getEditTab(), new TabItemConfig("编辑", false)); } else { add(getViewTab(), new TabItemConfig("查看", false)); } addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() { public void onBeforeSelection(BeforeSelectionEvent<Widget> event) { if (event.getItem() == getViewTab()) { if (editTab.getNewContent() != null) { getViewTab().refresh(editTab.getNewContent()); } else if (model.getContent() != null) { getViewTab().refresh(model.getContent()); } } else if (event.getItem() == getEditTab()) { getEditTab().getCodeMirror().refresh(); } } }); }
/** * @return this editor as a Widget. */ public Widget asWidget() { VerticalPanel panel = new VerticalPanel(); panel.add(new ContentGroupLabel(Singleton.MESSAGES.label_serviceDetails())); panel.add(new ContentDescription(Singleton.MESSAGES.description_serviceDetails())); panel.add(createImplementationDetailsPanel()); TabPanel tabs = new TabPanel(); tabs.setStyleName("default-tabpanel"); //$NON-NLS-1$ tabs.getElement().setAttribute("style", "margin-top:15px;"); //$NON-NLS-1$ //$NON-NLS-2$ tabs.add(createGatewayDetailsPanel(), Singleton.MESSAGES.label_gateways()); tabs.add(createThrottlingDetailsPanel(), Singleton.MESSAGES.label_throttling()); tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { @Override public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { _toolstrip.doCancel(); } }); panel.add(tabs); tabs.selectTab(0); return panel; }
public ShellWord(PlatformContext context,WordPresenter presenter,FileModel fmodel) { super(context ,presenter); this.model=fmodel; if(fmodel.isAdmin() || context.getUser().isSuper()){ add(getEditTab(), new TabItemConfig("编辑", false)); add(getHistoryTab(),new TabItemConfig("调试历史", false)); setActiveWidget(editTab); }else{ add(getViewTab(), new TabItemConfig("查看", false)); } addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() { public void onBeforeSelection( BeforeSelectionEvent<Widget> event) { if (event.getItem() == getViewTab()) { if(editTab.getNewContent()!=null){ getViewTab().refresh(editTab.getNewContent()); }else if (model.getContent() != null) { getViewTab().refresh(model.getContent()); } }else if(event.getItem()==getEditTab()){ getEditTab().getCodeMirror().refresh(); }else if(event.getItem() == getHistoryTab()){ getHistoryTab().refresh(); } } }); }
public HiveWord(PlatformContext context, WordPresenter presenter, FileModel fmodel) { super(context, presenter); this.model = fmodel; if (fmodel.isAdmin() || context.getUser().isSuper()) { add(getEditTab(), new TabItemConfig("编辑", false)); add(getHistoryTab(), new TabItemConfig("调试历史", false)); setActiveWidget(editTab); } else { add(getViewTab(), new TabItemConfig("查看", false)); } addBeforeSelectionHandler(new BeforeSelectionHandler<Widget>() { @Override public void onBeforeSelection(BeforeSelectionEvent<Widget> event) { if (event.getItem() == getViewTab()) { if (editTab.getNewContent() != null) { getViewTab().refresh(editTab.getNewContent()); } else if (model.getContent() != null) { getViewTab().refresh(model.getContent()); } } else if (event.getItem() == getEditTab()) { getEditTab().getCodeMirror().refresh(); } else if (event.getItem() == getHistoryTab()) { getHistoryTab().refresh(); } } }); }
public void makeUI() { spacialOpsTabs.addSelectionHandler(new SelectionHandler<Integer>() { public void onSelection(SelectionEvent<Integer> event) { if (tabUpdateOn) updateSelectedTab(); } }); spacialOpsTabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> ev) { preSelectedTab(ev.getItem()); } }); makeSingle(); makeIbeSingle(); makeMulti(); makeIbeMulti(); makePolygon(); makeAllSky(); reinitTabPane(true, true, true, true, true, true); mainPanel.add(spacialOpsTabs); spacialOpsTabs.setSize("100%", "100%"); // mainPanel.setSize("700px", "245px"); mainPanel.setSize("600px", NORMAL_HEIGHT_REQUIRED+"px"); GwtUtil.setStyle(mainPanel,"paddingTop", PADDING_TOP+"px"); }
public PreferencePanel() { //populatePreferences(); String[] items = WebProp.getItems(PROP_BASE); groupPanels = new PrefGroupPanel[items.length]; int idx = 0; for (String s : items) { // construct tab String title = WebProp.getTitle(PROP_BASE+"."+s); groupPanels[idx] = new PrefGroupPanel(PROP_BASE+"."+s+".field"); tabs.addTab(groupPanels[idx], title); idx++; } panel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); panel.add(grid); panel.addStyleName("content-panel"); WebAppProperties wap = Application.getInstance().getProperties(); hasViewAll = wap.getBooleanProperty(PROP_BASE+".hasViewAll"); if (hasViewAll) { tabs.addTab(panel, "View All"); } // make sure preference view is in sync with the latest updates tabs.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> ev) { int tabIndex= ev.getItem(); if (hasViewAll && tabIndex == tabs.getWidgetCount()-1) { populatePreferences(); } lastTab = tabIndex; } }); tabs.setSize("99%", "99%"); tabs.selectTab(0); initWidget(tabs); }
protected void onRender(Element parent, int index) { super.onRender(parent, index); topStatistics.setWidth("100%"); topStatistics.setHeight("30"); topDate.setHeight("30"); searchconditions.setWidth("100%"); add(topStatistics); add(getTopDate()); add(searchconditions); searchconditions.setHorizontalAlignment(searchconditions.ALIGN_CENTER); tabPanel.setWidth("100%"); tabPanel.setAnimationEnabled(true); tabPanel.add(orderReportPanel , "订单概况"); tabPanel.add(shippingReportPanel , "配送方式"); tabPanel.add(payReportPanel , "支付方式"); tabPanel.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> sender) { int tabIndex = sender.getItem(); if(tabIndex == 0){ setOrderReportPanel(); }else if(tabIndex == 1){ setShippingReportPanel(); }else if(tabIndex == 2){ setPayReportPanel(); }else{ System.out.println("Error in tab select"); } } }); searchconditions.add(tabPanel); }
/** {@inheritDoc} */ @Override public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Node> handler) { return ensureHandlers().addHandler(BeforeSelectionEvent.getType(), handler); }
public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Integer> h) { return tabPanel.addBeforeSelectionHandler(h); }
@Override public HandlerRegistration addBeforeSelectionHandler(BeforeSelectionHandler<Integer> handler) { return addHandler(handler, BeforeSelectionEvent.getType()); }
@Override public HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler<PartDefinition> handler) { return addHandler(handler, BeforeSelectionEvent.getType()); }
public HandlerRegistration addBeforeSelectionHandler( BeforeSelectionHandler<Integer> handler) { return addHandler(handler, BeforeSelectionEvent.getType()); }