Skip to content

Commit

Permalink
show all box makes sense now
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandunn committed Dec 18, 2019
1 parent 681786e commit 15161cd
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 107 deletions.
51 changes: 36 additions & 15 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.java
Expand Up @@ -52,6 +52,7 @@
import org.gwtbootstrap3.client.ui.ListBox;
import org.gwtbootstrap3.client.ui.TextBox;
import org.gwtbootstrap3.client.ui.*;
import org.gwtbootstrap3.client.ui.constants.ButtonType;
import org.gwtbootstrap3.client.ui.constants.IconType;
import org.gwtbootstrap3.extras.bootbox.client.Bootbox;

Expand Down Expand Up @@ -124,8 +125,8 @@ interface AnnotatorPanelUiBinder extends UiBinder<com.google.gwt.user.client.ui.
DockLayoutPanel splitPanel;
@UiField
Container northPanelContainer;
@UiField
Button toggleAnnotation;
// @UiField
// Button toggleAnnotation;
@UiField
com.google.gwt.user.client.ui.ListBox pageSizeSelector;
@UiField
Expand All @@ -140,6 +141,8 @@ interface AnnotatorPanelUiBinder extends UiBinder<com.google.gwt.user.client.ui.
static AttributePanel attributePanel;
@UiField
CheckBox uniqueNameCheckBox;
@UiField
Button showAllSequences;


// manage UI-state
Expand Down Expand Up @@ -819,6 +822,8 @@ private String getType(JSONObject internalData) {
}

public void reload(Boolean forceReload) {
showAllSequences.setEnabled(isSearchDirty());
showAllSequences.setType(isSearchDirty() ? ButtonType.INFO : ButtonType.DEFAULT);
if (MainPanel.annotatorPanel.isVisible() || forceReload) {
hideDetailPanels();
pager.setPageStart(0);
Expand All @@ -830,6 +835,18 @@ public void reload() {
reload(false);
}

private Boolean isSearchDirty() {
if(typeList.getSelectedIndex()>0) return true;
if(userField.getSelectedIndex()>0) return true;
if(goOnlyCheckBox.getValue()) return true;
if(uniqueNameCheckBox.getValue()) return true;
if(uniqueNameCheckBox.getValue()) return true;
if(nameSearchBox.getText().trim().length()>0) return true;
if(sequenceList.getValue().trim().length()>0) return true;

return false ;
}

@UiHandler(value = {"pageSizeSelector"})
public void changePageSize(ChangeEvent changeEvent) {
pageSize = Integer.parseInt(pageSizeSelector.getSelectedValue());
Expand All @@ -851,27 +868,31 @@ public void searchName(KeyUpEvent keyUpEvent) {
public void setShowAllSequences(ClickEvent clickEvent) {
nameSearchBox.setText("");
sequenceList.setText("");
userField.setSelectedIndex(0);
typeList.setSelectedIndex(0);
uniqueNameCheckBox.setValue(false);
goOnlyCheckBox.setValue(false);
reload();
}


private void handleDetails() {
if (showDetails) {
toggleAnnotation.setText("Hide Details");
toggleAnnotation.setIcon(IconType.EYE_SLASH);
} else {
toggleAnnotation.setText("Show Details");
toggleAnnotation.setIcon(IconType.INFO_CIRCLE);
}
// if (showDetails) {
// toggleAnnotation.setText("Hide Details");
// toggleAnnotation.setIcon(IconType.EYE_SLASH);
// } else {
// toggleAnnotation.setText("Show Details");
// toggleAnnotation.setIcon(IconType.INFO_CIRCLE);
// }

tabPanel.setVisible(showDetails && singleSelectionModel.getSelectedObject() != null);
}

@UiHandler("toggleAnnotation")
void toggleAnnotation(ClickEvent clickEvent) {
showDetails = !showDetails;
handleDetails();
}
//
// @UiHandler("toggleAnnotation")
// void toggleAnnotation(ClickEvent clickEvent) {
// showDetails = !showDetails;
// handleDetails();
// }


private static AnnotationInfo getChildAnnotation(AnnotationInfo annotationInfo, String uniqueName) {
Expand Down
192 changes: 100 additions & 92 deletions src/gwt/org/bbop/apollo/gwt/client/AnnotatorPanel.ui.xml
Expand Up @@ -30,7 +30,8 @@
display: inline;
margin: 5px;
}
.checkBox{

.checkBox {
display: inline;
/*margin: 5px;*/
background-color: grey;
Expand All @@ -43,7 +44,7 @@
/*border: solid black 5px;*/
}

.idCheckBox{
.idCheckBox {
display: inline;
font-weight: bolder;
/*margin: 5px;*/
Expand All @@ -59,6 +60,12 @@
margin-bottom: 40px;
}

.topRowPadding {
margin-bottom: 0px;
padding-bottom: 0px;
border-top: gray 2px solid;
}

.dataGrid td {
word-wrap: break-word;
}
Expand All @@ -73,16 +80,26 @@
margin-left: 10px;
margin-right: 10px;
}

.showAllButtonRow {
display: inline;
margin-left: 20px;
/*padding-bottom: 15px;*/
margin-top: 5px !important;
margin-bottom: 5px !important;
}

.pageSizeSelector {
display: inline;
width: 40px;
margin-top: 5px;
}
</ui:style>
<gwt:DockLayoutPanel ui:field="splitPanel">
<gwt:north size="130">
<gwt:north size="140">
<b:Container fluid="true" styleName="{style.northPanel}" ui:field="northPanelContainer">
<b:Row styleName="{style.rowPadding}">
<b:Button text="Show All" ui:field="showAllSequences" addStyleNames="{style.showAllButtonRow}"/>
<b:Row styleName="{style.topRowPadding}">
<b:Column size="MD_4">
<b:TextBox placeholder="Annotation Name"
ui:field="nameSearchBox" addStyleNames="{style.widgetBox}"/>
Expand All @@ -105,91 +122,82 @@
<b:ListBox ui:field="userField" addStyleNames="{style.widgetBox}"/>
</b:Column>
</b:Row>
<b:Row>
<b:Column size="MD_4">
<b:Button text="Show All" ui:field="showAllSequences" styleName="{style.widgetBox}"/>
</b:Column>
<b:Column size="MD_6">
<b:Button text="Details"
ui:field="toggleAnnotation" enabled="true" dataToggle="BUTTON"
addStyleNames="{style.action-buttons}"/>
</b:Column>

</b:Row>
</b:Container>
</gwt:north>
<gwt:center>
<gwt:DockLayoutPanel>
<gwt:north size="30">
<gwt:HTMLPanel>
<table style="width:100%">
<tr>
<td style="width:20%">
<b:Label text="Rows" styleName="{style.pageSizeLabel}"/>
<b:ListBox title="Rows"
ui:field="pageSizeSelector" styleName="{style.pageSizeSelector}"
/>
</td>
<td align="center">
<apollo:WebApolloSimplePager ui:field="pager" styleName="{style.pager}"/>
</td>
<td style="width:20%">
</td>
</tr>
</table>
</gwt:HTMLPanel>
</gwt:north>
<gwt:center>
<cellview:DataGrid ui:field="dataGrid" styleName="{style.dataGrid}"/>
</gwt:center>
</gwt:DockLayoutPanel>
</gwt:center>
<gwt:south size="440">
<gwt:TabLayoutPanel barHeight="35" ui:field="tabPanel">
<gwt:tab>
<gwt:header>Details</gwt:header>
<b:Container fluid="true" width="100%">
<b:Row>
<apollo:GeneDetailPanel ui:field="geneDetailPanel" visible="false"/>
<apollo:VariantDetailPanel ui:field="variantDetailPanel" visible="false"/>
<apollo:TranscriptDetailPanel ui:field="transcriptDetailPanel" visible="false"/>
<apollo:RepeatRegionDetailPanel ui:field="repeatRegionDetailPanel" visible="false"/>
</b:Row>
</b:Container>
</gwt:tab>
<gwt:tab>
<gwt:header>Coding</gwt:header>
<apollo:ExonDetailPanel ui:field="exonDetailPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Alternate Alleles</gwt:header>
<apollo:VariantAllelesPanel ui:field="variantAllelesPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Variant Info</gwt:header>
<apollo:VariantInfoPanel ui:field="variantInfoPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Allele Info</gwt:header>
<apollo:AlleleInfoPanel ui:field="alleleInfoPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>GO</gwt:header>
<apollo:GoPanel ui:field="goPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>DbXref</gwt:header>
<apollo:DbXrefPanel ui:field="dbXrefPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Comment</gwt:header>
<apollo:CommentPanel ui:field="commentPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Attributes</gwt:header>
<apollo:AttributePanel ui:field="attributePanel"/>
</gwt:tab>
</gwt:TabLayoutPanel>
</gwt:south>
</gwt:DockLayoutPanel>
</ui:UiBinder>
<!-- </b:PanelBody>-->
<!-- </b:Panel>-->
</b:Container>
</gwt:north>
<gwt:center>
<gwt:DockLayoutPanel>
<gwt:north size="30">
<gwt:HTMLPanel>
<table style="width:100%">
<tr>
<td style="width:20%">
<b:Label text="Rows" styleName="{style.pageSizeLabel}"/>
<b:ListBox title="Rows"
ui:field="pageSizeSelector" styleName="{style.pageSizeSelector}"
/>
</td>
<td align="center">
<apollo:WebApolloSimplePager ui:field="pager" styleName="{style.pager}"/>
</td>
<td style="width:20%">
</td>
</tr>
</table>
</gwt:HTMLPanel>
</gwt:north>
<gwt:center>
<cellview:DataGrid ui:field="dataGrid" styleName="{style.dataGrid}"/>
</gwt:center>
</gwt:DockLayoutPanel>
</gwt:center>
<gwt:south size="440">
<gwt:TabLayoutPanel barHeight="35" ui:field="tabPanel">
<gwt:tab>
<gwt:header>Details</gwt:header>
<b:Container fluid="true" width="100%">
<b:Row>
<apollo:GeneDetailPanel ui:field="geneDetailPanel" visible="false"/>
<apollo:VariantDetailPanel ui:field="variantDetailPanel" visible="false"/>
<apollo:TranscriptDetailPanel ui:field="transcriptDetailPanel" visible="false"/>
<apollo:RepeatRegionDetailPanel ui:field="repeatRegionDetailPanel" visible="false"/>
</b:Row>
</b:Container>
</gwt:tab>
<gwt:tab>
<gwt:header>Coding</gwt:header>
<apollo:ExonDetailPanel ui:field="exonDetailPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Alternate Alleles</gwt:header>
<apollo:VariantAllelesPanel ui:field="variantAllelesPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Variant Info</gwt:header>
<apollo:VariantInfoPanel ui:field="variantInfoPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Allele Info</gwt:header>
<apollo:AlleleInfoPanel ui:field="alleleInfoPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>GO</gwt:header>
<apollo:GoPanel ui:field="goPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>DbXref</gwt:header>
<apollo:DbXrefPanel ui:field="dbXrefPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Comment</gwt:header>
<apollo:CommentPanel ui:field="commentPanel"/>
</gwt:tab>
<gwt:tab>
<gwt:header>Attributes</gwt:header>
<apollo:AttributePanel ui:field="attributePanel"/>
</gwt:tab>
</gwt:TabLayoutPanel>
</gwt:south>
</gwt:DockLayoutPanel>
</ui:UiBinder>

0 comments on commit 15161cd

Please sign in to comment.