CommentsConfig extracting

This commit is contained in:
englishman 2015-08-12 21:48:45 -04:00
parent f9b37c9d02
commit 907a61c12b
3 changed files with 8 additions and 4 deletions

View File

@ -10,6 +10,7 @@ import net.azib.ipscan.core.ScanningResult;
import net.azib.ipscan.core.ScanningResultList;
import net.azib.ipscan.fetchers.MACFetcher;
import javax.inject.Inject;
import java.net.InetAddress;
import java.util.prefs.Preferences;
@ -21,6 +22,7 @@ import java.util.prefs.Preferences;
public class CommentsConfig {
private Preferences preferences;
@Inject
public CommentsConfig(Preferences preferences) {
// use a separate node for comments - they can get large
this.preferences = preferences.node("comments");

View File

@ -56,7 +56,6 @@ public class ComponentRegistry {
container.registerComponentInstance(globalConfig.forOpeners());
container.registerComponentInstance(globalConfig.forFavorites());
container.registerComponentInstance(Labels.getInstance());
container.registerComponentImplementation(CommentsConfig.class);
container.registerComponentInstance(DaggerExporterComponent.create().get());
container.registerComponentInstance(DaggerFetcherComponent.create().get());

View File

@ -20,6 +20,8 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import javax.inject.Inject;
/**
* The "Show IP Details" Window
*
@ -27,17 +29,18 @@ import org.eclipse.swt.widgets.Text;
*/
public class DetailsWindow extends AbstractModalDialog {
@Inject
CommentsConfig commentsConfig;
private GUIConfig guiConfig;
private CommentsConfig commentsConfig;
private ResultTable resultTable;
private ScanningResultList scanningResults;
int resultIndex;
private Text commentsText;
public DetailsWindow(GUIConfig guiConfig, CommentsConfig commentsConfig, ResultTable resultTable, ScanningResultList scanningResults) {
public DetailsWindow(GUIConfig guiConfig, ResultTable resultTable, ScanningResultList scanningResults) {
this.guiConfig = guiConfig;
this.commentsConfig = commentsConfig;
this.resultTable = resultTable;
this.scanningResults = scanningResults;
}