building the Get Info...
This commit is contained in:
parent
0a1e418d13
commit
98b5ae5fd7
|
@ -719,6 +719,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
DialogGetInfoBootstrap dlg = new DialogGetInfoBootstrap(fileItem);
|
||||
modal.add(dlg);
|
||||
modal.add(modalFooter);
|
||||
modal.show();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<List<FileModel>>() {
|
||||
|
||||
@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<FileModel> 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");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -42,6 +42,15 @@
|
|||
.no-border {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.html-value-style {
|
||||
padding-top: 5px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.label-style {
|
||||
color: gray;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<b:Form type="HORIZONTAL">
|
||||
|
@ -51,39 +60,45 @@
|
|||
</b:Alert>
|
||||
<b:Fieldset ui:field="fieldSetGetInfo"
|
||||
styleName="{style.noBorder}">
|
||||
<b:ControlGroup addStyleNames="my-control-group">
|
||||
<b:ControlGroup
|
||||
addStyleNames="my-control-group-get-info">
|
||||
<b:ControlLabel>Name</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox ui:field="txtName" readOnly="true">
|
||||
</b:TextBox>
|
||||
<g:HTML ui:field="txtName">
|
||||
</g:HTML>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup addStyleNames="my-control-group">
|
||||
<b:ControlGroup
|
||||
addStyleNames="my-control-group-get-info">
|
||||
<b:ControlLabel>Id</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox ui:field="txtId" readOnly="true">
|
||||
</b:TextBox>
|
||||
<g:HTML ui:field="txtId">
|
||||
</g:HTML>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup addStyleNames="my-control-group">
|
||||
<b:ControlGroup
|
||||
addStyleNames="my-control-group-get-info">
|
||||
<b:ControlLabel>Location</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox ui:field="txtLocation" readOnly="true">
|
||||
</b:TextBox>
|
||||
<g:HTML ui:field="txtLocation">
|
||||
</g:HTML>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup addStyleNames="my-control-group"
|
||||
ui:field="cgTxtIsPublic" visible="false">
|
||||
<b:ControlGroup
|
||||
addStyleNames="my-control-group-get-info" ui:field="cgTxtIsPublic"
|
||||
visible="false">
|
||||
<b:ControlLabel>Public Folder</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextBox ui:field="txtIsPublic" readOnly="true">
|
||||
</b:TextBox>
|
||||
<g:HTML ui:field="txtIsPublic">
|
||||
</g:HTML>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup addStyleNames="my-control-group">
|
||||
<b:ControlGroup
|
||||
addStyleNames="my-control-group-get-info">
|
||||
<b:ControlLabel>Description</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:TextArea ui:field="txtAreaDescription" readOnly="true">
|
||||
<b:TextArea ui:field="txtAreaDescription"
|
||||
readOnly="true">
|
||||
</b:TextArea>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
|
|
|
@ -300,4 +300,35 @@ table.userssuggest th {
|
|||
cursor: default;
|
||||
color: gray !important;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue