/** * Create a Dynamic tree. The code comes from the GWT show case : * http://gwt.google.com/samples/Showcase/Showcase.html#!CwTabPanel */ @SuppressWarnings("deprecation") private DecoratedTabPanel createTabPanel() { // Create a tab panel DecoratedTabPanel tabPanel = new DecoratedTabPanel(); tabPanel.setWidth("400px"); tabPanel.setAnimationEnabled(true); // Add a home tab String[] tabTitles = {"Home", "GWT Logo", "More info"}; HTML homeText = new HTML("Click one of the tabs to see more content. <br/> You can drag me now !"); tabPanel.add(homeText, tabTitles[0]); // Add a tab with an image /* * VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new * Image(Showcase.images.gwtLogo())); */ // TODO add gwt logo VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new com.google.gwt.user.client.ui.Image(Image.INSTANCE.gwtLogo())); tabPanel.add(new com.google.gwt.user.client.ui.Image(Image.INSTANCE.gwtLogo()), tabTitles[1]); // Add a tab HTML moreInfo = new HTML("Tabs are highly customizable using CSS."); tabPanel.add(moreInfo, tabTitles[2]); // Return the content tabPanel.selectTab(0); tabPanel.ensureDebugId("cwTabPanel"); return tabPanel; }
private void addTabPanel() { DecoratedTabPanel tPanel = new DecoratedTabPanel(); tPanel.setWidth("450px"); for (int i = 1; i <= 5; i++) { Widget tabContent = new TabPanelSampleContent(i); String tabLabel = "Panel " + i; tPanel.add(tabContent, tabLabel); } tPanel.selectTab(0); tPanel.setAnimationEnabled(true); RootPanel.get("tab-panel").add(tPanel); }
private void initTabs() { // Create a tab panel final DecoratedTabPanel tabPanel = new DecoratedTabPanel(); tabPanel.setAnimationEnabled(true); for (final ContactModel contactModel : contactList) { final FlexTable o_layout = new FlexTable(); o_layout.setCellSpacing(6); FlexCellFormatter o_cellFormatter = o_layout.getFlexCellFormatter(); o_cellFormatter.setColSpan(0, 0, 2); tabPanel.add(o_layout, contactModel.getNikeName()); final ListBox dropBox = new ListBox(false); for (AlbumModel album : contactModel.getAlbumList()) { dropBox.addItem(album.getName()); } o_layout.setWidget(0, 0, dropBox); dropBox.addChangeHandler( new ChangeHandler() { @Override public void onChange(ChangeEvent event) { initPhotoLayout(contactModel, dropBox.getSelectedIndex(), o_layout); } }); tabPanel.addSelectionHandler( new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { FlexTable currentPhotoTable = (FlexTable) tabPanel.getWidget(event.getSelectedItem()); ListBox currentDropBox = (ListBox) currentPhotoTable.getWidget(0, 0); currentDropBox.setSelectedIndex(0); } }); initPhotoLayout(contactModel, 0, o_layout); } tabPanel.selectTab(0); RootPanel.get("kirin_tabs").add(tabPanel); }
public void loadTopHoriPanel() { final Irtk irtk = new Irtk(); bizPanel.setWidth("100px"); bizPanel.setAnimationEnabled(true); vendorPanel.add(revenueButton); bizPanel.add(vendorPanel, "Revenue"); irtk.topHoriPanel.add(bizPanel); RootPanel.get("topPanel").add(bizPanel); revenueButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { // RootPanel.get("flexTable").remove(irtk.flexTable); // irtk.flexTable.removeAllRows(); // RootPanel.get("flexTable").add(irtk.flexTable); dialogBox.setText("Testing"); } }); }
public void onModuleLoad() { RootPanel RootTXOriginal = RootPanel.get("Original"); RootPanel RootMenu = RootPanel.get("Menu"); RootTXOriginal.setSize("100%", "100%"); RootMenu.setStyleName("Root"); RootTXOriginal.setStyleName("Root"); MenuBar menuBar = new MenuBar(false); RootMenu.add(menuBar); menuBar.setWidth("100%"); mntmNewItem = new MenuItem("New item", false, (Command) null); mntmNewItem.setEnabled(false); mntmNewItem.setHTML("Language Editor : " + LenguajeActual.getName()); menuBar.addItem(mntmNewItem); MenuItemSeparator separator = new MenuItemSeparator(); menuBar.addSeparator(separator); MenuItem mntmNewItem_2 = new MenuItem( "New item", false, new Command() { public void execute() { int actual_widget = decoratedTabPanel.getDeckPanel().getVisibleWidget(); Widget WidgetActual = decoratedTabPanel.getDeckPanel().getWidget(actual_widget); { ((PanelDecorador) WidgetActual).saveAll(); } } }); mntmNewItem_2.setHTML("Save"); menuBar.addItem(mntmNewItem_2); MenuItemSeparator separator_1 = new MenuItemSeparator(); menuBar.addSeparator(separator_1); MenuItem mntmNewItem_1 = new MenuItem( "New item", false, new Command() { public void execute() { int actual_widget = decoratedTabPanel.getDeckPanel().getVisibleWidget(); // Window.alert(Integer.toString(actual_widget2)); // int actual_widget=event.getItem(); // Window.alert(Integer.toString(actual_widget)); Widget WidgetActual = decoratedTabPanel.getDeckPanel().getWidget(actual_widget); if (!((PanelDecorador) WidgetActual).isSaved()) if (Window.confirm( "The tab is modificated and not saved, Do you want to save the modification")) { ((PanelDecorador) WidgetActual).saveAll(); } Controlador.change2AdminLenguaje(); } }); mntmNewItem_1.setHTML("Back"); menuBar.addItem(mntmNewItem_1); decoratedTabPanel = new DecoratedTabPanel(); RootTXOriginal.add(decoratedTabPanel); decoratedTabPanel.setSize("100%", "100%"); String tamano = "875px"; // Esta encima porque sino salta error al setear la tab del decorador. MainWindowEditor MWE = new MainWindowEditor(LenguajeActual); decoratedTabPanel.add(MWE, "Main Window", true); MWE.setWidth(tamano); // Debajo de la declaracion sino da IndexOutOfBounds decoratedTabPanel.selectTab(0); // Ollente para pasar de pestaña decoratedTabPanel.addBeforeSelectionHandler( new BeforeSelectionHandler<Integer>() { public void onBeforeSelection(BeforeSelectionEvent<Integer> event) { int actual_widget = decoratedTabPanel.getDeckPanel().getVisibleWidget(); // Window.alert(Integer.toString(actual_widget2)); // int actual_widget=event.getItem(); // Window.alert(Integer.toString(actual_widget)); Widget WidgetActual = decoratedTabPanel.getDeckPanel().getWidget(actual_widget); if (!((PanelDecorador) WidgetActual).isSaved()) if (Window.confirm( "The tab is modificated and not saved, Do you want to save the modification")) ((PanelDecorador) WidgetActual).saveAll(); } }); SpecificationsEditor Specifications = new SpecificationsEditor(LenguajeActual); decoratedTabPanel.add(Specifications, "Specifications", true); Specifications.setWidth(tamano); FilterEditor Filter = new FilterEditor(LenguajeActual); decoratedTabPanel.add(Filter, "Filter", true); Filter.setWidth(tamano); AnnotationEditor Anotation = new AnnotationEditor(LenguajeActual); decoratedTabPanel.add(Anotation, "Annotation", true); Anotation.setWidth(tamano); BrowserEditor Browser = new BrowserEditor(LenguajeActual); decoratedTabPanel.add(Browser, "Browser", true); Browser.setWidth(tamano); VariosEditor varios = new VariosEditor(LenguajeActual); decoratedTabPanel.add(varios, "Others", true); varios.setWidth(tamano); }
public ItemDetailTouchScreenView() { // Handler Manager handlerManager = new HandlerManager(this); VerticalPanel verticalPanel = new VerticalPanel(); initWidget(verticalPanel); verticalPanel.setWidth("100%"); HeaderDeclarativeView headerView = new HeaderDeclarativeView(); headerView.setSize("100%", "100%"); verticalPanel.add(headerView); setHeaderDisplay(headerView); contentPanel = new VerticalPanel(); contentPanel.setSpacing(0); verticalPanel.add(contentPanel); contentPanel.setWidth("100%"); contentPanel.addStyleName("forFriendPanel"); itemTitlePanel = new ItemDetailTitlePanel(); contentPanel.add(itemTitlePanel); itemTitlePanel.setStyleName("itemDetail-Panel"); itemTitlePanel.setWidth("100%"); itemDetailTabPanel = new DecoratedTabPanel(); contentPanel.add(itemDetailTabPanel); itemDetailTabPanel.setSize("100%", "100%"); contentPanel.addStyleName("forFriendPanel"); offersPanel = new VerticalPanel(); tabOffers = new ItemDetailTabPanel(); tabOffers.setTabImageUrl("images/172-pricetag-disabled.png"); tabOffers.setTabDescriptionLabelText(MESSAGES.tabOffersText_text()); itemDetailTabPanel.add(offersPanel, tabOffers); offersPanel.setSize("100%", "100%"); offersPanel.setSpacing(0); placesPanel = new VerticalPanel(); tabPlaces = new ItemDetailTabPanel(); tabPlaces.setTabImageUrl("images/07-map-marker-disabled.png"); tabPlaces.setTabDescriptionLabelText(MESSAGES.tabPlacesText_text()); itemDetailTabPanel.add(placesPanel, tabPlaces); placesPanel.setSize("100%", "100%"); placesPanel.setSpacing(0); friendsPanel = new VerticalPanel(); tabFriends = new ItemDetailTabPanel(); tabFriends.setTabImageUrl("images/111-user-disabled.png"); tabFriends.setTabDescriptionLabelText(MESSAGES.tabFriendsText_text()); itemDetailTabPanel.add(friendsPanel, tabFriends); friendsPanel.setSize("100%", "100%"); friendsPanel.setSpacing(0); itemDetailTabPanel .getTabBar() .addSelectionHandler( new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { int selTab = event.getSelectedItem(); if (selTab == 0) { tabOffers.setTabImageUrl("images/172-pricetag.png"); tabPlaces.setTabImageUrl("images/07-map-marker-disabled.png"); tabFriends.setTabImageUrl("images/111-user-disabled.png"); } else if (selTab == 1) { tabPlaces.setTabImageUrl("images/07-map-marker.png"); tabOffers.setTabImageUrl("images/172-pricetag-disabled.png"); tabFriends.setTabImageUrl("images/111-user-disabled.png"); } else if (selTab == 2) { tabFriends.setTabImageUrl("images/111-user.png"); tabOffers.setTabImageUrl("images/172-pricetag-disabled.png"); tabPlaces.setTabImageUrl("images/07-map-marker-disabled.png"); } ; } }); }