List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellHorizontalAlignment
public void setCellHorizontalAlignment(IsWidget w, HorizontalAlignmentConstant align)
From source file:org.onecmdb.ui.gwt.itil.client.application.incident.screen.EditIncidentScreen.java
License:Open Source License
protected Widget getButtonPanel() { VerticalPanel vPanel = new VerticalPanel(); Label actionHeader = new Label("Take Action on this Incident", false); actionHeader.setStyleName("mdv-form-label"); vPanel.add(actionHeader);//w ww. j a v a2s. c om actionInfo = new HTML("This incident has status (Loading). <br/>" + "What do you like to do now?", true); actionInfo.setStyleName("one-action-header"); vPanel.add(actionInfo); // Action history AttributeRender render = new AttributeRender(); //actionHistory = render.getWidget(); Label actionNote = new Label("Action Note"); actionNote.setStyleName("mdv-form-label"); final NewTextFieldWidget field = new NewTextFieldWidget( (AttributeValue) addHistory.allocAttributeValue(null, null)); field.getBaseField().setVisible(false); actionHistory = new ValidateVerticalPanel(field); actionHistory.add(field); // Workaround to get the input box below label. // Didn't what to modify gwtiger framework right now.... final TextBox box = new TextBox(); box.addKeyboardListener(new KeyboardListener() { public void onKeyDown(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } public void onKeyPress(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } public void onKeyUp(Widget sender, char keyCode, int modifiers) { field.setText(box.getText()); } }); box.setStyleName("mdv-form-input"); actionHistory.add(box); //actionHistory = new NewTextFieldWidget("New Action", "250px"); //actionHistory.setRequired(true); //actionHistory.setStyleName("one-action-input"); // UI Action. Button ui = new Button("OK", new ClickListener() { public void onClick(Widget sender) { saveAs("ui", addHistory); } }); HorizontalPanel uiAction = new HorizontalPanel(); HTML uiText = new HTML("<b>Save this Incident with status <em>Open</em></b>"); uiText.setTitle("Update Action history and " + "save the Incident with status " + "<em>Open</em>."); uiAction.add(uiText); uiAction.add(ui); uiAction.setCellHorizontalAlignment(ui, HorizontalPanel.ALIGN_RIGHT); uiAction.setCellHorizontalAlignment(uiText, HorizontalPanel.ALIGN_LEFT); uiAction.setStyleName("incident-action-select"); // Close Action. Button close = new Button("Close", new ClickListener() { public void onClick(Widget sender) { saveAs("close", addHistory); } }); HorizontalPanel closeAction = new HorizontalPanel(); HTML closeText = new HTML("<b>Close and Archive this Incident</b>"); closeText.setTitle("Update Action history and " + "save the Incident with status " + "Closed."); closeAction.add(closeText); closeAction.add(close); closeAction.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT); closeAction.setCellHorizontalAlignment(closeText, HorizontalPanel.ALIGN_LEFT); closeAction.setStyleName("incident-action-select"); // New problem Button newProblem = new Button("OK", new ClickListener() { public void onClick(Widget sender) { saveAs("newProblem", addHistory); } }); HorizontalPanel newProblemAction = new HorizontalPanel(); HTML newProblemText = new HTML("<b>Associate this Incident with a <em>New Problem</em></b>"); newProblemText.setTitle("Update Action history, " + "create a new Problem and " + "link it to that Problem and save " + "the incident with status Problem"); newProblemAction.add(newProblemText); newProblemAction.add(newProblem); newProblemAction.setCellHorizontalAlignment(newProblem, HorizontalPanel.ALIGN_RIGHT); newProblemAction.setCellHorizontalAlignment(newProblemText, HorizontalPanel.ALIGN_LEFT); newProblemAction.setStyleName("incident-action-select"); // Find problem HorizontalPanel problemAction = new HorizontalPanel(); final Button problem = new Button("OK"); problem.addClickListener(getProblemSelector(true)); HTML problemText = new HTML("<b>Associate this Incident with an existing <em>Problem</em></b>"); problemText.setTitle( "Update Action history, " + "link it to a Problem and save the " + "incident with status Problem"); problemAction.add(problemText); problemAction.add(problem); problemAction.setCellHorizontalAlignment(problem, HorizontalPanel.ALIGN_RIGHT); problemAction.setCellHorizontalAlignment(problemText, HorizontalPanel.ALIGN_LEFT); problemAction.setStyleName("incident-action-select"); // Find Knownerror. HorizontalPanel knownErrorAction = new HorizontalPanel(); final Button error = new Button("OK"); error.addClickListener(getProblemSelector(false)); HTML errorText = new HTML("<b>Associate this Incident with an existing <em>Known Error</em></b>"); errorText.setTitle("Update Action history, " + "link it to a Known Error and save the " + "incident with status Known Error"); knownErrorAction.add(errorText); knownErrorAction.add(error); knownErrorAction.setCellHorizontalAlignment(error, HorizontalPanel.ALIGN_RIGHT); knownErrorAction.setCellHorizontalAlignment(errorText, HorizontalPanel.ALIGN_LEFT); knownErrorAction.setStyleName("incident-action-select"); vPanel.add(uiAction); vPanel.add(problemAction); vPanel.add(knownErrorAction); vPanel.add(newProblemAction); vPanel.add(closeAction); vPanel.add(actionHistory); return (vPanel); }
From source file:org.onecmdb.ui.gwt.itil.client.application.problem.screen.EditProblemScreen.java
License:Open Source License
public Widget getButtonPanel() { VerticalPanel vPanel = new VerticalPanel(); Label actionHeader = new Label("Take Action on this Problem", false); actionHeader.setStyleName("mdv-form-label"); vPanel.add(actionHeader);/*from w w w .j av a 2 s . c o m*/ actionInfo = new HTML("This Problem has status (Loading). <br/>" + "What do you like to do now?", true); actionInfo.setStyleName("one-action-header"); vPanel.add(actionInfo); // Action history AttributeRender render = new AttributeRender(); //actionHistory = render.getWidget(); Label actionNote = new Label("Action Note"); actionNote.setStyleName("mdv-form-label"); final NewTextFieldWidget field = new NewTextFieldWidget( (AttributeValue) addHistory.allocAttributeValue(null, null)); field.getBaseField().setVisible(false); actionHistory = new ValidateVerticalPanel(field); actionHistory.add(field); // Workaround to get the input box below label. // Didn't what to modify gwtiger framework right now.... final TextBox box = new TextBox(); box.addKeyboardListener(new KeyboardListener() { public void onKeyDown(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } public void onKeyPress(Widget sender, char keyCode, int modifiers) { // TODO Auto-generated method stub } public void onKeyUp(Widget sender, char keyCode, int modifiers) { field.setText(box.getText()); } }); box.setStyleName("mdv-form-input"); actionHistory.add(box); //actionHistory = new NewTextFieldWidget("New Action", "250px"); //actionHistory.setRequired(true); //actionHistory.setStyleName("one-action-input"); // UI Action. Button problem = new Button("OK", new ClickListener() { public void onClick(Widget sender) { saveAsProblem(); } }); HorizontalPanel problemAction = new HorizontalPanel(); HTML problemText = new HTML("<b>Save this Problem with status <em>Problem</em></b>"); problemText.setTitle("Update Action history and " + "save the Problem with status " + "<em>Problem</em>."); problemAction.add(problemText); problemAction.add(problem); problemAction.setCellHorizontalAlignment(problem, HorizontalPanel.ALIGN_RIGHT); problemAction.setCellHorizontalAlignment(problemText, HorizontalPanel.ALIGN_LEFT); problemAction.setStyleName("incident-action-select"); // Close Action. Button knownError = new Button("OK", new ClickListener() { public void onClick(Widget sender) { saveAsKnownError(); } }); HorizontalPanel knownErrorAction = new HorizontalPanel(); HTML knownErrorText = new HTML("<b>Save this Problem with status <em>Known Error</em></b>"); knownErrorText .setTitle("Update Action history and " + "save the Problem with status <em>" + "Known Error<em>"); knownErrorAction.add(knownErrorText); knownErrorAction.add(knownError); knownErrorAction.setCellHorizontalAlignment(knownError, HorizontalPanel.ALIGN_RIGHT); knownErrorAction.setCellHorizontalAlignment(knownErrorText, HorizontalPanel.ALIGN_LEFT); knownErrorAction.setStyleName("incident-action-select"); incidentConnectedPanel.setStyleName("incident-action-select"); vPanel.add(problemAction); vPanel.add(knownErrorAction); vPanel.add(actionHistory); vPanel.add(incidentConnectedPanel); return (vPanel); }
From source file:org.onecmdb.ui.gwt.modeller.client.view.screen.ListAttributeScreen.java
License:Open Source License
public void load() { if (this.currentTemplate == null) { setErrorText("No Template to show!"); return;//from ww w .j av a 2 s . c o m } setErrorText(""); setTitleText("Attributes for "); setTitleWidget(new CIIconDisplayNameWidget(this.currentTemplate)); vPanel.clear(); HTML add = new HTML("[<a href='javascript:;'>new</a>]"); add.setTitle("Add a new attribute to this template"); add.addClickListener(new ClickListener() { public void onClick(Widget sender) { OneCMDBModelCreator.get().showScreen(OneCMDBModelCreator.ADD_ATTRIBUTE_SCREEN, currentTemplate.getAlias(), new Long(0)); } }); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(add); hPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT); hPanel.setWidth("100%"); vPanel.add(hPanel); vPanel.add(getAttributeTable()); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.ci.CIIconDisplayNameWidget.java
License:Open Source License
public void load(GWT_CiBean bean) { vPanel.clear();//from w w w .ja v a 2s .c o m HorizontalPanel cipanel = new HorizontalPanel(); cipanel.add(new Image(OneCMDBUtils.getIconForCI(bean))); CIDisplayNameWidget display = new CIDisplayNameWidget(bean, clickListener); cipanel.add(display); cipanel.setCellWidth(display, "100%"); cipanel.setCellHorizontalAlignment(display, HorizontalPanel.ALIGN_LEFT); vPanel.add(cipanel); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.input.CIMultiValueWidget.java
License:Open Source License
protected Widget getMultiListAsList(final MultipleAttributeValue mValue) { final HorizontalPanel hPanel = new HorizontalPanel(); CIIconWidget icon = new CIIconWidget(mValue.getType()); icon.update();/*from w ww.j a v a2 s. co m*/ hPanel.setWidth("100%"); hPanel.add(icon); hPanel.setCellHorizontalAlignment(icon, HorizontalPanel.ALIGN_LEFT); Label name = new Label(mValue.getDisplayName()); hPanel.add(name); HorizontalPanel actionPanel = new HorizontalPanel(); actionPanel.setSpacing(6); if (!mValue.getCtrl().isReadonly()) { // Add action if (mValue.isComplex()) { addImage = new Image("images/eclipse/add_multi.gif"); addImage.setTitle("Select values to the multi valued attribute"); } else { addImage = new Image("images/eclipse/add_single.gif"); addImage.setTitle("Add one value to the multi valued attribute"); } actionPanel.add(addImage); // Delete all action Image deleteAllImage = new Image("images/delete-value.gif"); deleteAllImage.setTitle("Remove ALL values!"); actionPanel.add(deleteAllImage); deleteAllImage.addClickListener(new ClickListener() { public void onClick(Widget sender) { if (Window.confirm("Remove all values for attribute?")) { mValue.removeAttributeValues(); clearValues(); } } }); actionPanel.add(deleteAllImage); } // Expand action expandImage = new Image(); expandImage.addClickListener(new ClickListener() { public void onClick(Widget sender) { setExpandState(!expandState); } }); setExpandState(true); actionPanel.add(expandImage); actionPanel.setCellVerticalAlignment(expandImage, VerticalPanel.ALIGN_MIDDLE); hPanel.add(actionPanel); hPanel.setCellHorizontalAlignment(actionPanel, HorizontalPanel.ALIGN_RIGHT); vPanel.add(hPanel); vPanel.add(valuePanel); return (vPanel); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.input.CISingleValueWidget.java
License:Open Source License
public CISingleValueWidget(final AttributeValue value) { super(value.getLabel()); this.value = value; this.value.setWidget(this); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setWidth("100%"); /*/*from w ww . j a v a 2 s .com*/ CIIconWidget icon = new CIIconWidget(value.getType()); panel.add(icon); */ super.setRequired(value.getCtrl().isRequiered()); hPanel.add(new CIIconWidget(value.getType())); final CIDisplayNameWidget valueWidget = new CIDisplayNameWidget(); valueWidget.setAlias(value.getStringValue()); if (value.getCtrl().getClickListener() != null) { valueWidget.setListener(value.getCtrl().getClickListener()); } valueWidget.setLoadListener(new LoadListener() { public void onLoadComplete(Object sender) { if (sender instanceof GWT_CiBean) { value.setValueAsCI((GWT_CiBean) sender); } } public void onLoadFailure(Object sender, Throwable caught) { // TODO Auto-generated method stub } public void onLoadStart(Object sender) { // TODO Auto-generated method stub } }); valueWidget.update(); hPanel.add(valueWidget); hPanel.setCellWidth(valueWidget, "100%"); hPanel.setCellHorizontalAlignment(valueWidget, HorizontalPanel.ALIGN_LEFT); if (value.getCtrl() instanceof IAttributeLoader) { IAttributeLoader aLoader = (IAttributeLoader) value.getCtrl(); aLoader.load(new AsyncCallback() { public void onFailure(Throwable caught) { // TODO Auto-generated method stub } public void onSuccess(Object result) { if (result instanceof GWT_CiBean) { valueWidget.load((GWT_CiBean) result); CISingleValueWidget.this.value.setValueAsCI(((GWT_CiBean) result)); CISingleValueWidget.this.validate(); } } }); } if (!value.getCtrl().isReadonly()) { /* final Image delete = new Image("images/delete-value.gif"); delete.setTitle("Reset this value"); delete.addClickListener(new ClickListener() { public void onClick(Widget sender) { valueWidget.load(null); CISingleValueWidget.this.value.setValueAsCI(null); CISingleValueWidget.this.validate(); } }); */ final Image change = new Image("images/eclipse/view_menu.gif"); change.addClickListener(new ClickListener() { public void onClick(Widget sender) { SelectInheritanceDataSourceControl ctrl = new SelectInheritanceDataSourceControl( CISingleValueWidget.this.value.getType()); ctrl.setFilterInstances( new Boolean(CISingleValueWidget.this.value.getCtrl().isSelectTemplate())); ctrl.setSelectInstances(CISingleValueWidget.this.value.getCtrl().isSelectTemplate()); ctrl.setRequiered(CISingleValueWidget.this.value.getCtrl().isRequiered()); ctrl.setShowSearch(true); String title = "Select a Instance"; if (CISingleValueWidget.this.value.getCtrl().isSelectTemplate()) { title = "Select a Template"; } final SelectCIPopup popup = new SelectCIPopup(title, ctrl); ctrl.setSelectListener(new ISelectListener() { public void onSelect(Object selected) { if (selected instanceof GWT_CiBean) { if (selected instanceof NullCIBean) { valueWidget.load(null); CISingleValueWidget.this.value.setValueAsCI(null); } else { valueWidget.load((GWT_CiBean) selected); CISingleValueWidget.this.value.setValueAsCI((GWT_CiBean) selected); } CISingleValueWidget.this.validate(); popup.hide(); } } }); int top = getBaseField().getAbsoluteTop() + getBaseField().getOffsetHeight() + 2; int left = getBaseField().getAbsoluteLeft() + 8; popup.setPopupPosition(left, top); popup.show(); } }); hPanel.add(change); hPanel.setCellHorizontalAlignment(change, HorizontalPanel.ALIGN_RIGHT); } // Create another panel to be able to set with to 100% HorizontalPanel panel = new HorizontalPanel(); panel.add(hPanel); addField(panel); if (value.getCtrl().isReadonly()) { panel.setStyleName("mdv-form-input-readonly"); } }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.popup.DragablePopup.java
License:Open Source License
public void load() { VerticalPanel panel = new VerticalPanel(); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("one-select-popup-header"); header.setWidth("100%"); Label headerLabel = new Label(title); Image close = new Image("images/eclipse/close.gif"); header.add(headerLabel);//from w ww .j a v a 2 s .c om header.add(close); header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT); header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT); header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE); // Add drag control. new DragControl(this, headerLabel); close.addClickListener(new ClickListener() { public void onClick(Widget sender) { hide(); } }); panel.add(header); panel.add(content); panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP); panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP); panel.setCellHeight(content, "100%"); setWidget(panel); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.popup.SelectCIPopup.java
License:Open Source License
protected void load() { VerticalPanel panel = new VerticalPanel(); HorizontalPanel header = new HorizontalPanel(); header.setStyleName("one-select-popup-header"); header.setWidth("100%"); Label headerLabel = new Label(headerText); Image close = new Image("images/eclipse/close.gif"); header.add(headerLabel);//w w w.j a va2s .c o m if (control instanceof SelectMultipleDataSourceControl) { HTML submit = new HTML("[<a href='javascript:;'>save</a>]"); submit.setStyleName("one-submit-label"); submit.addClickListener(new ClickListener() { public void onClick(Widget sender) { control.getSelectListener() .onSelect(((SelectMultipleDataSourceControl) control).getSelection()); } }); header.add(submit); header.setCellHorizontalAlignment(submit, HorizontalPanel.ALIGN_RIGHT); } header.add(close); header.setCellHorizontalAlignment(headerLabel, HorizontalPanel.ALIGN_LEFT); header.setCellHorizontalAlignment(close, HorizontalPanel.ALIGN_RIGHT); header.setCellVerticalAlignment(close, HorizontalPanel.ALIGN_MIDDLE); // Add drag control. new DragControl(this, headerLabel); close.addClickListener(new ClickListener() { public void onClick(Widget sender) { hide(); } }); setStyleName("one-select-popup"); control.setRootState(true); CITreeWidget templateTreeWidget = new CITreeWidget(control); templateTreeWidget.setSize("100%", "100%"); ScrollPanel content = new ScrollPanel(templateTreeWidget); content.setHeight("300px"); panel.add(header); panel.add(content); //panel.setCellVerticalAlignment(header, VerticalPanel.ALIGN_TOP); panel.setCellHeight(content, "100%"); panel.setCellWidth(content, "100%"); panel.setCellVerticalAlignment(content, VerticalPanel.ALIGN_TOP); setWidget(panel); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.screen.ci.ListCIScreen.java
License:Open Source License
protected void setupTable() { if (this.template == null) { return;//from www .ja va 2 s .co m } setTitleText("Instances of "); setTitleWidget(new CIIconDisplayNameWidget(this.template)); vPanel.clear(); table = null; if (isNewSupport()) { HorizontalPanel actionPanel = new HorizontalPanel(); HTML add = new HTML("[<a href='javascript:;'>new</a>]"); add.setTitle("Create a new instance"); actionPanel.add(add); add.addClickListener(new ClickListener() { public void onClick(Widget sender) { getBaseEntryScreen().showScreen(OneCMDBApplication.NEW_CI_SCREEN, template.getAlias(), new Long(0)); } }); actionPanel.add(add); actionPanel.setCellHorizontalAlignment(add, HorizontalPanel.ALIGN_RIGHT); actionPanel.setWidth("100%"); vPanel.add(actionPanel); } VerticalPanel tablePanel = new VerticalPanel(); tablePanel.setStyleName("onecmdb-table-panel"); if (table == null) { table = new CITablePanel(); table.addTableListener(ListCIScreen.this); table.addLoadListener(ListCIScreen.this); CITablePageControlPanel tablePageControl = new CITablePageControlPanel(table); tablePanel.add(tablePageControl); tablePanel.add(table); tablePanel.setCellVerticalAlignment(tablePageControl, VerticalPanel.ALIGN_TOP); tablePanel.setCellVerticalAlignment(table, VerticalPanel.ALIGN_TOP); } vPanel.add(tablePanel); table.setAttributeRender(getAttributeRender()); table.setTabelControl(getTableControl(this.template)); table.load(); }
From source file:org.onecmdb.ui.gwt.toolkit.client.view.screen.header.FooterScreen.java
License:Open Source License
public FooterScreen() { HorizontalPanel panel = new HorizontalPanel(); HTML label = new HTML("OneCMDB 1.4.0 Beta © Lokomo Systems <<a href='javascript:;'>about</a>>"); label.setTitle("Show about screen"); label.setStyleName("onecmdb-footer-label"); panel.add(label);// w ww . jav a2 s . c o m panel.setCellHorizontalAlignment(label, HorizontalPanel.ALIGN_RIGHT); panel.setStyleName("onecmdb-footer"); label.addClickListener(new ClickListener() { public void onClick(Widget sender) { getBaseEntryScreen().showScreen(OneCMDBApplication.SHOW_STATIC_CONTENT, "about.html", new Long(0)); } }); initWidget(panel); }