Quellcode durchsuchen

Merge branch 'develop' of Veronie/BggToolAnother into master

pull/2/head
Veronie vor 5 Jahren
Ursprung
Commit
ac33cc7f88
24 geänderte Dateien mit 284 neuen und 161 gelöschten Zeilen
  1. +2
    -2
      README.md
  2. +11
    -8
      xyz.veronie.bgg.ui/META-INF/MANIFEST.MF
  3. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/BggResult.java
  4. +17
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/EventConstants.java
  5. +15
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/FilterFlagState.java
  6. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultAction.java
  7. +20
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultConfig.java
  8. +59
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultConfigManager.java
  9. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/SourceFilter.java
  10. +28
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/Subtype.java
  11. +24
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/UserFlag.java
  12. +0
    -6
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/BggResult.java
  13. +0
    -30
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/ResultConfig.java
  14. +0
    -20
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/Subpage.java
  15. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/AgeSourceFilter.java
  16. +30
    -58
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/BggUserSourceFilter.java
  17. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/FamilySourceFilter.java
  18. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/GeeklistSourceFilter.java
  19. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/RankSourceFilter.java
  20. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/SearchSourceFilter.java
  21. +40
    -0
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/ThingFilterGroup.java
  22. +1
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/YearSourceFilter.java
  23. +2
    -1
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/parts/BggResultPart.java
  24. +27
    -27
      xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/parts/LoadFromBggPart.java

+ 2
- 2
README.md Datei anzeigen

@@ -1,3 +1,3 @@
# BggToolAnother
# BggToolAnother
An Eclipse RCP reimplementation of bgg1tool by Nand. See http://www.nand.it/nandeck/ for the original tool.

+ 11
- 8
xyz.veronie.bgg.ui/META-INF/MANIFEST.MF Datei anzeigen

@@ -5,13 +5,16 @@ Bundle-SymbolicName: xyz.veronie.bgg.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Automatic-Module-Name: de.wt.secondtry
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.17.0",
org.eclipse.swt;bundle-version="3.113.0",
org.eclipse.e4.core.di;bundle-version="1.7.500",
org.eclipse.e4.ui.workbench;bundle-version="1.11.0",
org.eclipse.e4.ui.di;bundle-version="1.2.700",
org.eclipse.e4.core.di.extensions;bundle-version="0.15.400",
javax.annotation;bundle-version="1.2.0",
org.eclipse.jface;bundle-version="3.18.0"
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.swt,
org.eclipse.e4.core.di,
org.eclipse.e4.ui.workbench,
org.eclipse.e4.ui.di,
org.eclipse.e4.core.di.extensions,
javax.annotation,
org.eclipse.jface,
org.eclipse.e4.core.services,
org.eclipse.osgi.services,
javax.inject
Import-Package: org.eclipse.e4.ui.model.application.descriptor.basic,
org.eclipse.e4.ui.model.application.ui.basic

+ 1
- 1
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/BggResult.java Datei anzeigen

@@ -1,6 +1,6 @@
package xyz.veronie.bgg.data;
/// This class contains and handles the result table for initial BGG result
/// This class contains and handles the result table for BGG things
public class BggResult {
}

+ 17
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/EventConstants.java Datei anzeigen

@@ -0,0 +1,17 @@
package xyz.veronie.bgg.data;
public interface EventConstants {
String TOPIC_CONFIG_CHANGED = "CONFIG_CHANGED/*";
String TOPIC_FILTER_CHANGED = "CONFIG_CHANGED/FILTER";
String TOPIC_SUBTYPE_CHANGED = "CONFIG_CHANGED/SUBTYPE";
String TOPIC_USERFLAG_CHANGED = "CONFIG_CHANGED/USERFLAG";
String TOPIC_ACTION_CHANGED = "CONFIG_CHANGED/ACTION";
String TOPIC_USER_CHANGED = "CONFIG_CHANGED/USER";
}

+ 15
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/FilterFlagState.java Datei anzeigen

@@ -0,0 +1,15 @@
package xyz.veronie.bgg.data;
public enum FilterFlagState {
IS(0), ISNOT(1), IGNORE(2);
private int state;
private FilterFlagState(int state) {
this.state = state;
}
public int get() {
return this.state;
}
}

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/ResultAction.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultAction.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.data;
public enum ResultAction {
ADD("add"),

+ 20
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultConfig.java Datei anzeigen

@@ -0,0 +1,20 @@
package xyz.veronie.bgg.data;
import java.util.HashMap;
/// DTO / container for configuration of result download
public class ResultConfig {
// TODO: integrate different filters (or extend?)
public HashMap<Subtype,Boolean> subTypes;
public ResultAction action;
public SourceFilter source;
public String user;
public HashMap<UserFlag, FilterFlagState> userFlags;
public Integer geeklistId;
public Integer familyId;
// TODO: add others
}

+ 59
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/ResultConfigManager.java Datei anzeigen

@@ -0,0 +1,59 @@
package xyz.veronie.bgg.data;
import javax.inject.Inject;
import org.eclipse.e4.core.di.annotations.Optional;
import org.eclipse.e4.ui.di.UIEventTopic;
public class ResultConfigManager {
private ResultConfig resultConfig = new ResultConfig();
@Inject
@Optional
private void subscribeTopicSourceFilterChanged
(@UIEventTopic(EventConstants.TOPIC_FILTER_CHANGED)
SourceFilter source) {
getResultConfig().source = source;
}
@Inject
@Optional
private void subscribeTopicSubtypesChanged
(@UIEventTopic(EventConstants.TOPIC_SUBTYPE_CHANGED)
Subtype subtype, Boolean checked) {
getResultConfig().subTypes.put(subtype, checked);
}
@Inject
@Optional
private void subscribeTopicUserChanged
(@UIEventTopic(EventConstants.TOPIC_USER_CHANGED)
String user) {
System.out.println("set user to '" + user + "'");
getResultConfig().user = user;
}
@Inject
@Optional
private void subscribeTopicUserFlagChanged
(@UIEventTopic(EventConstants.TOPIC_USERFLAG_CHANGED)
UserFlag flag, FilterFlagState state) {
getResultConfig().userFlags.put(flag, state);
}
@Inject
@Optional
private void subscribeTopicResultActionChanged
(@UIEventTopic(EventConstants.TOPIC_ACTION_CHANGED)
ResultAction action) {
getResultConfig().action = action;
}
public ResultConfig getResultConfig() {
return resultConfig;
}
}

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/SourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/SourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.data;
public enum SourceFilter {

+ 28
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/Subtype.java Datei anzeigen

@@ -0,0 +1,28 @@
package xyz.veronie.bgg.data;
public enum Subtype {
BOARDGAME("Board games", "boardgame"),
BGEXPANSION("Board game expansions", "boardgameexpansion"),
BGACCESSORIES("Board game accessories", "boardgameaccessory"),
RPG_ISSUES("RPG issues", "rpgissue"),
RPG_ITEMS("RPG items", "rpgitem"),
VIDEOGAMES("Video Games", "videogame");
private String name; //< the display name
private String thingTypeString; //< the THINGTYPE string for BGG XMLAPI2
private Subtype(String name, String thingtypestr) {
this.name = name;
this.thingTypeString = thingtypestr;
}
@Override
public String toString() {
return this.name;
}
/// return the string used in BGG XMLAPI2 to identify the thingtype
public String toSubtypeString() {
return this.thingTypeString;
}
}

+ 24
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/data/UserFlag.java Datei anzeigen

@@ -0,0 +1,24 @@
package xyz.veronie.bgg.data;
public enum UserFlag {
OWN("owned"),
PREVIOUSLY_OWNED("previously owned"),
FOR_TRADE("for trade"),
WANTED("wanted"),
WTP("want to play"),
WTB("want to buy"),
WISHLIST("on wishlist"),
PREORDERED("preordered");
private String flag;
private UserFlag(String flag) {
this.flag = flag;
}
@Override
public String toString() {
return this.flag;
}
}

+ 0
- 6
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/BggResult.java Datei anzeigen

@@ -1,6 +0,0 @@
package xyz.veronie.bgg.ui.contributions;
/// this represents a result of bgg "things"
public class BggResult {
}

+ 0
- 30
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/ResultConfig.java Datei anzeigen

@@ -1,30 +0,0 @@
package xyz.veronie.bgg.ui.contributions;
/// container for configuration of result download
public class ResultConfig {
// TODO: integrate different filters (or extend?)
private SourceFilter source;
private Subpage subpage;
private ResultAction action;
public SourceFilter getSource() {
return source;
}
public void setSource(SourceFilter source) {
this.source = source;
}
public Subpage getSubpage() {
return subpage;
}
public void setSubpage(Subpage subpage) {
this.subpage = subpage;
}
public ResultAction getAction() {
return action;
}
public void setAction(ResultAction action) {
this.action = action;
}
}

+ 0
- 20
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/Subpage.java Datei anzeigen

@@ -1,20 +0,0 @@
package xyz.veronie.bgg.ui.contributions;
public enum Subpage {
BOARDGAMES("Board Games"),
RPG("RPGs"),
RPG_ITEMS("RPG Items"),
VIDEOGAMES("Video Games"),
ACCESSORIES("Accessories");
private String name;
private Subpage(String name) {
this.name = name;
}
@Override
public String toString() {
return this.name;
}
}

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/AgeSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/AgeSourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/BggUserSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/BggUserSourceFilter.java Datei anzeigen

@@ -1,7 +1,10 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import java.util.HashMap;
import javax.inject.Inject;
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
@@ -14,65 +17,36 @@ import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import xyz.veronie.bgg.data.EventConstants;
import xyz.veronie.bgg.data.FilterFlagState;
import xyz.veronie.bgg.data.UserFlag;
enum FilterState {
IS(0), ISNOT(1), IGNORE(2);
private int state;
private FilterState(int state) {
this.state = state;
}
public int get() {
return this.state;
}
}
enum UserFlag {
OWN("owned"),
PREVIOUSLY_OWNED("previously owned"),
FOR_TRADE("for trade"),
WANTED("wanted"),
WTP("want to play"),
WTB("want to buy"),
WISHLIST("on wishlist"),
PREORDERED("preordered");
private String flag;
private UserFlag(String flag) {
this.flag = flag;
}
@Override
public String toString() {
return this.flag;
}
}
/// These are the controls to retrieve thing IDs for a given BGG user
/// Filters can be set for the state of the thing in the user's collection
/// (i.e. owned, previously owned, wishlist, etc.)
public class BggUserSourceFilter {
// TODO: have to protect this static because threading?
private static String user = "";
private static HashMap<UserFlag, FilterState> flags = new HashMap<UserFlag, FilterState>() {
@Inject
private IEventBroker eventBroker;
private HashMap<UserFlag, FilterFlagState> flags = new HashMap<UserFlag, FilterFlagState>() {
private static final long serialVersionUID = 1L;
{
put(UserFlag.OWN, FilterState.IS);
put(UserFlag.PREVIOUSLY_OWNED, FilterState.ISNOT);
put(UserFlag.FOR_TRADE, FilterState.IGNORE);
put(UserFlag.WANTED, FilterState.IGNORE);
put(UserFlag.WTP, FilterState.IGNORE);
put(UserFlag.WTB, FilterState.IGNORE);
put(UserFlag.WISHLIST, FilterState.IGNORE);
put(UserFlag.PREORDERED, FilterState.IGNORE);
put(UserFlag.OWN, FilterFlagState.IS);
put(UserFlag.PREVIOUSLY_OWNED, FilterFlagState.ISNOT);
put(UserFlag.FOR_TRADE, FilterFlagState.IGNORE);
put(UserFlag.WANTED, FilterFlagState.IGNORE);
put(UserFlag.WTP, FilterFlagState.IGNORE);
put(UserFlag.WTB, FilterFlagState.IGNORE);
put(UserFlag.WISHLIST, FilterFlagState.IGNORE);
put(UserFlag.PREORDERED, FilterFlagState.IGNORE);
}};
public static void create(Composite parent, int style) {
public void create(Composite parent, int style) {
GridLayout filterLayout = new GridLayout(4, false);
parent.setLayout(filterLayout);
@@ -86,7 +60,6 @@ public class BggUserSourceFilter {
cbUserName.addSelectionListener(new SelectionAdapter() {
public void widgetDefaultSelected(SelectionEvent e) {
setUser(cbUserName.getText());
System.out.println("set user to '" + getUser() + "'");
}
});
cbUserName.addFocusListener(new FocusListener() {
@@ -134,27 +107,26 @@ public class BggUserSourceFilter {
// Filters are tri-state: include iff has flag, include iff it does not have the flag,
// don't care if it has that flag.
// TODO: create a three-way toggle button instead.
private static void makeFilter(Composite parent, UserFlag key) {
private void makeFilter(Composite parent, UserFlag key) {
Combo filterCombo = new Combo(parent, SWT.READ_ONLY);
filterCombo.add("is");
filterCombo.add("is not");
filterCombo.add("ignored");
filterCombo.select(flags.get(key).get());
filterCombo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
// TODO: add listener - send a CONFIG_CHANGED event when something changes
Label filterLabel = new Label(parent, SWT.LEFT);
filterLabel.setText(key.toString());
filterLabel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
}
public static String getUser() {
return user;
}
public static void setUser(String user) {
BggUserSourceFilter.user = user;
public void setUser(String user) {
if(eventBroker != null) {
eventBroker.post(EventConstants.TOPIC_USER_CHANGED, user);
} else {
System.out.println("null???");
}
}
}

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/FamilySourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/FamilySourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/GeeklistSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/GeeklistSourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/RankSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/RankSourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/SearchSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/SearchSourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;

+ 40
- 0
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/ThingFilterGroup.java Datei anzeigen

@@ -0,0 +1,40 @@
package xyz.veronie.bgg.ui.filters;
import java.util.HashMap;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Group;
import xyz.veronie.bgg.data.Subtype;
public class ThingFilterGroup {
private HashMap<Subtype, Button> buttons;
public void create(Composite parent) {
Group gSubtype = new Group(parent, SWT.LEFT);
gSubtype.setText("Subtypes");
gSubtype.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
gSubtype.setLayout(new GridLayout(1, false));
buttons = new HashMap<Subtype, Button>();
for (Subtype st : Subtype.values()) {
Button bb = new Button(gSubtype, SWT.CHECK);
bb.setText(st.toString());
bb.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
if(st == Subtype.BOARDGAME) {
// initially, only boardgame is checked
bb.setSelection(true);
} else {
bb.setSelection(false);
}
// TODO: add listener to buttons. Send event with checked subtypes when something changes.
buttons.put(st, bb);
}
}
}

xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/contributions/YearSourceFilter.java → xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/filters/YearSourceFilter.java Datei anzeigen

@@ -1,4 +1,4 @@
package xyz.veronie.bgg.ui.contributions;
package xyz.veronie.bgg.ui.filters;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;

+ 2
- 1
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/parts/BggResultPart.java Datei anzeigen

@@ -8,11 +8,12 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import xyz.veronie.bgg.data.ResultConfigManager;
public class BggResultPart {
@PostConstruct
public void createControls(Composite parent) {
Composite main = new Composite(parent, SWT.FILL);
Label lblTable = new Label(main, SWT.LEFT);


+ 27
- 27
xyz.veronie.bgg.ui/src/xyz/veronie/bgg/ui/parts/LoadFromBggPart.java Datei anzeigen

@@ -24,16 +24,17 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import xyz.veronie.bgg.ui.contributions.AgeSourceFilter;
import xyz.veronie.bgg.ui.contributions.BggUserSourceFilter;
import xyz.veronie.bgg.ui.contributions.FamilySourceFilter;
import xyz.veronie.bgg.ui.contributions.GeeklistSourceFilter;
import xyz.veronie.bgg.ui.contributions.RankSourceFilter;
import xyz.veronie.bgg.ui.contributions.ResultAction;
import xyz.veronie.bgg.ui.contributions.SearchSourceFilter;
import xyz.veronie.bgg.ui.contributions.SourceFilter;
import xyz.veronie.bgg.ui.contributions.Subpage;
import xyz.veronie.bgg.ui.contributions.YearSourceFilter;
import xyz.veronie.bgg.data.ResultAction;
import xyz.veronie.bgg.data.ResultConfigManager;
import xyz.veronie.bgg.data.SourceFilter;
import xyz.veronie.bgg.ui.filters.AgeSourceFilter;
import xyz.veronie.bgg.ui.filters.BggUserSourceFilter;
import xyz.veronie.bgg.ui.filters.FamilySourceFilter;
import xyz.veronie.bgg.ui.filters.GeeklistSourceFilter;
import xyz.veronie.bgg.ui.filters.RankSourceFilter;
import xyz.veronie.bgg.ui.filters.SearchSourceFilter;
import xyz.veronie.bgg.ui.filters.ThingFilterGroup;
import xyz.veronie.bgg.ui.filters.YearSourceFilter;
@@ -41,11 +42,16 @@ import xyz.veronie.bgg.ui.contributions.YearSourceFilter;
/// There are different ways to configure which IDs to retrieve.
public class LoadFromBggPart {
// TODO: figure out how to make sure this is a singleton
private ResultConfigManager resultConfigManager;
LoadFromBggPart() {
resultConfigManager = new ResultConfigManager();
}
@PostConstruct
public void createControls(Composite parent) {
Composite main = new Composite(parent, SWT.FILL);
main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
@@ -81,18 +87,12 @@ public class LoadFromBggPart {
// choose the bgg sub-site
Label lblTopic = new Label(dlConfigGroup, SWT.LEFT);
lblTopic.setText("Subpage: ");
lblTopic.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
Label lblSubtype = new Label(dlConfigGroup, SWT.LEFT);
lblSubtype.setText("Subtypes: ");
lblSubtype.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
ComboViewer cbTopic = new ComboViewer(dlConfigGroup, SWT.READ_ONLY);
cbTopic.setContentProvider(ArrayContentProvider.getInstance());
List<Subpage> sites = Arrays.asList(new Subpage[] {
Subpage.BOARDGAMES, Subpage.RPG, Subpage.RPG_ITEMS,
Subpage.VIDEOGAMES, Subpage.ACCESSORIES });
cbTopic.setInput(sites);
cbTopic.setSelection(new StructuredSelection(sites.get(0)));
ThingFilterGroup gSubtypes = new ThingFilterGroup();
gSubtypes.create(dlConfigGroup);
// choose action on result list
Label lblAct = new Label(dlConfigGroup, SWT.LEFT);
@@ -152,11 +152,12 @@ public class LoadFromBggPart {
if(selection.size() == 0) return;
if(selection.getFirstElement() == SourceFilter.BGG_USER) {
if(BggUserSourceFilter.getUser().isEmpty()) {
String user = resultConfigManager.getResultConfig().user;
if(user == null || user.isEmpty()) {
System.out.println("Please enter a user name.");
return;
}
System.out.println("...for user '" + BggUserSourceFilter.getUser() + "'");
System.out.println("...for user '" + user + "'");
} else if(selection.getFirstElement() == SourceFilter.GEEKLIST) {
System.out.println("...for geeklist id '" + GeeklistSourceFilter.getGeeklistId() + "'");
} else if(selection.getFirstElement() == SourceFilter.FAMILY) {
@@ -165,8 +166,6 @@ public class LoadFromBggPart {
}
});
btDownload.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false));
main.pack();
@@ -186,7 +185,8 @@ public class LoadFromBggPart {
switch(elem) {
case BGG_USER:
System.out.println("construct " + elem);
BggUserSourceFilter.create(parent, SWT.FILL);
BggUserSourceFilter f = new BggUserSourceFilter();
f.create(parent, SWT.FILL);
break;
case GEEKLIST:
System.out.println("construct " + elem);


Laden…
Abbrechen
Speichern