Skip to content

Commit

Permalink
Hide "No commit selected" while history is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Jan 3, 2012
1 parent b15069b commit 1fe85f7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,13 @@ public void onClick(ClickEvent event)
}
});
}


@Override
public void setCommitListIsLoading(boolean isLoading)
{
emptySelectionLabel_.setText(isLoading ? "" : "(No commit selected)");
}

@Override
public HandlerRegistration addViewFileRevisionHandler(
ViewFileRevisionHandler handler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
</ui:style>

<g:FlowPanel>
<!-- Text will be dynamically set to "(No commit selected)" -->
<g:Label ui:field="emptySelectionLabel_"
styleName="{style.emptySelectionLabel}"
text="(No commit selected)"/>
styleName="{style.emptySelectionLabel}"/>

<g:HTMLPanel ui:field="commitViewPanel_" visible="false">
<table class="{style.summary}" cellspacing="0" cellpadding="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HasHandlers;
import com.google.gwt.json.client.JSONNumber;
import com.google.gwt.user.cellview.client.LoadingStateChangeEvent;
import com.google.gwt.user.cellview.client.LoadingStateChangeEvent.LoadingState;
import com.google.gwt.user.client.ui.HasValue;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;
Expand Down Expand Up @@ -94,6 +96,9 @@ HandlerRegistration addSelectionChangeHandler(
HandlerRegistration addRangeChangeHandler(
RangeChangeEvent.Handler handler);

HandlerRegistration addLoadingStateChangeHandler(
LoadingStateChangeEvent.Handler handler);

CommitInfo getSelectedCommit();

void clearSelection();
Expand All @@ -107,6 +112,7 @@ public interface CommitDetailDisplay extends HasHandlers
void clearDetails();
void showDetailProgress();
void setDetails(DiffParser unifiedParser, boolean suppressViewLink);
void setCommitListIsLoading(boolean isLoading);

HandlerRegistration addViewFileRevisionHandler(
ViewFileRevisionHandler handler);
Expand Down Expand Up @@ -166,6 +172,15 @@ public void onRangeChange(RangeChangeEvent event)
view_.getCommitList().clearSelection();
}
});
view_.getCommitList().addLoadingStateChangeHandler(new LoadingStateChangeEvent.Handler()
{
@Override
public void onLoadingStateChanged(LoadingStateChangeEvent event)
{
view_.getCommitDetail().setCommitListIsLoading(
event.getLoadingState() == LoadingState.LOADING);
}
});

view_.getRefreshButton().addClickHandler(new ClickHandler()
{
Expand Down

0 comments on commit 1fe85f7

Please sign in to comment.