#23587 Implementing GUI based on tree data structure
This commit is contained in:
parent
b32b58e90d
commit
93f87145b7
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -10,8 +10,23 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
#### Enhancements
|
||||
|
||||
- [#22684] Porting to Profiled Document
|
||||
- [#23587] GUI model viewer passed to tree data structure
|
||||
- Moved to maven-portal-bom v3.7.0[-SNAPSHOT]
|
||||
|
||||
## [v2.2.1] - 2022-06-29
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#23593] Shown the published/unpublished field in the table
|
||||
- Passed to maven-portal-bom 3.6.4
|
||||
|
||||
## [v2.2.0] - 2022-06-08
|
||||
|
||||
#### Enhancements
|
||||
|
||||
- [#23390] Implemented facility: "Clone Project"
|
||||
- [#23457] Implemented the "Publish/UnPublish Project" facility
|
||||
|
||||
## [v2.1.0] - 2021-11-24
|
||||
|
||||
#### Enhancements
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord;
|
|||
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.BuildValidationReport;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.tree.TreeItemPanel;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogConfirm;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
|
||||
|
@ -142,8 +143,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
* This is the entry point method.
|
||||
*/
|
||||
public void onModuleLoad() {
|
||||
|
||||
TreeItemPanel tip = new TreeItemPanel("Concessioni");
|
||||
RootPanel.get(DIV_PORTLET_ID).add(tip.getTree());
|
||||
|
||||
RootPanel.get(DIV_PORTLET_ID).add(loader);
|
||||
/*RootPanel.get(DIV_PORTLET_ID).add(loader);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeonaISConfig>() {
|
||||
|
||||
|
@ -260,7 +264,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
}
|
||||
|
||||
}
|
||||
});
|
||||
});*/
|
||||
}
|
||||
|
||||
private void initGUI() {
|
||||
|
|
|
@ -149,6 +149,10 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
|||
return dtformat.format(cd);
|
||||
} else if (displayName.equalsIgnoreCase("Created by")) {
|
||||
return ((ConcessioneDV) object).getCreationUser();
|
||||
}else if (displayName.toLowerCase().contains("unpub")) {
|
||||
ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport();
|
||||
if (vr != null && vr.getObjectName() != null)
|
||||
return vr.getObjectName();
|
||||
}
|
||||
|
||||
return "";
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.ui.tree;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.constants.IconSize;
|
||||
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||
import com.github.gwtbootstrap.client.ui.resources.ButtonSize;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
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.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Window;
|
||||
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTML;
|
||||
import com.google.gwt.user.client.ui.HasText;
|
||||
import com.google.gwt.user.client.ui.TreeItem;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
public class NodeItem extends Composite {
|
||||
|
||||
private static NodeItemUiBinder uiBinder = GWT.create(NodeItemUiBinder.class);
|
||||
|
||||
interface NodeItemUiBinder extends UiBinder<Widget, NodeItem> {
|
||||
}
|
||||
|
||||
public NodeItem() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
@UiField
|
||||
HTML htmlNode;
|
||||
|
||||
@UiField
|
||||
Button buttonAdd;
|
||||
|
||||
@UiField
|
||||
Button buttonRemove;
|
||||
|
||||
public NodeItem(TreeItem parent, String nodeLabel, Integer minOccurs, Integer maxOccurs) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
htmlNode.setHTML(nodeLabel);
|
||||
|
||||
buttonAdd.setIcon(IconType.COPY);
|
||||
buttonRemove.setIcon(IconType.TRASH);
|
||||
|
||||
htmlNode.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
|
||||
<ui:style>
|
||||
.margin-left-20 {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.margin-left-10 {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HorizontalPanel>
|
||||
<g:HTML ui:field="htmlNode">Node</g:HTML>
|
||||
<b:Button styleName="{style.margin-left-20}"
|
||||
ui:field="buttonAdd" title="Add New"></b:Button>
|
||||
<b:Button styleName="{style.margin-left-10}"
|
||||
ui:field="buttonRemove" title="Remove"></b:Button>
|
||||
</g:HorizontalPanel>
|
||||
</ui:UiBinder>
|
|
@ -0,0 +1,35 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.ui.tree;
|
||||
|
||||
import com.google.gwt.user.client.ui.Tree;
|
||||
import com.google.gwt.user.client.ui.TreeItem;
|
||||
|
||||
public class TreeItemPanel {
|
||||
|
||||
private Tree tree = new Tree();
|
||||
|
||||
public TreeItemPanel(String projectType) {
|
||||
TreeItem root = new TreeItem();
|
||||
root.setHTML(projectType);
|
||||
|
||||
TreeItem child1 = addChild(root, "Item 1");
|
||||
TreeItem child2 = addChild(root, "Item 2");
|
||||
TreeItem child3 = addChild(root, "Item 2");
|
||||
|
||||
TreeItem child1_1 = addChild(child1, "Item 1.1");
|
||||
TreeItem child2_1 = addChild(child2, "Item 2.1");
|
||||
|
||||
tree.addItem(root);
|
||||
}
|
||||
// Create a tree with a few items in it.
|
||||
|
||||
public TreeItem addChild(TreeItem parent, String childName) {
|
||||
TreeItem child = new TreeItem(new NodeItem(parent, childName, 0, 5));
|
||||
parent.addItem(child);
|
||||
return child;
|
||||
}
|
||||
|
||||
public Tree getTree() {
|
||||
return tree;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue