topNavPanel.setStyleName("workspace-NavHeader");
navigationLabel.setStyleName("workspace-NavHeaderText");
topNavPanel.add(navigationLabel);
final ImageResource collapseLeft = erraiImageBundle.collapseLeft();
final ImageResource collapseRight = erraiImageBundle.collapseRight();
final Image collapseButton = new Image(collapseLeft);
collapseButton.setStyleName("workspace-NavCollapseButton");
collapseButton.addClickHandler(new ClickHandler() {
private boolean collapse = false;
public void onClick(ClickEvent event) {
if (!collapse) {
Timer timer = new Timer() {
int i = navigation.getOffsetWidth();
int step = 10;
public void run() {
i -= step;
setSize();
if (i <= 12) {
cancel();
i = 12;
setSize();
navigation.setWidth(i + "px");
leftPanel.setArmed(true);
collapseNavPanel();
}
}
private void setSize() {
leftPanel.setWidth(i + "px");
leftPanel.setHeight("100%");
}
};
timer.scheduleRepeating(10);
navigation.setVisible(false);
navigationLabel.setVisible(false);
collapseButton.setUrl(collapseRight.getURL());
} else {
leftPanel.setArmed(false);
Timer timer = new Timer() {
int i = 12;
int step = 1;