setTocContent visibility

This commit is contained in:
Francesco Mangiacrapa 2022-11-18 17:07:13 +01:00
parent 1f3b3c2be1
commit 2e2ecfa41d
1 changed files with 24 additions and 10 deletions

View File

@ -88,10 +88,10 @@ public class ProjectViewer extends Composite {
@UiField
Button addLayersToMap;
@UiField
HTMLPanel toc_container;
@UiField
HTMLPanel toc_list_container;
@ -168,6 +168,7 @@ public class ProjectViewer extends Composite {
cv.setExpandViewButtonVisible(false);
cv.setRelationshipsButtonVisible(false);
cv.setAddLayersToMapVisible(false);
cv.setTocContentVisible(true);
int width = Window.getClientWidth() * 75 / 100;
int height = Window.getClientHeight() * 70 / 100;
@ -238,14 +239,15 @@ public class ProjectViewer extends Composite {
@Override
public void onClick(ClickEvent event) {
boolean visible = toc_list_container.isVisible();
if(visible) {
toc_list_container.setVisible(false);
reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
}
else {
toc_list_container.setVisible(true);
reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
}
setTocContentVisible(!visible);
// if (visible) {
// toc_list_container.setVisible(false);
// reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
// } else {
// toc_list_container.setVisible(true);
// reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
// }
}
});
@ -277,6 +279,18 @@ public class ProjectViewer extends Composite {
toc_list_anchors.appendChild(new HTML("<li>" + htmlAnchor + "</li>").getElement());
}
protected void setTocContentVisible(boolean bool) {
toc_list_container.setVisible(bool);
if (bool) {
reduceToc.setIcon(IconType.MINUS_SIGN_ALT);
} else {
reduceToc.setIcon(IconType.PLUS_SIGN_ALT);
}
}
/**
* Adds the centroid map.
*/