diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java index d408867..4b4d4d9 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/AppControllerExplorer.java @@ -719,6 +719,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt DialogGetInfoBootstrap dlg = new DialogGetInfoBootstrap(fileItem); modal.add(dlg); + modal.add(modalFooter); modal.show(); } } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java index 7d09790..20b62c0 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.java @@ -10,10 +10,14 @@ import com.github.gwtbootstrap.client.ui.ControlGroup; import com.github.gwtbootstrap.client.ui.TextArea; import com.github.gwtbootstrap.client.ui.TextBox; import com.google.gwt.core.client.GWT; +import com.google.gwt.dom.client.Text; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.Widget; public class DialogGetInfoBootstrap extends Composite { @@ -29,20 +33,22 @@ public class DialogGetInfoBootstrap extends Composite { public static final String UNKNOWN = "unknown"; + //@UiField + //TextBox txtName; @UiField - TextBox txtName; + HTML txtName; @UiField - TextBox txtId; + HTML txtId; @UiField - TextBox txtLocation; + HTML txtLocation; @UiField ControlGroup cgTxtIsPublic; @UiField - TextBox txtIsPublic; + HTML txtIsPublic; @UiField TextArea txtAreaDescription; @@ -67,19 +73,20 @@ public class DialogGetInfoBootstrap extends Composite { public DialogGetInfoBootstrap(final FileModel fileModel) { initWidget(uiBinder.createAndBindUi(this)); + // Setting name - textFieldSetValue(txtName, fileModel.getName()); - textFieldSetValue(txtId, fileModel.getIdentifier()); + htmlSetValue(txtName, fileModel.getName()); + htmlSetValue(txtId, fileModel.getIdentifier()); if (fileModel.isRoot()) - txtLocation.setValue("/"); + txtLocation.setHTML("/"); else loadLocation(fileModel.getIdentifier()); if (fileModel.isDirectory()) { cgTxtIsPublic.setVisible(true); - txtIsPublic.setValue(fileModel.isPublic() + ""); + txtIsPublic.setHTML(fileModel.isPublic() + ""); /* * if (fileModel.getSynchedThreddsStatus() != null) { txtThreddsSynched = new @@ -99,32 +106,44 @@ public class DialogGetInfoBootstrap extends Composite { } else loadDescription(fileModel.getIdentifier()); + addHandlers(); + } + + private void addHandlers() { + txtAreaDescription.addClickHandler(new ClickHandler() { + + @Override + public void onClick(ClickEvent event) { + } + }); } - private void textFieldSetValue(TextBox field, String value) { + private void htmlSetValue(HTML field, String value) { if (value == null || value.isEmpty()) - field.setValue(UNKNOWN); + field.setHTML(UNKNOWN); else - field.setValue(value); + field.setHTML(value); } private void loadLocation(String itemId) { - txtLocation.setEnabled(false); + setPlaceholder(txtLocation, "loading..."); AppControllerExplorer.rpcWorkspaceService.getListParentsByItemIdentifier(itemId, false, new AsyncCallback>() { @Override public void onFailure(Throwable caught) { GWT.log("failure get list parents by item identifier " + caught); - txtLocation.setValue(UNKNOWN); - txtLocation.setEnabled(false); + removePlaceHolder(txtLocation); + txtLocation.setHTML(UNKNOWN); + //txtLocation.set(false); } @Override public void onSuccess(List result) { - + removePlaceHolder(txtLocation); + String location = ""; if (result != null) { for (FileModel fileModel : result) { @@ -135,8 +154,7 @@ public class DialogGetInfoBootstrap extends Composite { if (location.isEmpty()) location = "/"; - txtLocation.setValue(location); - txtLocation.setEnabled(true); + txtLocation.setHTML(location); } }); @@ -169,5 +187,17 @@ public class DialogGetInfoBootstrap extends Composite { }); } + + + private void setPlaceholder(HTML html, String placeholder) { + html.setHTML(placeholder); + html.getElement().getStyle().setColor("#E8E8E8"); + } + + private void removePlaceHolder(HTML html) { + html.setHTML(""); + html.getElement().getStyle().setColor("#000"); + } + } diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml index e533d56..2089d73 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml +++ b/src/main/java/org/gcube/portlets/user/workspace/client/view/windows/DialogGetInfoBootstrap.ui.xml @@ -42,6 +42,15 @@ .no-border { border: 0px; } + + .html-value-style { + padding-top: 5px; + font-family: Arial, Helvetica, sans-serif; + } + + .label-style { + color: gray; + } @@ -51,39 +60,45 @@ - + Name - - + + - + Id - - + + - + Location - - + + - + Public Folder - - + + - + Description - + diff --git a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css index ad9e41b..3bb54fa 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css +++ b/src/main/java/org/gcube/portlets/user/workspace/public/workspacetree.css @@ -300,4 +300,35 @@ table.userssuggest th { cursor: default; color: gray !important; text-decoration: none; -} \ No newline at end of file +} + + +.my-control-group-get-info{ + margin-bottom: 10px !important; + font-size: 14px !important; + font-family: Arial, serif; +} +.my-control-group-get-info .controls{ + margin-left: 70px !important; +} + +.my-control-group-get-info .control-label { + width: 80px !important; + text-align: center !important; + padding-right: 10px !important; + color: #5f6368; +} + +.my-control-group-get-info .add-on{ + width: 20px !important; +} + +.my-control-group-get-info .gwt-HTML { + padding-top: 5px; + font-family: Roboto, Arial, serif !important; +} + +.my-control-group-get-info .gwt-TextBox:hover { + cursor: text !important; +} +