Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~fanglei/design into release/11.0

* 'release/11.0' of ssh://code.fineres.com:7999/~fanglei/design:
  REPORT-62680 插件-插件管理-设计器里没有适配禁用提示 代码质量问题
  REPORT-62896 替换常量
  REPORT-62896 下载主题引导过程中概率性退出引导问题
  REPORT-62680 插件-插件管理-设计器里没有适配禁用提示 【问题原因】设计器里没适配 【改动思路】1. 适配下弹窗提示;2. 之前把forbid-reminder放到PluginView里还是不合适,换成通过xml获取的方式 【review建议】无
bugfix/11.0
方磊 3 years ago
parent
commit
b7287df474
  1. 24
      designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java
  2. 9
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  3. 23
      designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java

24
designer-base/src/main/java/com/fr/design/extra/PluginOperateUtils.java

@ -25,6 +25,8 @@ import com.fr.plugin.manage.control.PluginTask;
import com.fr.plugin.manage.control.PluginTaskCallback; import com.fr.plugin.manage.control.PluginTaskCallback;
import com.fr.plugin.manage.control.PluginTaskResult; import com.fr.plugin.manage.control.PluginTaskResult;
import com.fr.plugin.view.PluginView; import com.fr.plugin.view.PluginView;
import com.fr.plugin.xml.PluginElementName;
import com.fr.plugin.xml.PluginXmlElement;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -91,16 +93,38 @@ public class PluginOperateUtils {
public static void setPluginActive(String pluginInfo, JSCallback jsCallback) { public static void setPluginActive(String pluginInfo, JSCallback jsCallback) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo); PluginMarker pluginMarker = PluginUtils.createPluginMarker(pluginInfo);
PluginContext plugin = PluginManager.getContext(pluginMarker); PluginContext plugin = PluginManager.getContext(pluginMarker);
boolean active = plugin.isActive(); boolean active = plugin.isActive();
PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback); PluginTaskCallback modifyStatusCallback = new ModifyStatusCallback(active, jsCallback);
if (active) { if (active) {
PluginXmlElement forbidReminder = plugin.getXml().getElement(PluginElementName.ForbidReminder);
if (forbidReminder != null && forbidReminder.getContent() != null) {
// 禁用前提示
int rv = FineJOptionPane.showConfirmDialog(
null,
forbidReminder.getContent(),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.WARNING_MESSAGE
);
if (rv == JOptionPane.OK_OPTION) {
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback);
}
} else {
// 正常禁用
PluginManager.getController().forbid(pluginMarker, modifyStatusCallback); PluginManager.getController().forbid(pluginMarker, modifyStatusCallback);
}
} else { } else {
PluginManager.getController().enable(pluginMarker, modifyStatusCallback); PluginManager.getController().enable(pluginMarker, modifyStatusCallback);
} }
} }
});
}
public static void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSCallback jsCallback) { public static void uninstallPlugin(final String pluginInfo, final boolean isForce, final JSCallback jsCallback) {

9
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -31,6 +31,7 @@ import java.util.List;
* Time: 下午8:18 * Time: 下午8:18
*/ */
public class FormWidgetDetailPane extends FormDockView{ public class FormWidgetDetailPane extends FormDockView{
private static final int LOCAL_TAB = 0;
private static final int ONLINE_TAB = 1; private static final int ONLINE_TAB = 1;
private JPanel centerPane; private JPanel centerPane;
@ -104,7 +105,7 @@ public class FormWidgetDetailPane extends FormDockView{
cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle()); cardLayout.show(centerPane, paneList.get(newSelectedIndex).getTitle());
} }
}; };
headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? 0 : ONLINE_TAB); headGroup.setSelectedIndex(ComponentReuseNotificationInfo.getInstance().isClickedWidgetLib() ? LOCAL_TAB : ONLINE_TAB);
this.add(headGroup, BorderLayout.NORTH); this.add(headGroup, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
@ -140,11 +141,11 @@ public class FormWidgetDetailPane extends FormDockView{
} }
public void switch2Local() { public void switch2Local() {
cardLayout.show(centerPane, paneList.get(0).getTitle()); headGroup.setSelectedIndex(LOCAL_TAB);
} }
public void swich2Online() { public void switch2Online() {
cardLayout.show(centerPane, paneList.get(1).getTitle()); headGroup.setSelectedIndex(ONLINE_TAB);
} }
private UILabel tipLabel(String text) { private UILabel tipLabel(String text) {

23
designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java

@ -29,6 +29,7 @@ import com.fr.design.mainframe.guide.tip.GuideTip;
import com.fr.design.mainframe.share.ui.block.OnlineWidgetPackageBlock; import com.fr.design.mainframe.share.ui.block.OnlineWidgetPackageBlock;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetRepoPane;
import com.fr.design.mainframe.share.ui.online.OnlineWidgetTabPane; import com.fr.design.mainframe.share.ui.online.OnlineWidgetTabPane;
import com.fr.design.mainframe.share.ui.online.widgetpackage.OnlineWidgetPackagesShowPane;
import com.fr.design.mainframe.share.util.DownloadUtils; import com.fr.design.mainframe.share.util.DownloadUtils;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.share.utils.ShareUtils; import com.fr.form.share.utils.ShareUtils;
@ -102,22 +103,23 @@ public class DownloadComponentPackageGuide {
EastRegionContainerPane.getInstance().showContainer(); EastRegionContainerPane.getInstance().showContainer();
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
OnlineWidgetRepoPane onlineWidgetRepoPane = OnlineWidgetRepoPane.getInstance(); OnlineWidgetRepoPane onlineWidgetRepoPane = OnlineWidgetRepoPane.getInstance();
Component onlineWidgetPackagesShowPane = ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetPackagesShowPane.class);
if (onlineWidgetPackagesShowPane != null) {
GuideManager.getInstance().getCurrentGuide().start();
} else {
onlineWidgetRepoPane.setContent(); onlineWidgetRepoPane.setContent();
OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class); OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class);
UITabGroup tabGroup = (UITabGroup) ComponentUtils.findComponentByClass(tabPane, UITabGroup.class);
JPanel centerPane = (JPanel) tabPane.getComponent(1); JPanel centerPane = (JPanel) tabPane.getComponent(1);
if (centerPane.getComponentCount() > 0) {
GuideManager.getInstance().getCurrentGuide().start();
} else {
centerPane.addContainerListener(new ContainerAdapter() { centerPane.addContainerListener(new ContainerAdapter() {
@Override @Override
public void componentAdded(ContainerEvent e) { public void componentAdded(ContainerEvent e) {
if (e.getChild() instanceof OnlineWidgetPackagesShowPane) {
GuideManager.getInstance().getCurrentGuide().start(); GuideManager.getInstance().getCurrentGuide().start();
} }
}
}); });
} }
tabGroup.setSelectedIndex(1); switch2OnlinePackageBlock();
tabGroup.tabChanged(1);
} else { } else {
GuideCreateUtils.showNoNetworkAlert(); GuideCreateUtils.showNoNetworkAlert();
GuideManager.getInstance().getCurrentGuide().terminate(); GuideManager.getInstance().getCurrentGuide().terminate();
@ -168,7 +170,7 @@ public class DownloadComponentPackageGuide {
@Override @Override
public boolean onComplete() { public boolean onComplete() {
FormWidgetDetailPane.getInstance().swich2Online(); FormWidgetDetailPane.getInstance().switch2Online();
return true; return true;
} }
}); });
@ -298,4 +300,11 @@ public class DownloadComponentPackageGuide {
themeConfirmDialog.dispose(); themeConfirmDialog.dispose();
} }
} }
private static void switch2OnlinePackageBlock() {
OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(OnlineWidgetRepoPane.getInstance(), OnlineWidgetTabPane.class);
UITabGroup tabGroup = (UITabGroup) ComponentUtils.findComponentByClass(tabPane, UITabGroup.class);
tabGroup.setSelectedIndex(1);
tabGroup.tabChanged(1);
}
} }

Loading…
Cancel
Save