List of usage examples for com.google.gwt.user.client.ui Label setText
public void setText(String text)
From source file:com.dingziran.effective.client.content.widgets.CwDatePicker.java
License:Apache License
/** * Constructor./*from w ww. jav a 2s .c o m*/ * * @param constants the constants */ public CwDatePicker(CwConstants constants) { super(constants.cwDatePickerName(), constants.cwDatePickerDescription()); this.constants = constants; view = new ContentWidgetView(hasMargins(), hasScrollableContent()); view.setName(getName()); view.setDescription(getDescription()); setWidget(view); // Create a basic date picker DatePicker datePicker = new DatePicker(); final Label text = new Label(); // Set the value in the text box when the user selects a date datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() { public void onValueChange(ValueChangeEvent<Date> event) { Date date = event.getValue(); String dateString = DateTimeFormat.getMediumDateFormat().format(date); text.setText(dateString); } }); // Set the default value datePicker.setValue(new Date(), true); // Create a DateBox DateTimeFormat dateFormat = DateTimeFormat.getLongDateFormat(); DateBox dateBox = new DateBox(); dateBox.setFormat(new DateBox.DefaultFormat(dateFormat)); // Combine the widgets into a panel and return them VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new HTML(constants.cwDatePickerLabel())); vPanel.add(text); vPanel.add(datePicker); vPanel.add(new HTML(constants.cwDatePickerBoxLabel())); vPanel.add(dateBox); view.setExample(vPanel); }
From source file:com.dynamobi.pentaho.whlabel.client.WHLabel.java
License:Open Source License
public void onModuleLoad() { dropDownPanel.setSpacing(20);// w ww . j av a 2 s . c o m setDataSources(); HorizontalPanel currLabelPanel = new HorizontalPanel(); currLabelPanel.add(dsListBox); Label spaceLabel = new Label(); spaceLabel.setWidth("10"); spaceLabel.setText(" "); currLabelPanel.add(spaceLabel); currLabelPanel.add(currSelectedLabel); dropDownPanel.add(currLabelPanel); labelTable.setHeader(0, "Warehouse Label"); labelTable.setHeader(1, "Timestamp"); labelTable.setHeight("100"); labelTable.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { Cell cell = labelTable.getCellForEvent(event); int rowIndex = cell.getRowIndex(); for (int i = 0; i < labelTable.getRowCount(); i++) labelTable.getRowFormatter().setStyleName(i, "dwTableRow"); labelTable.getRowFormatter().setStyleName(rowIndex, "selectedRow"); } }); labelTable.setStyleName("labelTable"); dropDownPanel.add(labelTable); buttonTable.setWidget(0, 0, unsetLabelButton); unsetLabelButton.setStyleName("button"); setLabelButton.setStyleName("button"); unsetLabelButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent bce) { String selectedLabel = "null"; final String currentSchema = dsListBox.getItemText(dsListBox.getSelectedIndex()); setDWLabel(currentSchema, selectedLabel); } }); setLabelButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent bce) { String selectedLabel = ""; for (int i = 0; i < labelTable.getRowCount(); i++) { if (labelTable.getRowFormatter().getStyleName(i).equalsIgnoreCase("selectedRow")) selectedLabel = labelTable.getText(i, 0); } selectedLabel += " " + dsListBox.getItemText(dsListBox.getSelectedIndex()); for (int i = 0; i < labelTable.getRowCount(); i++) { if (labelTable.getRowFormatter().getStyleName(i).equalsIgnoreCase("selectedRow")) selectedLabel = labelTable.getText(i, 0); } //selectedLabel += " "+dsListBox.getItemText(dsListBox.getSelectedIndex()); final String currentSchema = dsListBox.getItemText(dsListBox.getSelectedIndex()); setDWLabel(currentSchema, selectedLabel); } }); // cancelButton.addClickHandler(new ClickHandler() { // public void onClick(ClickEvent bce) { // final String currentSchema = dsListBox.getItemText(dsListBox.getSelectedIndex()); // getDWLabel(currentSchema); // } // }); // buttonTable.setWidget(0, 1, setLabelButton); // buttonTable.setWidget(0, 2, cancelButton); buttonTable.getCellFormatter().setStyleName(0, 0, "buttonRight"); // buttonTable.getCellFormatter().setStyleName(0, 1, "buttonCenter"); buttonTable.getCellFormatter().setStyleName(0, 2, "buttonLeft"); buttonTable.setStyleName("buttonTable"); buttonPanel.add(buttonTable); dropDownPanel.add(buttonPanel); mainPanel.add(dropDownPanel); RootPanel.get("description").add(mainPanel); // currLabelPanel.add(currSelectedLabel); // RootPanel.get("warehouseLabel").add(currLabelPanel); dsListBox.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent arg0) { final String currentSchema = dsListBox.getItemText(dsListBox.getSelectedIndex()); updateDWLabels(currentSchema); } }); }
From source file:com.edgenius.wiki.gwt.client.space.TrashedPagesPanel.java
License:Open Source License
public void onSuccess(PageItemListModel model) { // TODO : error handle if (!GwtClientUtils.preSuccessCheck(model, message)) { return;//from w w w .j a va2 s . c om } List<PageItemModel> pageList = model.itemList; message.cleanMessage(); //clean table; int rowCount = table.getRowCount(); for (int idx = rowCount - 1; idx >= 0; idx--) { table.removeRow(idx); } if (pageList != null && pageList.size() > 0) { nonLabel.setVisible(false); int row = 0, col = 0; ; //build header col++; //page title - width is as max as possible table.getCellFormatter().setWordWrap(row, col, false); table.getColumnFormatter().setWidth(col++, "1%"); //person table.getCellFormatter().setWordWrap(row, col, false); table.getColumnFormatter().setWidth(col++, "1%"); //date table.getCellFormatter().setWordWrap(row, col, false); table.getColumnFormatter().setWidth(col++, "1%"); //restore & remove col = 0; table.setText(row, col++, Msg.consts.page_title()); table.setText(row, col++, Msg.consts.remover()); table.setText(row, col++, Msg.consts.date()); table.setText(row, col++, Msg.consts.action()); for (Iterator<PageItemModel> iter = pageList.iterator(); iter.hasNext();) { row++; col = 0; final PageItemModel pageItem = iter.next(); Label title = new Label(); title.setText(pageItem.title); Label rPerson = new Label(pageItem.modifier); Label rDate = new Label(GwtClientUtils.toDisplayDate(pageItem.modifiedDate)); ClickLink restore = new ClickLink(Msg.consts.restore()); restore.setObject(pageItem.uuid); restore.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { PageControllerAsync action = ControllerFactory.getPageController(); //need check if this restore page has duplicated title page exist in space, to ask user if really want to override. action.restoreCheck(pageItem.uuid, new PreRestoreAsync(pageItem.spaceUname, pageItem.uuid, pageItem.title)); } }); ClickLink remove = new ClickLink(Msg.consts.remove()); remove.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (Window.confirm(Msg.consts.confirm_remove_page())) { PageControllerAsync action = ControllerFactory.getPageController(); action.removePage(null, pageItem.spaceUname, pageItem.uuid, true, new RemoveAsync(pageItem.uuid)); } } }); table.setWidget(row, col++, title); table.getCellFormatter().setWordWrap(row, col, false); table.setWidget(row, col++, rPerson); table.getCellFormatter().setWordWrap(row, col, false); table.setWidget(row, col++, rDate); FlowPanel actionP = new FlowPanel(); actionP.setStyleName(Css.NOWRAP); actionP.add(restore); actionP.add(new Label(" | ")); actionP.add(remove); table.setWidget(row, ACTION_COLUMN, actionP); } } else { nonLabel.setVisible(true); } }
From source file:com.eduworks.russel.ui.client.pagebuilder.screen.DetailScreen.java
License:Apache License
/** * displayGuts Renders the guts of the DetailView and sets up handlers for the node record after it has been retrieved and is available *//*from w ww . j a v a 2 s. co m*/ public void displayGuts() { if (fullScreen) { PageAssembler.ready(new HTML(Russel.htmlTemplates.getDetailPanel().getText())); PageAssembler.buildContents(); DOM.getElementById("r-menuWorkspace").getParentElement().removeClassName("active"); DOM.getElementById("r-menuCollections").getParentElement().removeClassName("active"); DOM.getElementById("r-menuProjects").getParentElement().removeClassName("active"); DOM.getElementById("r-fullScreen").setAttribute("style", "display:none"); DOM.getElementById("r-metadata-hide").setAttribute("style", "display:none"); DOM.getElementById("r-metadata-show").setAttribute("style", ""); } else { DOM.getElementById("r-fullScreen").setAttribute("style", ""); PageAssembler.attachHandler(PageAssembler.getElementByClass(".reveal-modal-bg"), Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { if (tile != null) tile.refreshTile(null); } }); PageAssembler.attachHandler(PageAssembler.getElementByClass(".close-reveal-modal"), Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { if (tile != null) tile.refreshTile(null); } }); } if (record.getFilename().substring(record.getFilename().lastIndexOf(".") + 1).equalsIgnoreCase("rpf")) { DOM.getElementById("r-editEPSSContainer").removeAttribute("style"); PageAssembler.attachHandler("r-editEPSS", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { RusselApi.getResource(tile.getSearchRecord().getGuid(), true, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket alfrescoPacket) { ProjectRecord pr = new ProjectRecord(alfrescoPacket.getContentString(), record); Russel.screen.loadScreen(new EPSSScreen(pr), true); } @Override public void onFailure(Throwable caught) { StatusHandler.createMessage( StatusHandler.getProjectLoadMessageError(record.getFilename()), StatusRecord.ALERT_ERROR); } }); } }); } else DOM.getElementById("r-editEPSSContainer").setAttribute("style", "display:none"); setDisplayIE(DOM.getElementById("r-metadata-hide"), "block"); setDisplayIE(DOM.getElementById("r-metadata-show"), "none"); setDisplayIE(DOM.getElementById("r-generalMetadata"), "block"); setDisplayIE(DOM.getElementById("r-educationalMetadata"), "none"); setDisplayIE(DOM.getElementById("r-technicalMetadata"), "none"); setDisplayIE(DOM.getElementById("r-relatedMetadata"), "none"); if (record.getGuid() == "" && record.getFilename().endsWith(".flr")) { setDisplayIE(DOM.getElementById("r-postFlr"), "none"); setDisplayIE(DOM.getElementById("r-saveFromFlr"), "block"); setDisplayIE(DOM.getElementById("r-detailGenerateMetadata"), "none"); } else { setDisplayIE(DOM.getElementById("r-postFlr"), "block"); setDisplayIE(DOM.getElementById("r-saveFromFlr"), "none"); setDisplayIE(DOM.getElementById("r-detailGenerateMetadata"), "block"); } ((Label) PageAssembler.elementToWidget("general-section", PageAssembler.LABEL)) .removeStyleName("collapsed"); ((Label) PageAssembler.elementToWidget("educational-section", PageAssembler.LABEL)) .addStyleName("collapsed"); ((Label) PageAssembler.elementToWidget("technical-section", PageAssembler.LABEL)).addStyleName("collapsed"); ((Label) PageAssembler.elementToWidget("related-section", PageAssembler.LABEL)).addStyleName("collapsed"); ((TextBox) PageAssembler.elementToWidget("input-comment", PageAssembler.TEXT)).setText(""); DOM.getElementById("detailLevel1").setAttribute("disabled", ""); DOM.getElementById("detailDistribution1").setAttribute("disabled", ""); ((Label) PageAssembler.elementToWidget("r-detailIcon", PageAssembler.LABEL)).setStyleName("r-icon"); ((Label) PageAssembler.elementToWidget("r-detailIcon", PageAssembler.LABEL)) .addStyleName(AssetExtractor.getFileType(record.getFilename())); removeUnsavedEffects0(); PageAssembler.attachHandler("r-saveFromFlr", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { RusselApi.uploadResource(record.getFileContents(), record.getFilename(), new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { record.setGuid(esbPacket.getPayloadString()); ESBPacket pack = new ESBPacket(record.toString()); pack.remove("uploadDate_l"); pack.remove("updatedDate_l"); RusselApi.updateResourceMetadata(record.getGuid(), pack, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { PageAssembler.closePopup("objDetailModal"); } @Override public void onFailure(Throwable caught) { } }); } @Override public void onFailure(Throwable caught) { } }); } }); PageAssembler.attachHandler("r-detailGenerateMetadata", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { final StatusRecord status = StatusHandler.createMessage( StatusHandler.getGenerateMetaDataBusy(record.getFilename()), StatusRecord.ALERT_BUSY); final ESBCallback<ESBPacket> callback = new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { status.setState(StatusRecord.ALERT_ERROR); status.setMessage(StatusHandler.getGenerateMetaDataError(record.getFilename())); StatusHandler.alterMessage(status); } @Override public void onSuccess(ESBPacket esbPacket) { status.setState(StatusRecord.ALERT_SUCCESS); status.setMessage(StatusHandler.getGenerateMetaDataDone(record.getFilename())); StatusHandler.alterMessage(status); final RUSSELFileRecord fr = new RUSSELFileRecord(esbPacket); meta.addMetaDataFields(fr); addUnsavedEffects0(); } }; RusselApi.generateResourceMetadata(record.getGuid(), record.getFilename().endsWith(".rlk") ? true : false, callback); } }); PageAssembler.attachHandler("r-detailEditUpdate", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { final StatusRecord status = StatusHandler.createMessage( StatusHandler.getUpdateMetadataMessageBusy(record.getFilename()), StatusRecord.ALERT_BUSY); RusselApi.updateResourceMetadata(record.getGuid(), meta.buildMetaPacket(record).toObject(), new ESBCallback<ESBPacket>() { @Override public void onSuccess(final ESBPacket nullPack) { status.setMessage(StatusHandler.getUpdateMetadataMessageDone(record.getFilename())); status.setState(StatusRecord.ALERT_SUCCESS); StatusHandler.alterMessage(status); RusselApi.getResourceMetadata(record.getGuid(), false, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket ap) { removeUnsavedEffects0(); record.parseESBPacket(ap); meta.addMetaDataFields(record); Label title = ((Label) PageAssembler .elementToWidget("r-detailTitle", PageAssembler.LABEL)); if (tile != null) tile.fillTile(null); if (title.getText().equalsIgnoreCase("n/a")) title.setText(record.getFilename()); } @Override public void onFailure(Throwable caught) { removeUnsavedEffects0(); } }); } @Override public void onFailure(Throwable caught) { status.setMessage( StatusHandler.getUpdateMetadataMessageError(record.getFilename())); status.setState(StatusRecord.ALERT_ERROR); StatusHandler.alterMessage(status); } }); } }); PageAssembler.attachHandler("r-fullScreen", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { PageAssembler.closePopup("objDetailModal"); PageAssembler.removeElement("objDetailModal"); PageAssembler.removeByClass("reveal-modal-bg"); Russel.screen.loadScreen(new DetailScreen(record, FULL_SCREEN), false); } }); PageAssembler.attachHandler("r-deleteDoc", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { if (Window.confirm("Are you sure you wish to delete this item?")) { final StatusRecord status = StatusHandler.createMessage( StatusHandler.getDeleteMessageBusy(record.getFilename()), StatusRecord.ALERT_BUSY); RusselApi.deleteResource(record.getGuid(), new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { status.setMessage(StatusHandler.getDeleteMessageError(record.getFilename())); status.setState(StatusRecord.ALERT_ERROR); StatusHandler.alterMessage(status); } @Override public void onSuccess(ESBPacket result) { status.setMessage(StatusHandler.getDeleteMessageDone(record.getFilename())); status.setState(StatusRecord.ALERT_SUCCESS); StatusHandler.alterMessage(status); ((TextBox) PageAssembler.elementToWidget("r-menuSearchBar", PageAssembler.TEXT)) .setText(""); PageAssembler.closePopup("objDetailModal"); if (record instanceof RUSSELFileRecord) { if (((RUSSELFileRecord) record).getFlrDocId() != "") RusselApi .publishToFlr(record.getGuid(), FLRPacketGenerator .buildFlrDeleteNsdlPacket(((RUSSELFileRecord) record)), new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { StatusHandler.createMessage( StatusHandler.getFLRDeleteMessageError( record.getFilename()), StatusRecord.ALERT_ERROR); } @Override public void onSuccess(ESBPacket esbPacket) { final StatusRecord status = StatusHandler.createMessage( StatusHandler.getFLRDeleteMessageDone( record.getFilename()), StatusRecord.ALERT_SUCCESS); } }); if (((RUSSELFileRecord) record).getFlrParadataId() != "") RusselApi .publishToFlr(record.getGuid(), FLRPacketGenerator.buildFlrDeleteParadataPacket( ((RUSSELFileRecord) record)), new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { StatusHandler.createMessage( StatusHandler.getFLRDeleteActivityError( record.getFilename()), StatusRecord.ALERT_ERROR); } @Override public void onSuccess(ESBPacket esbPacket) { final StatusRecord status = StatusHandler.createMessage( StatusHandler.getFLRDeleteParadataDone( record.getFilename()), StatusRecord.ALERT_SUCCESS); } }); } } }); } } }); PageAssembler.attachHandler("comment-submit", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { final String comment = ((TextBox) PageAssembler.elementToWidget("input-comment", PageAssembler.TEXT)).getText().trim(); if (comment != null && comment.trim() != "" && !comment.equalsIgnoreCase("add comment")) { RusselApi.addComment(record.getGuid(), comment, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { esbPacket = esbPacket.getObject("obj"); record.parseESBPacket(esbPacket.getObject("m")); CommentRecord commentRecord = new CommentRecord( new ESBPacket(esbPacket.getString("c"))); fillComment0(commentRecord); ((TextBox) PageAssembler.elementToWidget("input-comment", PageAssembler.TEXT)) .setText(""); } @Override public void onFailure(Throwable caught) { ((TextBox) PageAssembler.elementToWidget("input-comment", PageAssembler.TEXT)) .setText(""); StatusHandler.createMessage(StatusHandler.getCommentMessageError(record.getFilename()), StatusRecord.ALERT_ERROR); } }); } } }); Document.get().getElementById("r-downloadDoc").setAttribute("href", RusselApi.downloadContentUrl(record.getGuid(), true)); ((Label) PageAssembler.elementToWidget("r-rating-info", PageAssembler.LABEL)).setText("Current rating: " + MathUtil.roundNumber(record.getRating(), 2) + " (" + record.getVotes() + " votes)"); DOM.getElementById("r-ratingLabel").setAttribute("style", "width: " + MathUtil.roundNumber((record.getRating() / 5.0) * 100, 2) + "%"); fillComments0(); ((Label) PageAssembler.elementToWidget("detailMetaFilename", PageAssembler.LABEL)) .setText(record.getFilename()); String ext = record.getFilename().substring(record.getFilename().lastIndexOf(".") + 1); if (ext.equalsIgnoreCase("png") || ext.equalsIgnoreCase("tiff") || ext.equalsIgnoreCase("tif") || ext.equalsIgnoreCase("bmp") || ext.equalsIgnoreCase("jpg") || ext.equalsIgnoreCase("jpeg") || ext.equalsIgnoreCase("gif")) { DOM.getElementById("r-preview").setInnerHTML(""); RootPanel.get("r-preview").add(new Image(RusselApi.downloadContentUrl(record.getGuid(), false))); } else if (ext.equalsIgnoreCase("rlk")) { RusselApi.getResource(record.getGuid(), false, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { record.setFileContents(esbPacket.getContentString()); DOM.getElementById("r-preview").setInnerHTML("<a href=" + record.getFileContents() + " target=\"_blank\">" + record.getFileContents().replaceAll("\"", "") + "</a>"); } @Override public void onFailure(Throwable caught) { } }); } else if (isTextFormat(ext)) { RusselApi.getResource(record.getGuid(), false, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { record.setFileContents(esbPacket.getContentString()); DOM.getElementById("r-preview").setInnerHTML(record.getFileContents()); } @Override public void onFailure(Throwable caught) { } }); } else if (ext.equalsIgnoreCase("Mp4") || ext.equalsIgnoreCase("WebM") || ext.equalsIgnoreCase("Ogg")) { String videoType = (ext.equalsIgnoreCase("Mp4")) ? "audio/mp4" : (ext.equalsIgnoreCase("WebM")) ? "audio/webm" : (ext.equalsIgnoreCase("Ogg")) ? "audio/ogg" : ""; String htmlString = "<video controls=\"controls\"><source src=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\" type=\"" + videoType + "\"></source></video>"; RootPanel.get("r-preview").getElement().setInnerHTML(htmlString); } else if (ext.equalsIgnoreCase("Mp3") || ext.equalsIgnoreCase("Wav") || ext.equalsIgnoreCase("Ogg")) { String audioType = (ext.equalsIgnoreCase("Mp3")) ? "audio/mp3" : (ext.equalsIgnoreCase("Wav")) ? "audio/wav" : (ext.equalsIgnoreCase("Ogg")) ? "audio/ogg" : ""; String htmlString = "<audio controls=\"controls\"><source src=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\" type=\"" + audioType + "\"></source></audio>"; RootPanel.get("r-preview").getElement().setInnerHTML(htmlString); } else if (ext.equalsIgnoreCase("swf")) { String htmlString = "<object id=\"FlashID\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" data=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\" height=\"100%\" width=\"100%\">" + "<param name=\"movie\" value=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\">" + "<param name=\"quality\" value=\"high\">" + "<param name=\"wmode\" value=\"transparent\">" + "<param name=\"swfversion\" value=\"10.0\">" + "<param name=\"allowScriptAccess\" value=\"always\">" + "<param name=\"BGCOLOR\" value=\"#000000\">" + "<param name=\"expressinstall\" value=\"Scripts/expressInstall.swf\">" + "<!--[if !IE]>-->" + "<object id=\"FlashID2\" type=\"application/x-shockwave-flash\" data=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\" height=\"100%\" width=\"100%\">" + "<!--<![endif]-->" + "<param name=\"movie\" value=\"" + RusselApi.downloadContentUrl(record.getGuid(), false) + "\">" + "<param name=\"quality\" value=\"high\">" + "<param name=\"wmode\" value=\"transparent\">" + "<param name=\"swfversion\" value=\"10.0\">" + "<param name=\"allowScriptAccess\" value=\"always\">" + "<param name=\"BGCOLOR\" value=\"#000000\">" + "<param name=\"expressinstall\" value=\"Scripts/expressInstall.swf\">" + "<div>" + "<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>" + "<p><a href=\"http://www.adobe.com/go/getflashplayer\"><img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" width=\"112\" height=\"33\" /></a></p>" + "</div>" + "<!--[if !IE]>-->" + "</object>" + "<!--<![endif]-->" + "</object>" + "<!--[if !IE]>-->" + "<script type=\"text/javascript\">" + "swfobject.registerObject(\"FlashID2\");" + "</script>" + "<!--<![endif]-->" + "<!--[if IE]>" + "<script type=\"text/javascript\">" + "swfobject.registerObject(\"FlashID\");" + "</script>" + "<![endif]-->"; RootPanel.get("r-preview").getElement().setInnerHTML(htmlString); } else DOM.getElementById("r-preview").setInnerHTML("<p>No Preview Available</p>"); meta.addMetaDataFields(record); if (record.getFOUO()) { ((Label) PageAssembler.elementToWidget("r-detailWarning", PageAssembler.LABEL)).setText(Constants.FOUO); ((Label) PageAssembler.elementToWidget("r-detailWarning", PageAssembler.LABEL)) .setStyleName("r-warning"); } else { ((Label) PageAssembler.elementToWidget("r-detailWarning", PageAssembler.LABEL)).setText(""); ((Label) PageAssembler.elementToWidget("r-detailWarning", PageAssembler.LABEL)) .setStyleName("r-warning hide"); } if (DOM.getElementById("r-detailTitle").getInnerText().equalsIgnoreCase("n/a")) ((Label) PageAssembler.elementToWidget("r-detailTitle", PageAssembler.LABEL)) .setText(record.getFilename()); PageAssembler.attachHandler("r-postFlr", Event.ONCLICK, new EventCallback() { @Override public void onEvent(Event event) { if (FLRApi.FLR_ACTIVITY_MODE.equals(FLRApi.FLR_ACTIVITY_ACTIONS_FEEDBACK) || FLRApi.FLR_ACTIVITY_MODE.equals(FLRApi.FLR_ACTIVITY_ACTIONS_ISD) || FLRApi.FLR_ACTIVITY_MODE.equals(FLRApi.FLR_ACTIVITY_ACTIONS_ALL)) { final StatusRecord flrStatus = StatusHandler.createMessage( StatusHandler.getFLRActivityBusy(record.getFilename()), StatusRecord.ALERT_BUSY); if (record instanceof RUSSELFileRecord) { RusselApi.publishToFlr(record.getGuid(), FLRPacketGenerator.buildFlrParadataPacket(((RUSSELFileRecord) record)), new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { flrStatus.setMessage( StatusHandler.getFLRActivityError(record.getFilename())); flrStatus.setState(StatusRecord.ALERT_ERROR); StatusHandler.alterMessage(flrStatus); } @Override public void onSuccess(ESBPacket esbPacket) { flrStatus .setMessage(StatusHandler.getFLRActivityDone(record.getFilename())); flrStatus.setState(StatusRecord.ALERT_SUCCESS); StatusHandler.alterMessage(flrStatus); FLRPacket packet = new FLRPacket(esbPacket.getObject(ESBPacket.OBJECT)); record.setFlrParadataId(packet.getResponseDocID()); RusselApi.updateResourceMetadata(((RUSSELFileRecord) record).getGuid(), ((RUSSELFileRecord) record).toObject(), new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { postFlrNsdl(); } @Override public void onFailure(Throwable caught) { StatusHandler.createMessage( StatusHandler.getMetadataMessageError( record.getFilename()), StatusRecord.ALERT_ERROR); } }); } }); } } else { StatusHandler.createMessage(StatusHandler.getFLRDisabledError("Activity Stream publish"), StatusRecord.ALERT_WARNING); } } }); attachRatingListeners0(); }
From source file:com.eduworks.russel.ui.client.pagebuilder.screen.DetailScreen.java
License:Apache License
private void postFlrNsdl() { if (FLRApi.FLR_PUBLISH_MODE.equals(FLRApi.FLR_PUBLISH_ACTIONS_GENERAL) || FLRApi.FLR_PUBLISH_MODE.equals(FLRApi.FLR_PUBLISH_ACTIONS_ALL)) { final StatusRecord flrStatus = StatusHandler .createMessage(StatusHandler.getFLRMessageBusy(record.getFilename()), StatusRecord.ALERT_BUSY); if (record instanceof RUSSELFileRecord) { RusselApi.publishToFlr(record.getGuid(), FLRPacketGenerator.buildFlrNsdlPacket(((RUSSELFileRecord) record)), new ESBCallback<ESBPacket>() { @Override public void onFailure(Throwable caught) { flrStatus.setMessage(StatusHandler.getFLRMessageError(record.getFilename())); flrStatus.setState(StatusRecord.ALERT_ERROR); StatusHandler.alterMessage(flrStatus); }//from ww w . ja v a2 s. c o m @Override public void onSuccess(ESBPacket esbPacket) { flrStatus.setMessage(StatusHandler.getFLRMessageDone(record.getFilename())); flrStatus.setState(StatusRecord.ALERT_SUCCESS); StatusHandler.alterMessage(flrStatus); FLRPacket packet = new FLRPacket(esbPacket.getObject(ESBPacket.OBJECT)); record.setFlrDocId(packet.getResponseDocID()); RusselApi.updateResourceMetadata(((RUSSELFileRecord) record).getGuid(), ((RUSSELFileRecord) record).toObject(), new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket esbPacket) { RusselApi.getResourceMetadata(record.getGuid(), false, new ESBCallback<ESBPacket>() { @Override public void onSuccess(ESBPacket ap) { removeUnsavedEffects0(); record.parseESBPacket(ap); meta.addMetaDataFields(record); Label title = ((Label) PageAssembler .elementToWidget("r-detailTitle", PageAssembler.LABEL)); if (title.getText().equalsIgnoreCase("n/a")) title.setText(record.getFilename()); } @Override public void onFailure(Throwable caught) { removeUnsavedEffects0(); } }); } @Override public void onFailure(Throwable caught) { StatusHandler.createMessage( StatusHandler.getMetadataMessageError(record.getFilename()), StatusRecord.ALERT_ERROR); } }); } }); } } else { StatusHandler.createMessage(StatusHandler.getFLRDisabledError("object publish"), StatusRecord.ALERT_WARNING); } }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.view.BatchClassBreadCrumbView.java
License:Open Source License
private void createBreadCrumbView() { clickablebreadCrumbPanel.clear();/*from w w w .ja v a 2 s. c o m*/ if (breadCrumbViews.size() == 1) { previousButton.setVisible(false); previousButton.removeStyleName(AdminConstants.BUTTON_STYLE); previousButton.addStyleName(AdminConstants.DISABLED_BUTTON_STYLE); } else { previousButton.setVisible(true); previousButton.setEnabled(true); previousButton.removeStyleName(AdminConstants.DISABLED_BUTTON_STYLE); previousButton.addStyleName(AdminConstants.BUTTON_STYLE); } boolean isFirst = false; int allowableLimit = getAllowableLimit(); for (final BreadCrumbView breadCrumbView : breadCrumbViews) { if (isFirst) { Label arrowLabel = new Label(AdminConstants.DOUBLE_ARROW); clickablebreadCrumbPanel.add(arrowLabel); } else { isFirst = true; } Label breadCrumbs = new Label(); breadCrumbs.setTitle(breadCrumbView.breadCrumbName); if (allowableLimit > 0) { breadCrumbs.setText(getBreadCrumbText(breadCrumbView.breadCrumbName, allowableLimit)); } else { breadCrumbs.setText(breadCrumbView.breadCrumbName); } clickablebreadCrumbPanel.add(breadCrumbs); breadCrumbs.addStyleName(AdminConstants.BOLD_TEXT_STYLE); breadCrumbs.addStyleName(AdminConstants.CURSOR_POINTER); breadCrumbs.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { presenter.getController().getView().toggleBottomPanelShowHide(true); if (breadCrumbView.viewType.equals(ViewType.BATCH_CLASS_LISTING)) { checkAndSaveUnsavedDataForBatchClass(false); createGivenBreadCrumbView(breadCrumbViews.getLast()); } else { createGivenBreadCrumbView(breadCrumbView); } presenter.getController().setAdd(false); } }); } }
From source file:com.ephesoft.dcma.gwt.core.client.ui.table.Table.java
License:Open Source License
private void createTableHeader(boolean isRadioButton) { Images images = GWT.create(Images.class); final TableHeader header = tableData.getHeader(); final List<HeaderColumn> columns = header.getHeaderColumns(isRadioButton); String width = null;//from w ww . j a v a 2 s. c o m int counter = 0; for (final HeaderColumn column : columns) { width = column.getWidth() + "%"; headerTable.getCellFormatter().setWidth(0, counter, width); headerTable.getCellFormatter().addStyleName(0, counter, "wordWrap"); HorizontalPanel headerPanel = new HorizontalPanel(); Label name = new Label(column.getName()); headerPanel.add(name); final Label sortImage = new Label(); sortImage.setWidth("5px"); sortImage.setStyleName("alignMiddle"); if (order != null && column.getDomainProperty() != null && order.getSortProperty().getProperty().equals(column.getDomainProperty().getProperty())) { if (column.isPrimaryAsc()) { DOM.setInnerHTML(sortImage.getElement(), AbstractImagePrototype.create(images.sortUp()).getHTML()); } else { DOM.setInnerHTML(sortImage.getElement(), AbstractImagePrototype.create(images.sortDown()).getHTML()); } } headerPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); headerPanel.add(sortImage); if (counter == 0 && isRadioButton) { name.setText(""); } headerTable.setWidget(0, counter, headerPanel); if (column.isSortable()) { name.addStyleName("cursorHand"); name.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { order = new Order(column.getDomainProperty(), !column.isPrimaryAsc()); navBar.setOrder(order); column.setPrimaryAsc(!column.isPrimaryAsc()); navBar.getListner().onPagination(navBar.getStartIndex(), visibleRecodrCount, order); } }); } headerTable.getFlexCellFormatter().setVerticalAlignment(0, counter, HasVerticalAlignment.ALIGN_TOP); headerTable.getCellFormatter().setHorizontalAlignment(0, counter, HasHorizontalAlignment.ALIGN_LEFT); counter++; } headerTable.getRowFormatter().setStyleName(0, selectionStyle.header()); }
From source file:com.ephesoft.dcma.gwt.core.client.ui.table.Table.java
License:Open Source License
private void update(boolean isRadioButton, int startIndex, int selectedIndexlocal) { selectedRowId = null;//from w w w. j a va 2 s . c o m flexTable.removeAllRows(); navBarTable.removeAllRows(); createTableHeader(isRadioButton); int count = totalCount; int max = startIndex + visibleRecodrCount; if (max > count) { max = count; } navBar.update(startIndex, count, max); setNavigationBar(); TableHeader header = tableData.getHeader(); HeaderColumn[] columns = header.getHeaderColumns(); String width = null; int rowCounter = 0; String radioName = String.valueOf(new Date().getTime()); final List<Record> recordList = tableData.getRecordList(); if (recordList != null) { if (!recordList.isEmpty()) { for (final Record record : recordList) { int colCounter = 0; for (; colCounter < columns.length; colCounter++) { width = columns[colCounter].getWidth() + "%"; flexTable.getCellFormatter().setWidth(rowCounter, colCounter, width); flexTable.setWidget(rowCounter, colCounter, record.getWidget(columns[colCounter])); flexTable.getCellFormatter().setHorizontalAlignment(rowCounter, colCounter, HasHorizontalAlignment.ALIGN_LEFT); flexTable.getCellFormatter().setWordWrap(rowCounter, colCounter, true); flexTable.getCellFormatter().addStyleName(rowCounter, colCounter, "wordWrap"); } if (isRadioButton) { final RadioButton radioButton = new RadioButton(radioName); if (rowCounter == selectedIndexlocal) { radioButton.setValue(true); selectedRowId = record.getIdentifier(); selectedIndex = rowCounter; if (null != listner && fireEventForFirstRow) { listner.onRowSelected(selectedRowId); } scrollIntoView( flexTable.getWidget(selectedIndexlocal, FIRST_COLUMN_INDEX).getElement()); } radioButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { clearRadioButtons(); radioButton.setValue(true); selectedRowId = record.getIdentifier(); selectedIndex = recordList.indexOf(record); } }); flexTable.setWidget(rowCounter, 0, radioButton); RadioButtonContainer radioButtonContainer = new RadioButtonContainer(radioButton, record.getIdentifier()); radioButtons.put(rowCounter, radioButtonContainer); flexTable.getCellFormatter().setHorizontalAlignment(rowCounter, 0, HasHorizontalAlignment.ALIGN_CENTER); radioButton.addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent arg0) { removeSelectedRowStyleFromTable(); for (Integer rowId : radioButtons.keySet()) { if (radioButtons.get(rowId).getRadioButton().equals(radioButton)) { selectedIndex = recordList.indexOf(record); flexTable.getRowFormatter().addStyleName(rowId, selectionStyle.rowHighlighted()); } } } }); } else { RadioButtonContainer radioButtonContainer = new RadioButtonContainer(null, record.getIdentifier()); radioButtons.put(rowCounter, radioButtonContainer); } if (rowCounter % 2 == 0) { flexTable.getRowFormatter().setStyleName(rowCounter, selectionStyle.oddRow()); } else { flexTable.getRowFormatter().setStyleName(rowCounter, selectionStyle.evenRow()); } rowCounter++; flexTable.getRowFormatter().addStyleName(selectedIndexlocal, selectionStyle.rowHighlighted()); } } else { Label label = new Label(); label.setWidth("100%"); label.setText("No record found."); flexTable.getCellFormatter().setWidth(1, 0, "100%"); flexTable.getFlexCellFormatter().setColSpan(1, 0, 3); // Record record = new Record("1"); // tableData.getRecordList().add(record); flexTable.setWidget(1, 0, label); } } }
From source file:com.ephesoft.dcma.gwt.customworkflow.client.view.CustomWorkflowBreadCrumbView.java
License:Open Source License
/** * @param breadCrumbView//from w w w . ja v a 2s .c o m */ public void createBreadCrumbString() { clickablebreadCrumbPanel.clear(); boolean isFirst = false; for (final BreadCrumbView breadCrumbView2 : breadCrumbViews) { if (isFirst) { Label arrowLabel = new Label(CustomWorkflowConstants.DOUBLE_ARROW); clickablebreadCrumbPanel.add(arrowLabel); } else { isFirst = true; } Label breadCrumbs = new Label(); breadCrumbs.setText(breadCrumbView2.breadCrumbName); clickablebreadCrumbPanel.add(breadCrumbs); breadCrumbs.addStyleName(CustomWorkflowConstants.BOLD_TEXT_STYLE); breadCrumbs.addStyleName(CustomWorkflowConstants.CURSOR_POINTER); breadCrumbs.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { createGivenBreadCrumbView(breadCrumbView2.viewType); } }); } }
From source file:com.ephesoft.dcma.gwt.login.client.LoginEntryPoint.java
License:Open Source License
@Override public void onLoad() { Document.get().setTitle(LocaleDictionary.get().getConstantValue(LoginConstants.LOGIN_TITLE)); Label userName = new Label(LocaleDictionary.get().getConstantValue(LoginConstants.LOGIN_USERNAME)); userName.setStyleName("text_bold"); Label password = new Label(LocaleDictionary.get().getConstantValue(LoginConstants.LOGIN_PASSWORD)); password.setStyleName("text_bold"); /*/*from w w w . j a v a 2s. c om*/ * CheckBox remMe = new CheckBox(LocaleDictionary.get().getConstantValue( LoginConstants.login_remember_me)); * remMe.setEnabled(false); Label forgPwd = new Label(LocaleDictionary.get().getConstantValue(LoginConstants * .login_forgot_pwd)); */ Label version = new Label(LocaleDictionary.get().getConstantValue(LoginConstants.VERSION_TEXT)); final Label versionNumber = new Label(); RootPanel.get("userName").add(userName); RootPanel.get("password").add(password); /* * RootPanel.get("remMe").add(remMe); RootPanel.get("forgPwd").add(forgPwd); */ RootPanel.get("version").add(version); ((LoginRemoteServiceAsync) createRpcService()).getProductVersion(new EphesoftAsyncCallback<String>() { @Override public void onSuccess(String version) { versionNumber.setText(version); } @Override public void customFailure(Throwable arg0) { ConfirmationDialogUtil.showConfirmationDialogError( LocaleDictionary.get().getMessageValue(LoginConstants.UNABLE_TO_RETRIVE_VERSION_INFO)); } }); RootPanel.get("versionLabel").add(versionNumber); SubmitButton submitButton = new SubmitButton(); submitButton.setFocus(true); submitButton.setText(LocaleDictionary.get().getConstantValue(LoginConstants.LOGIN_BUTTON_TEXT)); submitButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { login(); } }); submitButton.setStyleName("btn_blue"); RootPanel.get("buttonLogin").add(submitButton); final Label expiryMsg = new Label(); ((LoginRemoteServiceAsync) createRpcService()).getLicenseExpiryMsg(new EphesoftAsyncCallback<Void>() { @Override public void customFailure(Throwable arg0) { String alertMsg = arg0.getLocalizedMessage(); int indexOfDelimiter = alertMsg.indexOf('@'); String days = alertMsg.substring(0, indexOfDelimiter); int remainingDays = Integer.parseInt(days); String dateString = alertMsg.substring(indexOfDelimiter + 1); if (remainingDays != 0) { expiryMsg.setText(LocaleDictionary.get().getMessageValue(LoginMessages.LICENSE_EXPIRY_MSG, days, dateString)); } else { expiryMsg.setText( LocaleDictionary.get().getMessageValue(LoginMessages.LICENSE_EXPIRY_MSG_TODAY)); } } @Override public void onSuccess(Void arg0) { // Nothing to do .. on success of RPC call } }); expiryMsg.setStyleName(LICENSE_TEXT); RootPanel.get(EXPIRY_MSG_LEBEL).add(expiryMsg); final HorizontalPanel horPanel = new HorizontalPanel(); horPanel.setWidth("100%"); RootPanel.get().add(horPanel); ScreenMaskUtility.maskScreen("Loading"); rpcService.getFooterProperties(new EphesoftAsyncCallback<Map<String, String>>() { @Override public void onSuccess(Map<String, String> footerProperties) { String footerText = footerProperties.get(CoreCommonConstants.FOOTER_TEXT_KEY); String footerLink = footerProperties.get(CoreCommonConstants.FOOTER_LINK_KEY); final Anchor footerInfo = new Anchor(footerText, footerLink); horPanel.add(footerInfo); horPanel.setCellHorizontalAlignment(footerInfo, HasHorizontalAlignment.ALIGN_CENTER); ScreenMaskUtility.unmaskScreen(); } @Override public void customFailure(Throwable arg0) { ScreenMaskUtility.unmaskScreen(); ConfirmationDialogUtil .showConfirmationDialogError("Application could not be authorized. Please try again."); } }); }