Skip to content

Commit

Permalink
Irrelevant interactor options for EHLDs are now disabled (grayed out)…
Browse files Browse the repository at this point in the history
… in the settings options
  • Loading branch information
ksidis committed Sep 20, 2017
1 parent f030498 commit 5dbfb19
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 8 deletions.
Expand Up @@ -149,7 +149,6 @@ public void run() {
refreshTimer.scheduleRepeating(RESOURCES_REFRESH);

updateCustomResources(ResourcesManager.get().getResources());
populateCustomResourceListPanel();
}

@Override
Expand Down Expand Up @@ -179,7 +178,12 @@ public void onContentRequested(ContentRequestedEvent event) {
public void onContentLoaded(ContentLoadedEvent event) {
if (event.getContext().getContent().getType() == DIAGRAM) {
context = event.getContext();
enableStaticResourceBtn(true);
} else {
enableStaticResourceBtn(false);
populateResourceListPanel();
}
populateCustomResourceListPanel();
}

@Override
Expand Down Expand Up @@ -348,6 +352,9 @@ private void populateResourceListPanel() {
summaryLb.setText("" + iContent.getUniqueRawInteractorsCountPerResource(resource.getIdentifier()));
row.add(summaryLb);
}
} else {
radioBtn.setEnabled(false);
radioBtn.addStyleName(RESOURCES.getCSS().interactorResourceListBtnDisabled());
}

liveResourcesFP.add(row);
Expand Down Expand Up @@ -385,6 +392,12 @@ public void onClick(ClickEvent clickEvent) {
}
}
});

if(context == null) {
radioBtn.setEnabled(false);
radioBtn.addStyleName(RESOURCES.getCSS().interactorResourceListBtnDisabled());
}

FlowPanel row = new FlowPanel();
row.add(radioBtn);
row.add(deleteBtn);
Expand Down Expand Up @@ -440,6 +453,15 @@ private void showLoading(boolean loading) {
}
}

private void enableStaticResourceBtn(boolean isEnabled){
staticResourceBtn.setEnabled(isEnabled);
if (isEnabled) {
staticResourceBtn.removeStyleName(RESOURCES.getCSS().interactorResourceBtnDisabled());
} else {
staticResourceBtn.addStyleName(RESOURCES.getCSS().interactorResourceBtnDisabled());
}
}

/***
* Enable the download button only if the rawInteractors mapset
* for the selected resource contains entries
Expand Down Expand Up @@ -515,6 +537,8 @@ public interface ResourceCSS extends CssResource {

String interactorResourceBtn();

String interactorResourceBtnDisabled();

String liveResourcesOuterPanel();

String liveResourcesInnerPanel();
Expand Down
Expand Up @@ -22,21 +22,22 @@
margin-left: 10px;
display: inline-block;
width: 200px;
color:rgb(0, 90, 117);
color: white;
}

.interactorResourceBtn label{
.interactorResourceBtn label {
margin-left: 5px;
cursor: pointer;
color: white;
}

.interactorResourceBtn:hover label{
margin-left: 5px;
cursor: pointer;
.interactorResourceBtn:hover {
color: rgb(6, 107, 158);
}

.interactorResourceBtnDisabled label {
color: dimgray;
}

.liveResourcesOuterPanel {
height: 85px;
width: 245px;
Expand Down Expand Up @@ -106,7 +107,8 @@
}

.interactorResourceListBtnDisabled{
width: 200px;
/*width: 200px;*/
color: dimgray;
}

.interactorResourceListBtnDisabled label{
Expand Down

0 comments on commit 5dbfb19

Please sign in to comment.