List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellHeight
public void setCellHeight(IsWidget w, String height)
From source file:at.ait.dme.yuma.client.colorpicker.ColorPicker.java
License:Artistic License
public ColorPicker() { // UI Drawing //------------------ hue = 0;//from w w w.j a va 2s.c om saturation = 100; brightness = 100; red = 255; green = 0; blue = 0; HorizontalPanel panel = new HorizontalPanel(); FlexTable table = new FlexTable(); // Add the large slider map slidermap = new SliderMap(this); panel.add(slidermap); panel.setCellWidth(slidermap, "258px"); panel.setCellHeight(slidermap, "258px"); // Add the small slider bar sliderbar = new SliderBar(this); panel.add(sliderbar); panel.setCellWidth(sliderbar, "40px"); panel.setCellHeight(sliderbar, "258px"); // Define the Flextable's content // Color preview at the top colorpreview = new HTML(""); colorpreview.setWidth("50px"); colorpreview.setHeight("50px"); DOM.setStyleAttribute(colorpreview.getElement(), "border", "1px solid black"); // Radio buttons rbHue = new RadioButton("color", "H:"); rbHue.addClickHandler(this); rbSaturation = new RadioButton("color", "S:"); rbSaturation.addClickHandler(this); rbBrightness = new RadioButton("color", "V:"); rbBrightness.addClickHandler(this); rbRed = new RadioButton("color", "R:"); rbRed.addClickHandler(this); rbGreen = new RadioButton("color", "G:"); rbGreen.addClickHandler(this); rbBlue = new RadioButton("color", "B:"); rbBlue.addClickHandler(this); // Textboxes tbHue = new TextBox(); tbHue.setText(new Integer(hue).toString()); tbHue.setMaxLength(3); tbHue.setVisibleLength(4); tbHue.addKeyPressHandler(this); tbHue.addChangeHandler(this); tbSaturation = new TextBox(); tbSaturation.setText(new Integer(saturation).toString()); tbSaturation.setMaxLength(3); tbSaturation.setVisibleLength(4); tbSaturation.addKeyPressHandler(this); tbSaturation.addChangeHandler(this); tbBrightness = new TextBox(); tbBrightness.setText(new Integer(brightness).toString()); tbBrightness.setMaxLength(3); tbBrightness.setVisibleLength(4); tbBrightness.addKeyPressHandler(this); tbBrightness.addChangeHandler(this); tbRed = new TextBox(); tbRed.setText(new Integer(red).toString()); tbRed.setMaxLength(3); tbRed.setVisibleLength(4); tbRed.addKeyPressHandler(this); tbRed.addChangeHandler(this); tbGreen = new TextBox(); tbGreen.setText(new Integer(green).toString()); tbGreen.setMaxLength(3); tbGreen.setVisibleLength(4); tbGreen.addKeyPressHandler(this); tbGreen.addChangeHandler(this); tbBlue = new TextBox(); tbBlue.setText(new Integer(blue).toString()); tbBlue.setMaxLength(3); tbBlue.setVisibleLength(4); tbBlue.addKeyPressHandler(this); tbBlue.addChangeHandler(this); tbHexColor = new TextBox(); tbHexColor.setText("ff0000"); tbHexColor.setMaxLength(6); tbHexColor.setVisibleLength(6); tbHexColor.addKeyPressHandler(this); tbHexColor.addChangeHandler(this); // Put together the FlexTable table.setWidget(0, 0, colorpreview); table.getFlexCellFormatter().setColSpan(0, 0, 3); table.setWidget(1, 0, rbHue); table.setWidget(1, 1, tbHue); table.setWidget(1, 2, new HTML("°")); table.setWidget(2, 0, rbSaturation); table.setWidget(2, 1, tbSaturation); table.setText(2, 2, "%"); table.setWidget(3, 0, rbBrightness); table.setWidget(3, 1, tbBrightness); table.setText(3, 2, "%"); table.setWidget(4, 0, rbRed); table.setWidget(4, 1, tbRed); table.setWidget(5, 0, rbGreen); table.setWidget(5, 1, tbGreen); table.setWidget(6, 0, rbBlue); table.setWidget(6, 1, tbBlue); table.setText(7, 0, "#:"); table.setWidget(7, 1, tbHexColor); table.getFlexCellFormatter().setColSpan(7, 1, 2); // Final setup panel.add(table); rbSaturation.setValue(true); setPreview("ff0000"); DOM.setStyleAttribute(colorpreview.getElement(), "cursor", "default"); // First event onClick(rbSaturation); initWidget(panel); }
From source file:com.allen_sauer.gwt.log.client.DivLogger.java
License:Apache License
/** * @deprecated/* ww w .j a v a 2 s . c o m*/ */ @Deprecated private FocusPanel makeHeader() { FocusPanel header; header = new FocusPanel(); HorizontalPanel masterPanel = new HorizontalPanel(); masterPanel.setWidth("100%"); header.add(masterPanel); final Label titleLabel = new Label("gwt-log", false); titleLabel.setStylePrimaryName(LogClientBundle.INSTANCE.css().logTitle()); HorizontalPanel buttonPanel = new HorizontalPanel(); levelButtons = new Button[levels.length]; for (int i = 0; i < levels.length; i++) { final int level = levels[i]; levelButtons[i] = new Button(LogUtil.levelToString(level)); buttonPanel.add(levelButtons[i]); levelButtons[i].addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ((Button) event.getSource()).setFocus(false); Log.setCurrentLogLevel(level); } }); } Button clearButton = new Button("Clear"); clearButton.addStyleName(LogClientBundle.INSTANCE.css().logClearButton()); DOM.setStyleAttribute(clearButton.getElement(), "color", "#00c"); clearButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ((Button) event.getSource()).setFocus(false); Log.clear(); } }); buttonPanel.add(clearButton); Button aboutButton = new Button("About"); aboutButton.addStyleName(LogClientBundle.INSTANCE.css().logClearAbout()); aboutButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { ((Button) event.getSource()).setFocus(false); Log.diagnostic("\n" // + "gwt-log-" + Log.getVersion() // + " - Runtime logging for your Google Web Toolkit projects\n" + // "Copyright 2007 Fred Sauer\n" + // "The original software is available from:\n" + // "\u00a0\u00a0\u00a0\u00a0http://allen-sauer.com/gwt/\n", null); } }); Button closeButton = new Button("X"); closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { logDockPanel.removeFromParent(); } }); masterPanel.add(titleLabel); masterPanel.add(buttonPanel); masterPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); masterPanel.add(aboutButton); masterPanel.add(closeButton); masterPanel.setCellHeight(titleLabel, "100%"); masterPanel.setCellWidth(titleLabel, "50%"); masterPanel.setCellWidth(aboutButton, "50%"); new MouseDragHandler(titleLabel); return header; }
From source file:com.audata.client.admin.KeywordPanel.java
License:Open Source License
/** * Public Constructor/*from ww w.j a v a 2s.c o m*/ * */ public KeywordPanel() { this.setSpacing(5); this.setSize("100%", "100%"); // add section title Label l = new Label(LANG.admin_keyword_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel kwhs = new HorizontalPanel(); kwhs.setSpacing(5); Label kl = new Label(LANG.keyword_hierarchy_Text()); kwhs.add(kl); this.hierarchies = new ListBox(); this.hierarchies.setWidth("150px"); this.hierarchies.setVisibleItemCount(1); this.hierarchies.addChangeListener(this); kwhs.add(this.hierarchies); this.newHierarchy = new Button(LANG.new_Text()); this.newHierarchy.addClickListener(this); kwhs.add(this.newHierarchy); this.delHierarchy = new Button(LANG.delete_Text()); this.delHierarchy.addClickListener(this); kwhs.add(this.delHierarchy); this.add(kwhs); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); hp.setSize("100%", "100%"); // add classification browser this.keywordBrowser = new KeywordBrowser("100%", "100%"); this.keywordBrowser.keywords.addTreeListener(this); this.keywordBrowser.setStyleName("audoc-browser"); this.keywordBrowser.setSize("100%", "100%"); hp.add(this.keywordBrowser); hp.setCellWidth(this.keywordBrowser, "50%"); hp.setCellHeight(this.keywordBrowser, "300px"); // form VerticalPanel vp = new VerticalPanel(); vp.addStyleName("audoc-form"); vp.setSpacing(5); // name field HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(5); Label n = new Label(LANG.name_Text()); n.setWidth("100px"); namePanel.add(n); this.name = new TextBox(); namePanel.add(this.name); vp.add(namePanel); // Buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); butPanel.add(this.save); this.delete = new Button(LANG.delete_Text()); this.delete.addClickListener(this); butPanel.add(this.delete); this.newTop = new Button(LANG.new_Text()); this.newTop.addClickListener(this); butPanel.add(this.newTop); this.newChild = new Button(LANG.new_child_Text()); this.newChild.addClickListener(this); butPanel.add(this.newChild); vp.add(butPanel); // add it all up! hp.add(vp); this.add(hp); this.getHierarchies(); }
From source file:com.audata.client.search.SearchPanel.java
License:Open Source License
public SearchPanel(AuDoc audoc, ArrayList criteria) { this.audoc = audoc; if (criteria != null) { this.searchTerms = criteria; } else {//w ww . j av a 2 s .c om if (AuDoc.state.containsKey("Search")) { this.searchTerms = (ArrayList) AuDoc.state.getItem("Search"); } else { this.searchTerms = new ArrayList(); } } this.setSize("100%", "100%"); this.setSpacing(4); Label title = new Label(LANG.search_Text()); title.addStyleName("audoc-sectionTitle"); this.add(title); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(4); hp.setSize("100%", "100%"); this.fieldsTree = new Tree(); this.fieldsTree.addTreeListener(this); //this.fieldsTree.setSize("100%", "100%"); this.fieldsTree.setHeight("90%"); this.fieldsTree.addStyleName("audoc-fieldTree"); hp.add(this.fieldsTree); this.buildSections(); this.getUDFs(); this.addStdFields(); VerticalPanel form = new VerticalPanel(); form.addStyleName("audoc-searchForm"); //form.setSize("100%","100%"); form.setWidth("250px"); form.setSpacing(4); HorizontalPanel fieldRow = new HorizontalPanel(); fieldRow.setSpacing(4); Label fieldLabel = new Label(LANG.field_Text()); this.fieldName = new Label(); this.fieldName.addStyleName("bold"); fieldRow.add(fieldLabel); fieldRow.add(this.fieldName); fieldRow.setCellWidth(fieldLabel, "100px"); fieldRow.setCellHorizontalAlignment(fieldLabel, HasAlignment.ALIGN_LEFT); form.add(fieldRow); this.valuePanel = new HorizontalPanel(); this.valuePanel.setSpacing(4); Label valueLabel = new Label(LANG.criteria_Text()); TextBox value = new TextBox(); this.valuePanel.add(valueLabel); this.valuePanel.add(value); this.valuePanel.setCellWidth(valueLabel, "100px"); this.valuePanel.setCellHorizontalAlignment(valueLabel, HasAlignment.ALIGN_LEFT); form.add(this.valuePanel); HorizontalPanel andOr = new HorizontalPanel(); andOr.setSpacing(4); this.and = new RadioButton("andOr", LANG.and_Text()); this.and.setChecked(true); this.or = new RadioButton("andOr", LANG.or_Text()); andOr.add(this.and); andOr.add(this.or); form.add(andOr); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(4); this.add = new Button(LANG.add_Text()); this.add.addClickListener(this); buttons.add(this.add); this.clear = new Button(LANG.clear_Text()); this.clear.addClickListener(this); buttons.add(this.clear); form.add(buttons); this.criteria = new ListBox(); this.criteria.setVisibleItemCount(10); this.criteria.setWidth("100%"); form.add(this.criteria); HorizontalPanel buttons2 = new HorizontalPanel(); buttons2.setSpacing(4); this.search = new Button(LANG.search_Text()); this.search.addClickListener(this); buttons2.add(this.search); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); buttons2.add(this.save); form.add(buttons2); hp.add(form); hp.setCellHeight(this.fieldsTree, "100%"); this.add(hp); this.paintCriteria(); }
From source file:com.dimdim.conference.ui.resources.client.ResourceTypeListEntryPopupPanel.java
License:Open Source License
private void writeListPanel(DockPanel outer) { Vector vec = new Vector(); UIResourceObject currentActiveResource = ConferenceGlobals.getCurrentSharedResource(); numberOfItems = 0;/*from w w w . j av a 2 s . com*/ int size = this.resourceList.getListSize(); for (int i = 0; i < size; i++) { UIResourceObject res = ((ResourceListEntry) this.resourceList.getListEntryAt(i)).getResource(); if (res.getResourceType().equals(this.typeName)) { Label resLabel = new FixedLengthLabel(res.getResourceName(), 26); // resLabel.setStyleName("tool-entry"); resLabel.setStyleName("resource-entry"); resLabel.addStyleName("anchor-cursor"); resLabel.addClickListener(this); resLabel.addClickListener(this.rtpcp.getNameLabelClickListener(res)); HorizontalPanel h1 = new HorizontalPanel(); Widget img = new HorizontalPanel(); if (currentActiveResource != null && currentActiveResource.getResourceId().equals(res.getResourceId())) { img = this.getSharingInProgressImageUrl(); // h2.add(img); // h2.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE); // h2.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_CENTER); } else { img = new Label(" "); img.setWidth("18px"); // h2.add(filler); } // h2.setWidth("18px"); h1.add(img); // h1.setCellWidth(img, "100%"); h1.setCellHeight(img, "100%"); h1.setCellHorizontalAlignment(img, HorizontalPanel.ALIGN_LEFT); h1.setCellVerticalAlignment(img, VerticalPanel.ALIGN_MIDDLE); h1.add(resLabel); h1.setCellWidth(resLabel, "100%"); h1.setCellHeight(resLabel, "100%"); h1.setCellVerticalAlignment(resLabel, VerticalPanel.ALIGN_MIDDLE); h1.setStyleName("resource-entry-panel"); if (numberOfItems == 0) { h1.addStyleName("first-resource-entry-panel"); } resLabel.addMouseListener(new ResourceHoverStyler(h1)); vec.add(h1); // panel.add(h1); // panel.setCellWidth(h1, "100%"); // panel.setCellHorizontalAlignment(h1, HorizontalPanel.ALIGN_LEFT); // panel.setCellVerticalAlignment(h1, VerticalPanel.ALIGN_MIDDLE); numberOfItems++; } } if (numberOfItems != 0) { int scrollLimit = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_limit", 5); if (numberOfItems > scrollLimit) { ScrollPanel sp = new ScrollPanel(); int width = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_width", 250); int barWidth = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_bar_width", 250); int height = UIParams.getUIParams().getBrowserParamIntValue("resource_popup_scroll_height", 150); sp.setSize(width + "px", height + "px"); VerticalPanel panel = new VerticalPanel(); panel.setSize((width - barWidth) + "px", height + "px"); sp.add(panel); outer.add(sp, DockPanel.NORTH); outer.setCellHorizontalAlignment(sp, HorizontalPanel.ALIGN_LEFT); outer.setCellVerticalAlignment(sp, VerticalPanel.ALIGN_MIDDLE); int size2 = vec.size(); for (int i = 0; i < size2; i++) { HorizontalPanel h = (HorizontalPanel) vec.elementAt(i); panel.add(h); panel.setCellWidth(h, "100%"); panel.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT); panel.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE); } } else { int size2 = vec.size(); for (int i = 0; i < size2; i++) { HorizontalPanel h = (HorizontalPanel) vec.elementAt(i); outer.add(h, DockPanel.NORTH); outer.setCellWidth(h, "100%"); outer.setCellHorizontalAlignment(h, HorizontalPanel.ALIGN_LEFT); outer.setCellVerticalAlignment(h, VerticalPanel.ALIGN_MIDDLE); } } } else { } }
From source file:com.dimdim.conference.ui.user.client.UserListEntryHoverPopup.java
License:Open Source License
/** * This will create a menu item with one label * @param panel/*from w w w .j a va 2 s.co m*/ * @param labelText * @param clickListener * @param hideOnClick */ private void addMoodControl(VerticalPanel panel, String labelText, ClickListener clickListener, boolean hideOnClick) { HorizontalPanel imageNText = new HorizontalPanel(); // FocusPanel focusPanel = new FocusPanel(); Label lbl = new Label(labelText); lbl.setStyleName("user-menu-entry"); imageNText.add(lbl); imageNText.setCellHorizontalAlignment(lbl, HorizontalPanel.ALIGN_LEFT); HTML lbl2 = new HTML("»"); //lbl2.setStyleName("user-menu-item"); imageNText.add(lbl2); imageNText.setCellHorizontalAlignment(lbl2, HorizontalPanel.ALIGN_RIGHT); imageNText.setCellWidth(lbl, "100%"); imageNText.setCellHeight(lbl2, "100%"); imageNText.setWidth("100%"); //imageNText.setBorderWidth(1); // focusPanel.add(imageNText); if (null != clickListener) { HoverStyler hs = new HoverStyler(moodListener, imageNText, null); lbl.addMouseListener(hs); lbl.addStyleName("user-menu-entry-enabled"); lbl.addClickListener(clickListener); lbl2.addMouseListener(hs); lbl2.addClickListener(clickListener); } else { lbl.addStyleName("user-menu-entry-disabled"); } if (hideOnClick) { ClickListener clickListener2 = new ClickListener() { public void onClick(Widget w) { //Window.alert(" clicked on an item now hiding menu"); hide(); } }; lbl.addClickListener(clickListener2); } panel.add(imageNText); panel.setCellWidth(imageNText, "100%"); }
From source file:com.fullmetalgalaxy.client.game.context.MAppContext.java
License:Open Source License
public MAppContext() { super();//from ww w .j ava 2s . c om AppRoot.getEventBus().addHandler(ModelUpdateEvent.TYPE, this); VerticalPanel vpanel = new VerticalPanel(); vpanel.add(m_panelAction); vpanel.setCellHorizontalAlignment(m_panelAction, HasHorizontalAlignment.ALIGN_RIGHT); HorizontalPanel hpanel = new HorizontalPanel(); hpanel.add(m_panelExtra); hpanel.setCellHeight(m_panelExtra, "100%"); m_panelExtra.setHeight("100%"); hpanel.add(m_panelMiniMap); vpanel.add(hpanel); m_panelAction.add(new WgtContextAction()); m_panelAction.setStylePrimaryName("fmp-context-action"); m_panelMiniMap.setStylePrimaryName("fmp-context-minimap"); m_panelMiniMap.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); m_panelMiniMap.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); // m_panelMiniMap.addStyleName( "transparent50" ); m_panelExtra.add(new WgtContextExtra()); m_panelExtra.setStylePrimaryName("fmp-context-extra"); // m_panelExtra.addStyleName( "transparent50" ); initWidget(vpanel); hpanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); }
From source file:com.google.sampling.experiential.client.ExperimentRow.java
License:Open Source License
public ExperimentRow(Images resources, ExperimentDAO experiment, ExperimentListener listener, boolean joined, boolean findView) { this.images = resources; this.myConstants = GWT.create(MyConstants.class); this.experiment = experiment; this.joined = joined; this.findView = findView; this.listeners = new ArrayList<ExperimentListener>(); if (listener != null) { listeners.add(listener);/* ww w. ja va2 s .c om*/ } HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setStyleName("paco-experimentRow"); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setSpacing(1); horizontalPanel.setHeight("42px"); initWidget(horizontalPanel); Image experimentIcon = new Image(resources.question()); experimentIcon.setAltText(myConstants.experimentIcon()); horizontalPanel.add(experimentIcon); horizontalPanel.setCellHeight(experimentIcon, "42"); horizontalPanel.setCellWidth(experimentIcon, "42"); horizontalPanel.setCellHorizontalAlignment(experimentIcon, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(experimentIcon, HasVerticalAlignment.ALIGN_BOTTOM); experimentIcon.setSize("42px", "42px"); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHeight("39px"); horizontalPanel.add(verticalPanel); HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setHeight("19px"); verticalPanel.add(horizontalPanel_2); Label experimentTitleLabel = new Label(experiment.getTitle()); if (experiment.getDeleted() != null && experiment.getDeleted()) { experimentTitleLabel.setStyleName("gwt-Link-underline-strikethrough"); } else { experimentTitleLabel.setStyleName("gwt-Link-underline"); } horizontalPanel_2.add(experimentTitleLabel); horizontalPanel_2.setCellWidth(experimentTitleLabel, "22px"); horizontalPanel_2.setCellHeight(experimentTitleLabel, "18px"); experimentTitleLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel.setCellVerticalAlignment(experimentTitleLabel, HasVerticalAlignment.ALIGN_MIDDLE); experimentTitleLabel.setWidth("180px"); ClickHandler titleHandler = new ClickHandler() { public void onClick(ClickEvent event) { showExperimentDetails(); } }; if (!isExperimentPurged()) { experimentTitleLabel.addClickHandler(titleHandler); experimentIcon.addClickHandler(titleHandler); } HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setSpacing(1); verticalPanel.add(horizontalPanel_1); createButtonPanel(experiment, joined, horizontalPanel, horizontalPanel_1, findView); }
From source file:com.ikon.frontend.client.widget.dashboard.keymap.KeyMapDashboard.java
License:Open Source License
/** * KeyMapDashboard/*from w ww . j a v a 2 s .co m*/ */ public KeyMapDashboard() { horizontalSplitPanel = new HorizontalSplitPanel(); keyAllTable = new KeywordWidget(Main.i18n("dashboard.keyword.all")); keyTopTable = new KeywordWidget(Main.i18n("dashboard.keyword.top")); keyRelatedTable = new KeywordWidget(Main.i18n("dashboard.keyword.related")); allKeywordList = new ArrayList<GWTKeyword>(); relatedKeywordList = new ArrayList<GWTKeyword>(); rateMap = new HashMap<String, String>(); HTML space = new HTML(" "); flowPanelDivisor = new HTML(" "); tagCloud = new TagCloud(); table = new KeyMapTable(); VerticalPanel contentPanel = new VerticalPanel(); contentPanel.add(tagCloud); contentPanel.add(space); contentPanel.add(flowPanelDivisor); contentPanel.add(table); contentPanel.setWidth("100%"); tagCloud.setWidth("100%"); space.setWidth("100%"); space.setHeight("10"); flowPanelDivisor.setWidth("100%"); flowPanelDivisor.setHeight("5"); scrollTable = new ScrollPanel(contentPanel); tagCloud.setStylePrimaryName("okm-cloudWrap"); flowPanelDivisor.setStyleName("okm-cloudSeparator"); table.addStyleName("okm-DisableSelect"); vPanel = new VerticalPanel(); controlPanel = new HorizontalPanel(); paginationPanel = new HorizontalPanel(); selectedKeyMap = new HashMap<String, Widget>(); multiWordSuggestKey = new MultiWordSuggestOracle(); keywordList = new ArrayList<String>(); suggestKey = new SuggestBox(multiWordSuggestKey); suggestKey.setHeight("20"); suggestKey.setText(Main.i18n("dashboard.keyword.suggest")); suggestKey.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { if ((char) KeyCodes.KEY_ENTER == event.getNativeKeyCode()) { selectKey(suggestKey.getText()); suggestKey.setText(""); } } }); suggestKey.getTextBox().addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (suggestKey.getText().equals(Main.i18n("dashboard.keyword.suggest"))) { suggestKey.setText(""); } } }); vPanel.add(controlPanel); vPanel.add(scrollTable); vPanel.add(paginationPanel); // Image control HorizontalPanel imageControlPanel = new HorizontalPanel(); HTML space1 = new HTML(); HTML space2 = new HTML(); small = new Image("img/icon/actions/description_small_disabled.gif"); small.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (table.getActualDetail() != KeyMapTable.VISIBLE_SMALL) { disableAllDetailIcons(); table.changeVisibilityDetail(KeyMapTable.VISIBLE_SMALL); small.setUrl("img/icon/actions/description_small.gif"); } } }); medium = new Image("img/icon/actions/description_medium.gif"); // It's enabled view by default medium.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (table.getActualDetail() != KeyMapTable.VISIBLE_MEDIUM) { disableAllDetailIcons(); table.changeVisibilityDetail(KeyMapTable.VISIBLE_MEDIUM); medium.setUrl("img/icon/actions/description_medium.gif"); } } }); big = new Image("img/icon/actions/description_big_disabled.gif"); big.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (table.getActualDetail() != KeyMapTable.VISIBLE_BIG) { disableAllDetailIcons(); table.changeVisibilityDetail(KeyMapTable.VISIBLE_BIG); big.setUrl("img/icon/actions/description_big.gif"); } } }); imageControlPanel.add(space1); imageControlPanel.add(small); imageControlPanel.add(medium); imageControlPanel.add(big); imageControlPanel.add(space2); imageControlPanel.setCellWidth(space1, "8"); imageControlPanel.setCellWidth(small, "21"); imageControlPanel.setCellWidth(medium, "21"); imageControlPanel.setCellWidth(big, "21"); imageControlPanel.setCellHeight(small, "20"); imageControlPanel.setCellHeight(medium, "20"); imageControlPanel.setCellHeight(big, "20"); imageControlPanel.setCellWidth(space2, "8"); imageControlPanel.setCellHorizontalAlignment(small, HasAlignment.ALIGN_CENTER); imageControlPanel.setCellHorizontalAlignment(medium, HasAlignment.ALIGN_CENTER); imageControlPanel.setCellHorizontalAlignment(big, HasAlignment.ALIGN_CENTER); imageControlPanel.setCellVerticalAlignment(small, HasAlignment.ALIGN_MIDDLE); imageControlPanel.setCellVerticalAlignment(medium, HasAlignment.ALIGN_MIDDLE); imageControlPanel.setCellVerticalAlignment(big, HasAlignment.ALIGN_MIDDLE); // KeyWords text keywordsTXT = new HTML(); keywordsTXT.setHTML("<b>" + Main.i18n("dashboard.keyword") + "</b>"); HTML space3 = new HTML(); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(keywordsTXT); hPanel.add(space3); hPanel.setCellWidth(space3, "8"); hPanel.setCellVerticalAlignment(keywordsTXT, HasAlignment.ALIGN_MIDDLE); selectedKeyPanel = new HorizontalPanel(); suggestKeyPanel = new HorizontalPanel(); HTML space4 = new HTML(); clean = new Image("img/icon/actions/clean_disabled.gif"); clean.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (selectedKeyMap.keySet().size() > 0) { // Resets keywordPanel for (String key : selectedKeyMap.keySet()) { selectedKeyPanel.remove((Widget) selectedKeyMap.get(key)); } selectedKeyMap = new HashMap<String, Widget>(); keyAllTable.unselectAllRows(); keyTopTable.unselectAllRows(); keyRelatedTable.unselectAllRows(); keyRelatedTable.setVisible(false); table.reset(); context.setSelectedIndex(posAllContext); controlSearchIn.refreshControl(0); getKeywordMap(); // Gets related keyMap refreshClean(); } } }); clean.setTitle(Main.i18n("dashboard.keyword.clean.keywords")); suggestKeyPanel.add(suggestKey); // Always must be the last suggestKeyPanel.add(space4); suggestKeyPanel.add(clean); suggestKeyPanel.setCellWidth(space4, "8"); suggestKeyPanel.setCellWidth(clean, "21"); suggestKeyPanel.setCellHorizontalAlignment(space4, HasAlignment.ALIGN_RIGHT); suggestKeyPanel.setCellVerticalAlignment(suggestKey, HasAlignment.ALIGN_MIDDLE); suggestKeyPanel.setCellVerticalAlignment(clean, HasAlignment.ALIGN_MIDDLE); selectedKeyPanel.add(hPanel); selectedKeyPanel.add(suggestKeyPanel); // Always must be the last selectedKeyPanel.setCellVerticalAlignment(hPanel, HasAlignment.ALIGN_MIDDLE); selectedKeyPanel.setCellVerticalAlignment(suggestKeyPanel, HasAlignment.ALIGN_MIDDLE); controlPanel.add(imageControlPanel); controlPanel.add(selectedKeyPanel); controlPanel.setCellWidth(imageControlPanel, "80"); controlPanel.setCellVerticalAlignment(imageControlPanel, HasAlignment.ALIGN_MIDDLE); controlPanel.setCellVerticalAlignment(selectedKeyPanel, HasAlignment.ALIGN_MIDDLE); // Pagination HorizontalPanel internalPaginationPanel = new HorizontalPanel(); context = new ListBox(); context.setStyleName("okm-Select"); int count = 0; posTaxonomy = count++; context.addItem(Main.i18n("leftpanel.label.taxonomy"), ""); if (templatesVisible) { posTemplates = count++; context.addItem(Main.i18n("leftpanel.label.templates"), ""); } if (personalVisible) { posPersonal = count++; context.addItem(Main.i18n("leftpanel.label.my.documents"), ""); } if (mailVisible) { posMail = count++; context.addItem(Main.i18n("leftpanel.label.mail"), ""); } if (trashVisible) { posTrash = count++; context.addItem(Main.i18n("leftpanel.label.trash"), ""); } posAllContext = count++; context.addItem(Main.i18n("leftpanel.label.all.repository"), ""); context.setSelectedIndex(posAllContext); context.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { controlSearchIn.executeSearch(limit); } }); resultPage = new ListBox(); resultPage.addItem("10", "10"); resultPage.addItem("20", "20"); resultPage.addItem("30", "30"); resultPage.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent event) { limit = Integer.valueOf(resultPage.getValue(resultPage.getSelectedIndex())); controlSearchIn.executeSearch(limit); } }); HTML space5 = new HTML(); HTML space6 = new HTML(); HTML space7 = new HTML(); resultPageTXT = new HTML(Main.i18n("search.page.results")); controlSearchIn = new ControlSearchIn(); controlSearchIn.refreshControl(0); internalPaginationPanel.add(space5); internalPaginationPanel.add(context); internalPaginationPanel.add(space6); internalPaginationPanel.add(resultPageTXT); internalPaginationPanel.add(space7); internalPaginationPanel.add(resultPage); internalPaginationPanel.setCellWidth(space5, "8"); internalPaginationPanel.setCellWidth(space6, "8"); internalPaginationPanel.setCellWidth(space7, "8"); internalPaginationPanel.setCellHorizontalAlignment(context, HasAlignment.ALIGN_LEFT); internalPaginationPanel.setCellVerticalAlignment(context, HasAlignment.ALIGN_MIDDLE); internalPaginationPanel.setCellVerticalAlignment(resultPageTXT, HasAlignment.ALIGN_MIDDLE); internalPaginationPanel.setCellVerticalAlignment(resultPage, HasAlignment.ALIGN_MIDDLE); HTML space8 = new HTML(); HTML space9 = new HTML(); paginationPanel.add(internalPaginationPanel); paginationPanel.add(space8); paginationPanel.add(controlSearchIn); paginationPanel.add(space9); paginationPanel.setCellWidth(space8, "8"); paginationPanel.setCellWidth(space9, "8"); paginationPanel.setCellHorizontalAlignment(internalPaginationPanel, HasAlignment.ALIGN_LEFT); paginationPanel.setCellVerticalAlignment(internalPaginationPanel, HasAlignment.ALIGN_MIDDLE); paginationPanel.setCellVerticalAlignment(controlSearchIn, HasAlignment.ALIGN_MIDDLE); paginationPanel.setCellHorizontalAlignment(controlSearchIn, HasAlignment.ALIGN_RIGHT); suggestKey.setStyleName("okm-KeyMap-Suggest"); suggestKey.addStyleName("okm-Input"); controlPanel.setStyleName("okm-KeyMapControl"); controlPanel.addStyleName("okm-NoWrap"); imageControlPanel.addStyleName("okm-NoWrap"); selectedKeyPanel.addStyleName("okm-NoWrap"); paginationPanel.setStyleName("okm-PaginationControl"); paginationPanel.addStyleName("okm-NoWrap"); internalPaginationPanel.addStyleName("okm-NoWrap"); keywordsTXT.addStyleName("okm-NoWrap"); resultPage.setStyleName("okm-Input"); resultPageTXT.addStyleName("okm-NoWrap"); hPanel.addStyleName("okm-NoWrap"); clean.setStyleName("okm-KeyMap-ImageHover"); small.setStyleName("okm-KeyMap-ImageHover"); medium.setStyleName("okm-KeyMap-ImageHover"); big.setStyleName("okm-KeyMap-ImageHover"); tagCloud.setStylePrimaryName("okm-cloudWrap"); VerticalPanel vKeyPanel = new VerticalPanel(); vKeyPanel.setWidth("100%"); vKeyPanel.add(keyRelatedTable); vKeyPanel.add(keyTopTable); vKeyPanel.add(keyAllTable); keyRelatedTable.setVisible(false); // By default related table is only visible when has some content horizontalSplitPanel.setRightWidget(vKeyPanel); horizontalSplitPanel.setLeftWidget(vPanel); initWidget(horizontalSplitPanel); }
From source file:com.ikon.frontend.client.widget.searchresult.SearchFullResult.java
License:Open Source License
/** * drawPropertyGroups//from ww w . ja v a2s. c o m * * @param docPath * @param propertyGroups * @param propertyGroupsPanel */ private void drawPropertyGroups(final String docPath, final List<GWTPropertyGroup> propertyGroups, final HorizontalPanel propertyGroupsPanel) { if (propertyGroups.size() > 0) { Status status = Main.get().mainPanel.search.searchBrowser.searchResult.status; status.setFlag_refreshPropertyGroups(); final GWTPropertyGroup propertyGroup = propertyGroups.remove(0); propertyGroupService.getProperties(docPath, propertyGroup.getName(), new AsyncCallback<List<GWTFormElement>>() { @Override public void onSuccess(List<GWTFormElement> result) { if (propertyGroupsPanel.getWidgetCount() == 0) { HTML label = new HTML(""); label.setStyleName("okm-Security-Title"); label.setHeight("15"); Image verticalLine = new Image("img/transparent_pixel.gif"); verticalLine.setStyleName("okm-Vertical-Line-Border"); verticalLine.setSize("2", "100%"); VerticalPanel vlPanel = new VerticalPanel(); vlPanel.add(label); vlPanel.add(verticalLine); vlPanel.setCellWidth(verticalLine, "7"); vlPanel.setCellHeight(verticalLine, "100%"); vlPanel.setHeight("100%"); propertyGroupsPanel.add(vlPanel); propertyGroupsPanel.setCellHorizontalAlignment(vlPanel, HasAlignment.ALIGN_LEFT); propertyGroupsPanel.setCellWidth(vlPanel, "7"); propertyGroupsPanel.setCellHeight(vlPanel, "100%"); } Image verticalLine = new Image("img/transparent_pixel.gif"); verticalLine.setStyleName("okm-Vertical-Line-Border"); verticalLine.setSize("2", "100%"); FormManager manager = new FormManager(); manager.setFormElements(result); manager.draw(true); // read only ! VerticalPanel vPanel = new VerticalPanel(); HTML label = new HTML(propertyGroup.getLabel()); label.setStyleName("okm-Security-Title"); label.setHeight("15"); vPanel.add(label); vPanel.add(manager.getTable()); propertyGroupsPanel.add(vPanel); propertyGroupsPanel.add(verticalLine); propertyGroupsPanel.setCellVerticalAlignment(vPanel, HasAlignment.ALIGN_TOP); propertyGroupsPanel.setCellHorizontalAlignment(verticalLine, HasAlignment.ALIGN_CENTER); propertyGroupsPanel.setCellWidth(verticalLine, "12"); propertyGroupsPanel.setCellHeight(verticalLine, "100%"); drawPropertyGroups(docPath, propertyGroups, propertyGroupsPanel); } @Override public void onFailure(Throwable caught) { Main.get().showError("drawPropertyGroups", caught); } }); } else { Status status = Main.get().mainPanel.search.searchBrowser.searchResult.status; status.unsetFlag_refreshPropertyGroups(); } }