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 7 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; package com.fr.design.bbs;
import com.fr.config.BBSAttr;
import com.fr.config.Configuration; import com.fr.config.Configuration;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -15,12 +16,14 @@ import java.util.List;
public class BBSLoginUtils { public class BBSLoginUtils {
public static void bbsLogin(final String username, final String password) { public static void bbsLogin(final String username, final String password) {
final BBSAttr bbsAttr = new BBSAttr();
bbsAttr.setBbsUsername(username);
bbsAttr.setBbsPassword(password);
try { try {
Configurations.update(new Worker() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
MarketConfig.getInstance().setBbsUsername(username); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(password);
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public Class<? extends Configuration>[] targets() {
@ -35,16 +38,18 @@ public class BBSLoginUtils {
public static void bbsLogin(List<String> list) { public static void bbsLogin(List<String> list) {
try { try {
final String uid = list.get(0); String uid = list.get(0);
final String username = list.get(1); String username = list.get(1);
final String password = list.get(2); 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() { Configurations.update(new Worker() {
@Override @Override
public void run() { public void run() {
MarketConfig.getInstance().setBbsUsername(username); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(password);
MarketConfig.getInstance().setBbsUid(Integer.parseInt(uid));
MarketConfig.getInstance().setInShowBBsName(username);
} }
@Override @Override
public Class<? extends Configuration>[] targets() { public Class<? extends Configuration>[] targets() {
@ -58,11 +63,13 @@ public class BBSLoginUtils {
} }
public static void bbsLogout() { 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 { try {
MarketConfig.getInstance().setBbsUsername(StringUtils.EMPTY); MarketConfig.getInstance().setBBsAttr(bbsAttr);
MarketConfig.getInstance().setBbsPassword(StringUtils.EMPTY);
MarketConfig.getInstance().setBbsUid(0);
MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY);
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage()); 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.ColorBackground;
import com.fr.base.background.GradientBackground; 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.layout.FRGUIPaneFactory;
import com.fr.design.style.background.gradient.GradientBackgroundPane; import com.fr.design.style.background.gradient.GradientBackgroundPane;
import com.fr.design.style.background.impl.ColorBackgroundPane; 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) { private static void registerCardSwitchBtnBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) {
map.put(ColorBackground.class, BackgroundUIWrapper.create() map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); .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"))); .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
map.put(GradientBackground.class, BackgroundUIWrapper.create() map.put(GradientBackground.class, BackgroundUIWrapper.create()
.setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color"))); .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.ColorBackground;
import com.fr.base.background.GradientBackground; 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.PatternBackground;
import com.fr.base.background.TextureBackground; import com.fr.base.background.TextureBackground;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
@ -104,19 +104,19 @@ public class BackgroundFactory {
} }
private static void registerImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { 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"))); .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
} }
private static void registerBrowserImageBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map) { 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"))); .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
} }
private static void registerButtonBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map){ private static void registerButtonBackground(Map<Class<? extends Background>, BackgroundUIWrapper> map){
map.put(ColorBackground.class, BackgroundUIWrapper.create() map.put(ColorBackground.class, BackgroundUIWrapper.create()
.setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); .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"))); .setType(ImageButtonBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image")));
} }

Loading…
Cancel
Save