Skip to content

Commit

Permalink
205: simple PitUiUpdate
Browse files Browse the repository at this point in the history
I seem to understand that no one is using the passed html so I removed
that

Task-Url: #205
  • Loading branch information
LorenzoBettini committed Aug 24, 2022
1 parent 2b3d400 commit a95cd0e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,13 @@
*/
public class PitUiUpdate {

private final String html;

private PitUiUpdate(String html) {
this.html = html;
}

public String getHtml() {
return html;
private PitUiUpdate() {
}

public static final class Builder {

private String html;

public Builder withHtml(String html) {
this.html = html;
return this;
}

public PitUiUpdate build() {
return new PitUiUpdate(html);
return new PitUiUpdate();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package org.pitest.pitclipse.ui.view;

import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.ProgressEvent;
import org.eclipse.swt.browser.ProgressListener;
import org.pitest.pitclipse.core.extension.handler.ExtensionPointHandler;
Expand All @@ -31,11 +30,9 @@
public class PitUiUpdatePublisher implements ProgressListener {

private static final String EXTENSION_POINT_ID = "org.pitest.pitclipse.ui.results";
private final Browser browser;
private final ExtensionPointHandler<PitUiUpdate> handler;

public PitUiUpdatePublisher(Browser browser) {
this.browser = browser;
public PitUiUpdatePublisher() {
this.handler = new ExtensionPointHandler<>(EXTENSION_POINT_ID);
}

Expand All @@ -44,8 +41,7 @@ public void changed(ProgressEvent event) {
}

public void completed(ProgressEvent event) {
PitUiUpdate update = new PitUiUpdate.Builder().withHtml(
browser.getText()).build();
PitUiUpdate update = new PitUiUpdate.Builder().build();
handler.execute(Platform.getExtensionRegistry(), update);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public synchronized void createPartControl(Composite parent) {
() -> {
browser = new Browser(parent, SWT.NONE);
resetBrowser();
browser.addProgressListener(new PitUiUpdatePublisher(browser));
browser.addProgressListener(new PitUiUpdatePublisher());
IActionBars actionBars = getViewSite().getActionBars();
IToolBarManager toolBar = actionBars.getToolBarManager();
// create back button
Expand Down

0 comments on commit a95cd0e

Please sign in to comment.