Added Application Notifier. Improved Modal Expand
This commit is contained in:
parent
430d28ce03
commit
84fcc7dbb3
|
@ -86,6 +86,8 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
public static final String DIV_TIMELINE_DATA = "timeline-data";
|
public static final String DIV_TIMELINE_DATA = "timeline-data";
|
||||||
|
|
||||||
|
public static final String APP_NOTIFIER = "app-notifier";
|
||||||
|
|
||||||
/** The Constant APP_DIV. */
|
/** The Constant APP_DIV. */
|
||||||
public final static String APP_DIV = "geoportal-data-viewer";
|
public final static String APP_DIV = "geoportal-data-viewer";
|
||||||
|
|
||||||
|
@ -395,7 +397,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
if (showDetailsEvent.isLoadTimelineRelationships() && relationships != null
|
if (showDetailsEvent.isLoadTimelineRelationships() && relationships != null
|
||||||
&& relationships.size() > 0) {
|
&& relationships.size() > 0) {
|
||||||
GWT.log("LoadTimelineRelationships is true and the project has Relationships");
|
GWT.log("LoadTimelineRelationships is true and the project has Relationships");
|
||||||
timelineMS.showTimelineProjectRelations(result.getTheProjectDV());
|
timelineMS.showTimelineProjectRelations(result.getTheProjectDV(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -533,7 +535,7 @@ public class GeoportalDataViewer implements EntryPoint {
|
||||||
|
|
||||||
switch (timelineProjectRelationsEvent.getEventType()) {
|
switch (timelineProjectRelationsEvent.getEventType()) {
|
||||||
case SHOW: {
|
case SHOW: {
|
||||||
timelineMS.showTimelineProjectRelations(timelineProjectRelationsEvent.getTheProjectDV());
|
timelineMS.showTimelineProjectRelations(timelineProjectRelationsEvent.getTheProjectDV(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HIDE:
|
case HIDE:
|
||||||
|
|
|
@ -24,6 +24,25 @@ public class ProjectUtil {
|
||||||
return htmlCode;
|
return htmlCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T extends DocumentDV> String toHMLCode(boolean showkey, T document, String projectID) {
|
||||||
|
String htmlCode = "";
|
||||||
|
|
||||||
|
if (document == null)
|
||||||
|
return htmlCode;
|
||||||
|
|
||||||
|
Entry<String, Object> firstEntrySet = document.getFirstEntryOfMap();
|
||||||
|
if (firstEntrySet != null) {
|
||||||
|
htmlCode += showkey ? firstEntrySet.getKey() + ": <b>" + firstEntrySet.getValue() + "</b>"
|
||||||
|
: firstEntrySet.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (projectID != null) {
|
||||||
|
htmlCode += " (id: " + projectID + ")";
|
||||||
|
}
|
||||||
|
|
||||||
|
return htmlCode;
|
||||||
|
}
|
||||||
|
|
||||||
public static <T extends DocumentDV> String toHMLCode(T document) {
|
public static <T extends DocumentDV> String toHMLCode(T document) {
|
||||||
String htmlCode = "";
|
String htmlCode = "";
|
||||||
|
|
||||||
|
|
|
@ -149,7 +149,9 @@ public class ProjectViewer extends Composite {
|
||||||
cv.setAddLayersToMapVisible(false);
|
cv.setAddLayersToMapVisible(false);
|
||||||
int width = Window.getClientWidth() * 75 / 100;
|
int width = Window.getClientWidth() * 75 / 100;
|
||||||
int height = Window.getClientHeight() * 70 / 100;
|
int height = Window.getClientHeight() * 70 / 100;
|
||||||
ModalWindow mw = new ModalWindow(theTitle, width, height);
|
|
||||||
|
String modalTitle = ProjectUtil.toHMLCode(false, theProjectView.getTheProjectDV().getTheDocument(), theProjectView.getTheProjectDV().getId());
|
||||||
|
ModalWindow mw = new ModalWindow(modalTitle, width, height);
|
||||||
mw.add(cv);
|
mw.add(cv);
|
||||||
mw.setCaller(ProjectViewer.this);
|
mw.setCaller(ProjectViewer.this);
|
||||||
// mw.setWidth(900);
|
// mw.setWidth(900);
|
||||||
|
|
|
@ -3,9 +3,13 @@ package org.gcube.portlets.user.geoportaldataviewer.client.ui.cms.project.relati
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||||
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
|
import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewer;
|
||||||
|
|
||||||
|
import com.github.gwtbootstrap.client.ui.Popover;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.Placement;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
|
import com.google.gwt.user.client.Timer;
|
||||||
import com.google.gwt.user.client.ui.RootPanel;
|
import com.google.gwt.user.client.ui.RootPanel;
|
||||||
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class TimelineManagerStatus {
|
public class TimelineManagerStatus {
|
||||||
|
|
||||||
|
@ -43,19 +47,44 @@ public class TimelineManagerStatus {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showTimelineProjectRelations(ProjectDV theProject) {
|
public void showTimelineProjectRelations(ProjectDV theProject, boolean showNotify) {
|
||||||
GWT.log("Showing project relations for: " + theProject);
|
GWT.log("Showing project relations for: " + theProject);
|
||||||
|
|
||||||
TimelineStatus timelineStatus = getTimelineOf(theProject);
|
TimelineStatus timelineStatus = getTimelineOf(theProject);
|
||||||
if (timelineStatus.isStatusChanged()) {
|
if (timelineStatus.isStatusChanged()) {
|
||||||
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).clear();
|
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).clear();
|
||||||
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).add(timelineStatus.getTimelineRP());
|
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).add(timelineStatus.getTimelineRP());
|
||||||
|
|
||||||
|
} else if (showNotify) {
|
||||||
|
setupPopover(RootPanel.get(GeoportalDataViewer.APP_NOTIFIER),
|
||||||
|
"Timeline from the selected project is already displayed", "Timeline displayed");
|
||||||
}
|
}
|
||||||
|
|
||||||
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).setVisible(true);
|
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).setVisible(true);
|
||||||
timelineStatus.getTimelineRP().setTimelineContainerVisible(true);
|
timelineStatus.getTimelineRP().setTimelineContainerVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void setupPopover(final Widget w, String message, String heading) {
|
||||||
|
|
||||||
|
final Popover popover = new Popover();
|
||||||
|
popover.setWidget(w);
|
||||||
|
popover.setText(message);
|
||||||
|
if (heading != null)
|
||||||
|
popover.setHeading(heading);
|
||||||
|
popover.setPlacement(Placement.BOTTOM);
|
||||||
|
popover.reconfigure();
|
||||||
|
popover.show();
|
||||||
|
Timer timer = new Timer() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
popover.hide();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
timer.schedule(3000);
|
||||||
|
}
|
||||||
|
|
||||||
public void hideTimelineProjectRelations() {
|
public void hideTimelineProjectRelations() {
|
||||||
GWT.log("hideTimelineProjectRelations");
|
GWT.log("hideTimelineProjectRelations");
|
||||||
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).setVisible(false);
|
RootPanel.get(GeoportalDataViewer.DIV_TIMELINE_DATA).setVisible(false);
|
||||||
|
|
|
@ -619,6 +619,12 @@ body {
|
||||||
max-height: 400px;
|
max-height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.app-notifier {
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****
|
/*****
|
||||||
RESPONSIVE
|
RESPONSIVE
|
||||||
|
|
|
@ -137,6 +137,7 @@
|
||||||
Your web browser must have JavaScript enabled in order for this
|
Your web browser must have JavaScript enabled in order for this
|
||||||
application to display correctly.</div>
|
application to display correctly.</div>
|
||||||
</noscript>
|
</noscript>
|
||||||
|
<div id="app-notifier" class="app-notifier"></div>
|
||||||
<div id="geoportal-data-viewer"></div>
|
<div id="geoportal-data-viewer"></div>
|
||||||
<div class="timeline-container">
|
<div class="timeline-container">
|
||||||
<div id="timeline-data"></div>
|
<div id="timeline-data"></div>
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div id="app-notifier" class="app-notifier"></div>
|
||||||
<div id="geoportal-data-viewer"></div>
|
<div id="geoportal-data-viewer"></div>
|
||||||
<div class="timeline-container">
|
<div class="timeline-container">
|
||||||
<div id="timeline-data"></div>
|
<div id="timeline-data"></div>
|
||||||
|
|
Loading…
Reference in New Issue