Skip to content

Commit

Permalink
CommentsConfig extracting
Browse files Browse the repository at this point in the history
  • Loading branch information
akryvtsun committed Aug 13, 2015
1 parent f9b37c9 commit 907a61c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/net/azib/ipscan/config/CommentsConfig.java
Expand Up @@ -10,6 +10,7 @@
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;

Expand All @@ -21,6 +22,7 @@
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");
Expand Down
1 change: 0 additions & 1 deletion src/net/azib/ipscan/config/ComponentRegistry.java
Expand Up @@ -56,7 +56,6 @@ public ComponentRegistry(java.util.List<Class> plugins) {
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());
Expand Down
9 changes: 6 additions & 3 deletions src/net/azib/ipscan/gui/DetailsWindow.java
Expand Up @@ -20,24 +20,27 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;

import javax.inject.Inject;

/**
* The "Show IP Details" Window
*
* @author Anton Keks
*/
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;
}
Expand Down

0 comments on commit 907a61c

Please sign in to comment.