This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work in progress: menu template for worksapce
- Loading branch information
1 parent
ce014a8
commit 2a728d2
Showing
16 changed files
with
688 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
zanata-war/src/main/java/org/zanata/webtrans/client/presenter/HeaderPresenter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
package org.zanata.webtrans.client.presenter; | ||
|
||
import net.customware.gwt.presenter.client.EventBus; | ||
import net.customware.gwt.presenter.client.widget.WidgetDisplay; | ||
import net.customware.gwt.presenter.client.widget.WidgetPresenter; | ||
|
||
import org.zanata.webtrans.client.Application; | ||
import org.zanata.webtrans.client.resources.WebTransMessages; | ||
import org.zanata.webtrans.shared.model.UserWorkspaceContext; | ||
|
||
import com.google.gwt.event.dom.client.ClickEvent; | ||
import com.google.gwt.event.dom.client.ClickHandler; | ||
import com.google.gwt.event.dom.client.HasClickHandlers; | ||
import com.google.inject.Inject; | ||
|
||
public class HeaderPresenter extends WidgetPresenter<HeaderPresenter.Display> | ||
{ | ||
public interface Display extends WidgetDisplay | ||
{ | ||
HasClickHandlers getLogo(); | ||
|
||
HasClickHandlers getProjects(); | ||
|
||
HasClickHandlers getGroups(); | ||
|
||
HasClickHandlers getLanguages(); | ||
|
||
HasClickHandlers getHelp(); | ||
|
||
HasClickHandlers getReportProblem(); | ||
|
||
HasClickHandlers getKnownIssues(); | ||
} | ||
|
||
private final UserWorkspaceContext userWorkspaceContext; | ||
private final WebTransMessages messages; | ||
|
||
private final static String REPORT_PROBLEM_LINK = "https://bugzilla.redhat.com/enter_bug.cgi?format=guided&product=Zanata"; | ||
private final static String KNOWN_PROBLEM_LINK = "https://bugzilla.redhat.com/buglist.cgi?product=Zanata&bug_status=__open__"; | ||
|
||
@Inject | ||
public HeaderPresenter(Display display, EventBus eventBus, final WebTransMessages messages, final UserWorkspaceContext userWorkspaceContext) | ||
{ | ||
super(display, eventBus); | ||
|
||
this.messages = messages; | ||
this.userWorkspaceContext = userWorkspaceContext; | ||
} | ||
|
||
@Override | ||
protected void onBind() | ||
{ | ||
display.getLogo().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.exitWorkspace(); | ||
Application.redirectToZanataHome(); | ||
} | ||
}); | ||
|
||
display.getProjects().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.exitWorkspace(); | ||
Application.redirectToZanataProject(); | ||
|
||
} | ||
}); | ||
|
||
display.getGroups().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.exitWorkspace(); | ||
Application.redirectToZanataGroup(); | ||
|
||
} | ||
}); | ||
|
||
display.getLanguages().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.exitWorkspace(); | ||
Application.redirectToZanataLanguage(); | ||
|
||
} | ||
}); | ||
|
||
display.getHelp().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.exitWorkspace(); | ||
Application.redirectToZanataHelp(); | ||
} | ||
}); | ||
|
||
display.getReportProblem().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.openNewWindowToUrl(REPORT_PROBLEM_LINK); | ||
} | ||
}); | ||
|
||
display.getKnownIssues().addClickHandler(new ClickHandler() | ||
{ | ||
@Override | ||
public void onClick(ClickEvent event) | ||
{ | ||
Application.openNewWindowToUrl(KNOWN_PROBLEM_LINK); | ||
} | ||
}); | ||
|
||
} | ||
|
||
@Override | ||
protected void onUnbind() | ||
{ | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
protected void onRevealDisplay() | ||
{ | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.