List of usage examples for com.google.gwt.user.client.ui Widget setWidth
public void setWidth(String width)
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Region makeBanner() { BaseRegion r = new BaseRegion(BANNER_REGION); Widget w = r.getDisplay(); w.setWidth("100%"); return r;/* w w w. j av a2s .c o m*/ }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Region makeSmallIcon() { BaseRegion r = new BaseRegion(SMALL_ICON_REGION); r.setAlign(BaseRegion.ALIGN_MIDDLE); Widget w = r.getDisplay(); w.setWidth("100%"); return r;//from ww w. j a v a2 s. com }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Region makeSmallIcon2() { BaseRegion r = new BaseRegion(SMALL_ICON_REGION2); r.setAlign(BaseRegion.ALIGN_MIDDLE); Widget w = r.getDisplay(); w.setWidth("100%"); return r;// www .j a v a 2s. c o m }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Region makeSearchTitle() { BaseRegion r = new BaseRegion(SEARCH_TITLE_REGION); Widget w = r.getDisplay(); w.setStyleName("result-title"); w.setWidth("100%"); return r;/*from www . ja va2s.co m*/ }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Region makeSearchDesc() { BaseRegion r = new BaseRegion(SEARCH_DESC_REGION); Widget w = r.getDisplay(); w.setStyleName("result-desc"); w.setWidth("100%"); return r;//from w w w . j av a2 s .c om }
From source file:edu.caltech.ipac.firefly.core.layout.AbstractLayoutManager.java
protected Widget makeCenter() { final DockPanel resultsView = new DockPanel(); resultsView.setSize("100%", "100%"); final BaseRegion content = new BaseRegion(CONTENT_REGION); Widget w = content.getDisplay(); w.setWidth("100%"); addRegion(content);//from www . j av a 2 s . c o m final Region query = getForm(); final Region results = getResult(); final Region title = getSearchTitle(); final Region desc = getSearchDesc(); GwtUtil.ImageButton img = GwtUtil.makeImageButton("images/disclosurePanelClosed.png", "Return to search", new ClickHandler() { public void onClick(ClickEvent event) { Application.getInstance().processRequest(new Request(SearchCmd.COMMAND_NAME)); } }); boolean backToArrow = Application.getInstance().getProperties() .getBooleanProperty("BackToSearch.arrow.show", true); boolean searchDescLine = Application.getInstance().getProperties().getBooleanProperty("BackToSearch.show", true); final HorizontalPanel ttdesc = new HorizontalPanel(); if (title != null && searchDescLine) { ttdesc.setWidth("100%"); if (backToArrow) { ttdesc.add(img); } ttdesc.add(title.getDisplay()); ttdesc.add(desc.getDisplay()); ttdesc.setCellWidth(desc.getDisplay(), "100%"); ttdesc.add(layoutSelector); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { ttdesc.setVisible(Application.getInstance().hasSearchResult()); } }); } // final Region download = getDownload(); VerticalPanel vp = new VerticalPanel(); vp.setWidth("100%"); if (query.getDisplay() != null) { vp.add(query.getDisplay()); } if (searchDescLine) vp.add(ttdesc); resultsView.add(vp, DockPanel.NORTH); resultsView.setCellHeight(vp, "10px"); resultsView.add(results.getDisplay(), DockPanel.CENTER); resultsView.add(content.getDisplay(), DockPanel.SOUTH); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (DROPDOWN_REGION.equals(source.getId()) || RESULT_REGION.equals(source.getId())) { content.hide(); resultsView.setCellHeight(results.getDisplay(), "100%"); resultsView.setCellHeight(content.getDisplay(), ""); } else if (CONTENT_REGION.equals(source.getId())) { query.hide(); results.hide(); resultsView.setCellHeight(content.getDisplay(), "100%"); resultsView.setCellHeight(results.getDisplay(), ""); } } }); Region popoutRegion = getRegion(POPOUT_REGION); // SimplePanel popoutView = new SimplePanel(); // popoutView.add(popoutRegion.getDisplay()); final DeckPanel center = new DeckPanel(); center.add(resultsView); center.add(popoutRegion.getDisplay()); WebEventManager.getAppEvManager().addListener(Name.REGION_SHOW, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(1); } else if (RESULT_REGION.equals(source.getId())) { center.showWidget(0); } } }); WebEventManager.getAppEvManager().addListener(Name.REGION_HIDE, new WebEventListener() { public void eventNotify(WebEvent ev) { Region source = (Region) ev.getSource(); if (POPOUT_REGION.equals(source.getId())) { center.showWidget(0); } } }); center.showWidget(0); return center; }
From source file:edu.caltech.ipac.firefly.ui.GwtUtil.java
public static final Widget createWidgetFromFieldGroup(Form searchForm, FieldGroupTag fg, FormHub formHub) { // check download restrictions String dlRestrict = fg.getDownloadRestriction(); if (dlRestrict != null) { String[] dlArr = dlRestrict.split("="); String dlKey = dlArr[0];/*from w ww. j a va 2 s. c o m*/ String dlVal = dlArr[1]; InputField inF = searchForm.getField(dlKey); if (inF != null && inF.isVisible()) { String fieldDefValue = inF.getValue(); if (dlVal.equals(fieldDefValue) || (dlVal.equals("*") && fieldDefValue.length() > 0)) { // continue } else { return null; } } else { return null; } } // check role access boolean access = DynUtils.checkRoleAccess(fg.getAccess()); if (!access) { return null; } List<Widget> widgetList = new ArrayList<Widget>(); String fgType = fg.getType(); if (fgType.equalsIgnoreCase("tabPane")) { TabPane tp = new TabPane(); String tabHeight = fg.getHeight(); String tabWidth = fg.getWidth(); tp.setSize(tabWidth, tabHeight); if (BrowserUtil.isBrowser(Browser.FIREFOX)) { //tp.getDeckPanel().setSize("97%", "85%"); } List<UIComponent> uiCompList = fg.getUIComponents(); for (UIComponent uiComp : uiCompList) { if (uiComp instanceof FieldGroupTag) { FieldGroupTag fgChild = (FieldGroupTag) uiComp; Widget w = createWidgetFromFieldGroup(searchForm, fgChild, formHub); if (w != null) { tp.addTab(w, fgChild.getTitle()); } } } String tpName = fg.getTypeName(); if (!StringUtils.isEmpty(tpName)) { tp.setTabPaneName(tpName); formHub.bind(tp, tpName); } tp.selectTab(0); widgetList.add(tp); } else if (fgType.equalsIgnoreCase("activeTabPane")) { ActiveTabPane atp = new ActiveTabPane(); String tabHeight = fg.getHeight(); String tabWidth = fg.getWidth(); atp.setSize(tabWidth, tabHeight); if (BrowserUtil.isBrowser(Browser.FIREFOX)) { //atp.getDeckPanel().setSize("97%", "85%"); } List<UIComponent> uiCompList = fg.getUIComponents(); for (UIComponent uiComp : uiCompList) { if (uiComp instanceof FieldGroupTag) { FieldGroupTag fgChild = (FieldGroupTag) uiComp; Widget w = createWidgetFromFieldGroup(searchForm, fgChild, formHub); if (w != null) { atp.addTab(w, fgChild.getTitle()); } } } atp.selectTab(0); String atpName = fg.getTypeName(); if (!StringUtils.isEmpty(atpName)) { atp.setTabPaneName(atpName); formHub.bind(atp, atpName); } widgetList.add(atp); } else if (fgType.equalsIgnoreCase("DatePanel")) { DatePanel dp = new DatePanel(24 * 60 * 60); dp.setIntervalViolationError("Observation Date searches can only cover one 24 hour period."); widgetList.add(dp); } else { List<UIComponent> uiCompList = fg.getUIComponents(); WidgetFactory wfactory = Application.getInstance().getWidgetFactory(); for (UIComponent uiComp : uiCompList) { if (uiComp instanceof FieldGroupTag) { FieldGroupTag fgChild = (FieldGroupTag) uiComp; Widget w = createWidgetFromFieldGroup(searchForm, fgChild, formHub); if (w != null) { widgetList.add(w); } } else if (uiComp instanceof PreDefFieldTag) { PreDefFieldTag pdf = (PreDefFieldTag) uiComp; String id = pdf.getId(); Widget w = wfactory.createFormWidget(id, DynUtils.convertParams(pdf.getParams())); if (w instanceof UsesFormHub) { ((UsesFormHub) w).bind(formHub); } widgetList.add(w); } else if (uiComp instanceof LabelTag) { LabelTag xl = (LabelTag) uiComp; HTML hl = new HTML(xl.getHtmlString()); widgetList.add(hl); } else if (uiComp instanceof HelpTag) { HelpTag h = (HelpTag) uiComp; Widget icon = HelpManager.makeHelpIcon(h.getHelpId()); HTML text = GwtUtil.makeFaddedHelp(" " + h.getTitle() + " "); HorizontalPanel hp = new HorizontalPanel(); hp.add(text); hp.add(icon); widgetList.add(hp); } else if (uiComp instanceof FieldDefSource) { FieldDefSource fds = (FieldDefSource) uiComp; widgetList.add(FormBuilder.createField(fds)); } } } String spacing = fg.getSpacing(); if (spacing == null) spacing = "0"; FormBuilder.Config.Direction dir = FormBuilder.Config.Direction.VERTICAL; if (fg.getDirection().equalsIgnoreCase("horizontal")) { dir = FormBuilder.Config.Direction.HORIZONTAL; } Widget w = FormBuilder.createPanel(new FormBuilder.Config(dir, fg.getLabelWidth(), Integer.parseInt(spacing), HorizontalPanel.ALIGN_LEFT), widgetList.toArray(new Widget[widgetList.size()])); if (w instanceof VerticalPanel) { ((VerticalPanel) w).setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); } else if (w instanceof HorizontalPanel) { ((HorizontalPanel) w).setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); } String wWidth = fg.getWidth(); if (wWidth != null && wWidth.length() > 0) w.setWidth(wWidth); String wHeight = fg.getHeight(); if (wHeight != null && wHeight.length() > 0) w.setHeight(wHeight); Widget rval = w; if (fgType.equalsIgnoreCase("CollapsiblePanel")) { String fgTitle = fg.getTitle(); CollapsiblePanel cp = new CollapsiblePanel(fgTitle, w, false); String cpName = fg.getTypeName(); if (!StringUtils.isEmpty(cpName)) { cp.setPanelName(cpName); formHub.bind(cp, cpName); } rval = cp; } else if (fgType.equalsIgnoreCase("ActiveCollapsiblePanel")) { String fgTitle = fg.getTitle(); ActiveCollapsiblePanel acp = new ActiveCollapsiblePanel(fgTitle, w, false); String cpName = fg.getTypeName(); if (!StringUtils.isEmpty(cpName)) { acp.setPanelName(cpName); formHub.bind(acp, cpName); } rval = acp; } else if (fgType.equalsIgnoreCase("Frame")) { rval = createShadowTitlePanel(w, ""); } if (fg.getXid() != null) { rval.getElement().setId(fg.getXid()); } return rval; }
From source file:edu.caltech.ipac.firefly.ui.PopupUtil.java
public static void showMinimalMsg(final Widget parent, final String msg, final int autoCloseSec, final PopupPane.Align align, final int width) { boolean autoClose = autoCloseSec > 0; Widget msgW = makeMsg(msg, INFO_MSG_STYLE); msgW.setWidth(width + "px"); final PopupPane popup = new PopupPane("", msgW, PopupType.STANDARD, false, false, autoClose, PopupPane.HeaderType.NONE);/*from ww w . j a va 2 s . com*/ popup.setRolldownAnimation(true); popup.alignTo(parent, align, 0, -3); popup.show(autoCloseSec); }
From source file:edu.caltech.ipac.firefly.ui.PopupUtil.java
public static void showMinimalMsg(final Widget parent, final Widget msg, final int autoCloseSec, final PopupPane.Align align, final int width) { boolean autoClose = autoCloseSec > 0; Widget msgW = makeMsg(msg, INFO_MSG_STYLE, false); msgW.setWidth(width + "px"); final PopupPane popup = new PopupPane("", msgW, PopupType.STANDARD, false, false, autoClose, PopupPane.HeaderType.NONE);//from w ww . j a v a 2 s .c om popup.setRolldownAnimation(true); popup.alignTo(parent, align, 0, -3); popup.show(autoCloseSec); }
From source file:edu.caltech.ipac.firefly.ui.table.TableFilterSupport.java
public void onUpdateHeaders(List<ColumnDefinition<TableData.Row, ?>> colDefs) { int numColumns = colDefs.size(); filterBoxes.clear();//from w ww . ja v a 2 s. c om for (int i = 0; i < numColumns; i++) { ColDef colDef = (ColDef) colDefs.get(i); if (colDef.isImmutable()) continue; String[] vals = colDef.getColumn() == null ? null : colDef.getColumn().getEnums(); Widget field = null; if (vals != null && vals.length > 0) { field = new EnumList(vals); } else { field = new TextBox(); GwtUtil.setStyle(field, "padding", "0px"); field.setTitle(TTIPS); field.setWidth("100%"); } final FilterBox fb = new FilterBox(colDef.getName(), field); table.getHeaderTable().setWidget(BasicPagingTable.FILTER_IDX, i, fb); fb.getElement().getParentElement().setPropertyString("type", "filter"); filterBoxes.add(fb); // add event listener to the textboxes fb.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { onFilterChanged(); } }); } table.getHeaderTable().getRowFormatter().setStyleName(BasicPagingTable.FILTER_IDX, "filterRow"); ensureFilterShow(); }