Browse Source

Merge pull request #182 in DESIGN/design from ~KERRY/design_10.0:release/10.0 to release/10.0

* commit '563903b929841b65dab999ed26b7bab09784a248':
  REPORT-7947 【10.0】在设计器上登录bbs的用户时,数据库无法生成对应的信息
  REPORT-9232 【10.0一轮回归】按钮控件自定义背景设置
master
kerry 6 years ago
parent
commit
740eb858c4
  1. 33
      designer-base/src/com/fr/design/bbs/BBSLoginUtils.java
  2. 4
      designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java
  3. 8
      designer-base/src/com/fr/design/style/background/BackgroundFactory.java

33
designer-base/src/com/fr/design/bbs/BBSLoginUtils.java

@ -1,5 +1,6 @@
package com.fr.design.bbs;
import com.fr.config.BBSAttr;
import com.fr.config.Configuration;
import com.fr.config.MarketConfig;
import com.fr.log.FineLoggerFactory;
@ -15,12 +16,14 @@ import java.util.List;
public class BBSLoginUtils {
public static void bbsLogin(final String username, final String password) {
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(username);
bbsAttr.setBbsPassword(password);
try {
Configurations.update(new Worker() {
@Override
public void run() {
MarketConfig.getInstance().setBbsUsername(username);
MarketConfig.getInstance().setBbsPassword(password);
MarketConfig.getInstance().setBBsAttr(bbsAttr);
}
@Override
public Class<? extends Configuration>[] targets() {
@ -35,16 +38,18 @@ public class BBSLoginUtils {
public static void bbsLogin(List<String> list) {
try {
final String uid = list.get(0);
final String username = list.get(1);
final String password = list.get(2);
String uid = list.get(0);
String username = list.get(1);
String password = list.get(2);
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(username);
bbsAttr.setBbsPassword(password);
bbsAttr.setBbsUid(Integer.parseInt(uid));
bbsAttr.setInShowBBsName(username);
Configurations.update(new Worker() {
@Override
public void run() {
MarketConfig.getInstance().setBbsUsername(username);
MarketConfig.getInstance().setBbsPassword(password);
MarketConfig.getInstance().setBbsUid(Integer.parseInt(uid));
MarketConfig.getInstance().setInShowBBsName(username);
MarketConfig.getInstance().setBBsAttr(bbsAttr);
}
@Override
public Class<? extends Configuration>[] targets() {
@ -58,11 +63,13 @@ public class BBSLoginUtils {
}
public static void bbsLogout() {
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(StringUtils.EMPTY);
bbsAttr.setBbsPassword(StringUtils.EMPTY);
bbsAttr.setBbsUid(0);
bbsAttr.setInShowBBsName(StringUtils.EMPTY);
try {
MarketConfig.getInstance().setBbsUsername(StringUtils.EMPTY);
MarketConfig.getInstance().setBbsPassword(StringUtils.EMPTY);
MarketConfig.getInstance().setBbsUid(0);
MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
MarketConfig.getInstance().setBBsAttr(bbsAttr);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage());
}

4
designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java

@ -2,7 +2,7 @@ package com.fr.design.style.background;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.GradientBackground;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.ColorBackgroundPane;
@ -30,7 +30,7 @@ public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane {
private static void registerCardSwitchBtnBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(ImageBackground.class, BackgroundUIWrapper.create()
map.put(ImageFileBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color")));

8
designer-base/src/com/fr/design/style/background/BackgroundFactory.java

@ -3,7 +3,7 @@ package com.fr.design.style.background;
import com.fr.base.background.ColorBackground;
import com.fr.base.background.GradientBackground;
import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.base.background.PatternBackground;
import com.fr.base.background.TextureBackground;
import com.fr.design.ExtraDesignClassManager;
@ -104,19 +104,19 @@ public class BackgroundFactory {
}
private static void registerImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create()
map.put(ImageFileBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerBrowserImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ImageBackground.class, BackgroundUIWrapper.create()
map.put(ImageFileBackground.class, BackgroundUIWrapper.create()
.setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}
private static void registerButtonBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map){
map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color")));
map.put(ImageBackground.class, BackgroundUIWrapper.create()
map.put(ImageFileBackground.class, BackgroundUIWrapper.create()
.setType(ImageButtonBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
}

Loading…
Cancel
Save