-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compiles but has runtime errors due to Guava not being GWT Serializable
- Loading branch information
1 parent
68716ee
commit 8ae08ac
Showing
28 changed files
with
5,529 additions
and
16 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
57 changes: 57 additions & 0 deletions
57
...ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubIssuePresenter.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,57 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.auto.factory.AutoFactory; | ||
import com.google.auto.factory.Provided; | ||
import com.google.gwt.event.shared.EventBus; | ||
import com.google.gwt.user.client.ui.AcceptsOneWidget; | ||
import edu.stanford.bmir.protege.web.client.showdown.Showdown; | ||
import edu.stanford.bmir.protege.web.shared.event.WebProtegeEventBus; | ||
import edu.stanford.bmir.protege.web.shared.gh.GitHubIssue; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* Matthew Horridge | ||
* Stanford Center for Biomedical Informatics Research | ||
* 2024-05-21 | ||
*/ | ||
@AutoFactory | ||
public class GitHubIssuePresenter { | ||
|
||
private final GitHubIssueView view; | ||
|
||
private final GitHubLabelPresenterFactory labelPresenterFactory; | ||
|
||
private WebProtegeEventBus eventBus; | ||
|
||
@Inject | ||
public GitHubIssuePresenter(@Provided GitHubIssueView view, | ||
@Provided GitHubLabelPresenterFactory labelPresenterFactory) { | ||
this.view = view; | ||
this.labelPresenterFactory = labelPresenterFactory; | ||
} | ||
|
||
public void start(WebProtegeEventBus eventBus, AcceptsOneWidget container) { | ||
this.eventBus = eventBus; | ||
container.setWidget(view); | ||
} | ||
|
||
public void displayIssue(GitHubIssue issue) { | ||
String bodyInMarkdown = Showdown.renderMarkdown(issue.body()); | ||
view.setIssueTitle(issue.title()); | ||
view.setBody(bodyInMarkdown); | ||
view.setHtmlUrl(issue.htmlUrl()); | ||
issue.labels() | ||
.forEach(label -> { | ||
AcceptsOneWidget labelContainer = view.addLabelContainer(); | ||
GitHubLabelPresenter labelPresenter = labelPresenterFactory.create(); | ||
labelPresenter.start(eventBus, labelContainer); | ||
labelPresenter.displayLabel(label); | ||
}); | ||
} | ||
|
||
public void stop() { | ||
|
||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubIssueView.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,24 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.auto.factory.AutoFactory; | ||
import com.google.gwt.user.client.ui.AcceptsOneWidget; | ||
import com.google.gwt.user.client.ui.IsWidget; | ||
|
||
import javax.annotation.Nonnull; | ||
|
||
/** | ||
* Matthew Horridge | ||
* Stanford Center for Biomedical Informatics Research | ||
* 2024-05-21 | ||
*/ | ||
public interface GitHubIssueView extends IsWidget { | ||
|
||
void setIssueTitle(@Nonnull String title); | ||
|
||
void setBody(@Nonnull String body); | ||
|
||
void setHtmlUrl(String s); | ||
|
||
AcceptsOneWidget addLabelContainer(); | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
...-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubIssueViewImpl.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,57 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.gwt.core.client.GWT; | ||
import com.google.gwt.uibinder.client.UiBinder; | ||
import com.google.gwt.uibinder.client.UiField; | ||
import com.google.gwt.user.client.ui.*; | ||
|
||
import javax.annotation.Nonnull; | ||
import javax.inject.Inject; | ||
|
||
public class GitHubIssueViewImpl extends Composite implements GitHubIssueView { | ||
|
||
interface GitHubIssueViewImplUiBinder extends UiBinder<HTMLPanel, GitHubIssueViewImpl> { | ||
|
||
} | ||
|
||
private static GitHubIssueViewImplUiBinder ourUiBinder = GWT.create(GitHubIssueViewImplUiBinder.class); | ||
|
||
@UiField | ||
Label issueTitle; | ||
|
||
@UiField | ||
Label issueBody; | ||
|
||
@UiField | ||
Anchor htmlUrl; | ||
|
||
@UiField | ||
HTMLPanel labelContainer; | ||
|
||
@Inject | ||
public GitHubIssueViewImpl() { | ||
initWidget(ourUiBinder.createAndBindUi(this)); | ||
} | ||
|
||
@Override | ||
public void setIssueTitle(@Nonnull String title) { | ||
issueTitle.setText(title); | ||
} | ||
|
||
@Override | ||
public void setBody(@Nonnull String body) { | ||
issueBody.setText(body); | ||
} | ||
|
||
@Override | ||
public void setHtmlUrl(String s) { | ||
htmlUrl.setHref(s); | ||
} | ||
|
||
@Override | ||
public AcceptsOneWidget addLabelContainer() { | ||
SimplePanel container = new SimplePanel(); | ||
labelContainer.add(container); | ||
return container; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...i-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubIssueViewImpl.ui.xml
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,18 @@ | ||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' | ||
xmlns:g='urn:import:com.google.gwt.user.client.ui'> | ||
<ui:with field="wp" type="edu.stanford.bmir.protege.web.resources.WebProtegeClientBundle"/> | ||
<ui:style> | ||
.outer { | ||
padding: 10px; | ||
} | ||
.title { | ||
font-weight: bolder; | ||
} | ||
</ui:style> | ||
<g:HTMLPanel addStyleNames="{style.outer}"> | ||
<g:Label ui:field="issueTitle" addStyleNames="{style.title}"/> | ||
<g:Label ui:field="issueBody" addStyleNames="{wp.discussion.commentBody}"/> | ||
<g:HTMLPanel ui:field="labelContainer"/> | ||
<g:Anchor target="_blank" ui:field="htmlUrl">View on GitHub</g:Anchor> | ||
</g:HTMLPanel> | ||
</ui:UiBinder> |
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
36 changes: 36 additions & 0 deletions
36
...ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubLabelPresenter.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,36 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.auto.factory.AutoFactory; | ||
import com.google.auto.factory.Provided; | ||
import com.google.gwt.user.client.ui.AcceptsOneWidget; | ||
import edu.stanford.bmir.protege.web.shared.color.Color; | ||
import edu.stanford.bmir.protege.web.shared.event.WebProtegeEventBus; | ||
import edu.stanford.bmir.protege.web.shared.gh.GitHubLabel; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* Matthew Horridge | ||
* Stanford Center for Biomedical Informatics Research | ||
* 2024-05-21 | ||
*/ | ||
@AutoFactory | ||
public class GitHubLabelPresenter { | ||
|
||
private final GitHubLabelView view; | ||
|
||
@Inject | ||
public GitHubLabelPresenter(@Provided GitHubLabelView view) { | ||
this.view = view; | ||
} | ||
|
||
public void start(WebProtegeEventBus eventBus, AcceptsOneWidget container) { | ||
container.setWidget(view); | ||
} | ||
|
||
public void displayLabel(GitHubLabel label) { | ||
view.setName(label.name()); | ||
view.setColor("#" + label.color()); | ||
view.setDescription(label.description()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...-gwt-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubLabelView.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,18 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.gwt.user.client.ui.IsWidget; | ||
import edu.stanford.bmir.protege.web.shared.color.Color; | ||
|
||
/** | ||
* Matthew Horridge | ||
* Stanford Center for Biomedical Informatics Research | ||
* 2024-05-21 | ||
*/ | ||
public interface GitHubLabelView extends IsWidget { | ||
|
||
void setName(String title); | ||
|
||
void setColor(String color); | ||
|
||
void setDescription(String description); | ||
} |
44 changes: 44 additions & 0 deletions
44
...-ui-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubLabelViewImpl.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,44 @@ | ||
package edu.stanford.bmir.protege.web.client.gh; | ||
|
||
import com.google.gwt.core.client.GWT; | ||
import com.google.gwt.uibinder.client.UiBinder; | ||
import com.google.gwt.uibinder.client.UiField; | ||
import com.google.gwt.user.client.ui.Composite; | ||
import com.google.gwt.user.client.ui.HTMLPanel; | ||
import com.google.gwt.user.client.ui.Label; | ||
import edu.stanford.bmir.protege.web.client.tooltip.Tooltip; | ||
import edu.stanford.bmir.protege.web.shared.color.Color; | ||
|
||
import javax.inject.Inject; | ||
|
||
public class GitHubLabelViewImpl extends Composite implements GitHubLabelView { | ||
|
||
interface GitHubLabelViewImplUiBinder extends UiBinder<HTMLPanel, GitHubLabelViewImpl> { | ||
|
||
} | ||
|
||
private static GitHubLabelViewImplUiBinder ourUiBinder = GWT.create(GitHubLabelViewImplUiBinder.class); | ||
|
||
@UiField | ||
Label name; | ||
|
||
@Inject | ||
public GitHubLabelViewImpl() { | ||
initWidget(ourUiBinder.createAndBindUi(this)); | ||
} | ||
|
||
@Override | ||
public void setName(String title) { | ||
name.setText(title); | ||
} | ||
|
||
@Override | ||
public void setColor(String color) { | ||
name.getElement().getStyle().setBackgroundColor(color); | ||
} | ||
|
||
@Override | ||
public void setDescription(String description) { | ||
name.getElement().setTitle(description); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...i-client/src/main/java/edu/stanford/bmir/protege/web/client/gh/GitHubLabelViewImpl.ui.xml
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,14 @@ | ||
<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' | ||
xmlns:g='urn:import:com.google.gwt.user.client.ui'> | ||
<ui:style> | ||
.gitHubLabel { | ||
padding: 5px; | ||
border-radius: 12px; | ||
display: inline-block; | ||
margin: 2px; | ||
} | ||
</ui:style> | ||
<g:HTMLPanel> | ||
<g:Label ui:field="name" addStyleNames="{style.gitHubLabel}"/> | ||
</g:HTMLPanel> | ||
</ui:UiBinder> |
Oops, something went wrong.