starting view details
This commit is contained in:
parent
dcf468bef5
commit
a72d7de599
|
@ -148,14 +148,12 @@ public class GeoportalDataViewer implements EntryPoint {
|
|||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
GWT.log("QUI: "+caught.toString());
|
||||
Window.alert(caught.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ConcessioneDV result) {
|
||||
GWT.log("Concessione is: "+result);
|
||||
mainPanel.addNewTab(result);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client.ui;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.gis.OpenLayerOSM;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.client.ui.concessione.ConcessioneView;
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
|
@ -15,7 +16,6 @@ import com.google.gwt.event.shared.HandlerManager;
|
|||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
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 GeonaDataViewMainPanel extends Composite {
|
||||
|
@ -121,7 +121,7 @@ public class GeonaDataViewMainPanel extends Composite {
|
|||
String nome = cdv.getNome();
|
||||
tab.setHeading(nome);
|
||||
|
||||
tab.add(new HTML(cdv.toString()));
|
||||
tab.add(new ConcessioneView(cdv));
|
||||
mainTabPanel.add(tab);
|
||||
tab.asWidget().getElement().focus();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
package org.gcube.portlets.user.geoportaldataviewer.client.ui.concessione;
|
||||
|
||||
import org.gcube.portlets.user.geoportaldataviewer.shared.products.ConcessioneDV;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Column;
|
||||
import com.github.gwtbootstrap.client.ui.Heading;
|
||||
import com.github.gwtbootstrap.client.ui.Label;
|
||||
import com.github.gwtbootstrap.client.ui.Paragraph;
|
||||
import com.github.gwtbootstrap.client.ui.constants.LabelType;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.FlowPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
||||
|
||||
|
||||
public class ConcessioneView extends Composite {
|
||||
|
||||
private static ConcessioneViewUiBinder uiBinder = GWT.create(ConcessioneViewUiBinder.class);
|
||||
|
||||
interface ConcessioneViewUiBinder extends UiBinder<Widget, ConcessioneView> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
Heading titolo;
|
||||
|
||||
@UiField
|
||||
Paragraph introduzione;
|
||||
|
||||
@UiField
|
||||
Column autori;
|
||||
|
||||
@UiField
|
||||
Column contributore;
|
||||
|
||||
public ConcessioneView() {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
|
||||
public ConcessioneView(ConcessioneDV concessione) {
|
||||
this();
|
||||
titolo.setText(concessione.getNome());
|
||||
introduzione.setText(concessione.getIntroduzione());
|
||||
|
||||
for (String author : concessione.getAuthors()) {
|
||||
addLabel(autori, author);
|
||||
//autori.add(new Label(author));
|
||||
}
|
||||
|
||||
addLabel(contributore, concessione.getContributore());
|
||||
}
|
||||
|
||||
public void addLabel(FlowPanel w, String labelValue, LabelType type){
|
||||
Label label = new Label(labelValue);
|
||||
label.setType(type);
|
||||
label.getElement().getStyle().setMarginRight(5, Unit.PX);
|
||||
w.add(label);
|
||||
}
|
||||
|
||||
public void addLabel(FlowPanel w, String labelValue){
|
||||
com.google.gwt.user.client.ui.Label label = new com.google.gwt.user.client.ui.Label(labelValue);
|
||||
label.getElement().getStyle().setMarginRight(5, Unit.PX);
|
||||
w.add(label);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
<!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>
|
||||
.important {
|
||||
font-weight: bold;
|
||||
}
|
||||
.margin-left-10 {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<b:Hero>
|
||||
<b:Heading size="2" ui:field="titolo">Hero Unit</b:Heading>
|
||||
<b:Paragraph ui:field="introduzione">Some Text for the Hero Unit.</b:Paragraph>
|
||||
</b:Hero>
|
||||
<g:HTMLPanel ui:field="container" addStyleNames="{style.margin-left-10}">
|
||||
<b:Row>
|
||||
<b:Column size="2">
|
||||
<g:Label>Autori</g:Label>
|
||||
</b:Column>
|
||||
<b:Column size="8" ui:field="autori"></b:Column>
|
||||
</b:Row>
|
||||
<b:Row >
|
||||
<b:Column size="2">
|
||||
<g:Label>Contributore</g:Label>
|
||||
</b:Column>
|
||||
<b:Column size="8" ui:field="contributore"></b:Column>
|
||||
</b:Row>
|
||||
</g:HTMLPanel>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
Loading…
Reference in New Issue