diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 25ecfcb34..fcb0896ee 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -119,12 +119,7 @@ public class JDBCDefPane extends JPanel { driverManageLabel.setVisible(selectSelfDefine); driverLoaderBox.setVisible(selectSelfDefine); driverComboBox.setVisible(!selectSelfDefine); - // 选中自定义的话,将odbc的屏蔽,选中默认的话,重新触发一次driverComboBox的事件 - if (selectSelfDefine) { - odbcTipsLink.setVisible(false); - } else { - driverComboBox.setSelectedItem(driverComboBox.getSelectedItem()); - } + odbcTipsLink.setVisible(driverComboBox.isVisible() && ComparatorUtils.equals("sun.jdbc.odbc.JdbcOdbcDriver", driverComboBox.getSelectedItem())); } }; ActionListener dbtypeActionListener = new ActionListener() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java index 6839ee41f..e08c317d8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -275,7 +275,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock if (getUpdater().isUpdating()) { paintLoadingIndicator(g2d, getUpdater().getProcessValue()); - } else if (LocalWidgetRepoUpdater.getInstance().checkUpdate(getWidget()) != null) { + } else if (LocalWidgetRepoUpdater.getInstance().checkUpdatable(getWidget())) { paintUpdatableMarker(g2d); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java index 905e9d87b..0a4aacfc9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/GroupPane.java @@ -53,10 +53,6 @@ public class GroupPane extends JPanel { private SharableWidgetProvider[] elCaseBindInfoList; private SortType sortType = WidgetSortType.INSTALL_TIME; - private GroupPane(Group group) { - this(group, DEFAULT_HEIGHT, group.isDefaultExpend()); - } - private GroupPane(Group group, boolean expendStatus) { this(group, DEFAULT_HEIGHT, expendStatus); } @@ -90,7 +86,9 @@ public class GroupPane extends JPanel { //按照筛选条件进行过滤 elCaseBindInfoList = LocalWidgetFilter.getInstance().filter(elCaseBindInfoList); - boolean needExpendGroup = expendStatus || (isFiltering() && elCaseBindInfoList.length > 0); + boolean needExpendGroup = expendStatus + || (isFiltering() && elCaseBindInfoList.length > 0) + || hasUpdatableWidget(); if (elCaseBindInfoList.length == 0 && isFiltering()) { this.setVisible(false); } @@ -107,6 +105,16 @@ public class GroupPane extends JPanel { expendGroup(needExpendGroup); } + private boolean hasUpdatableWidget() { + for (SharableWidgetProvider provider: elCaseBindInfoList) { + boolean updatable = LocalWidgetRepoUpdater.getInstance().checkUpdatable(provider); + if (updatable) { + return true; + } + } + return false; + } + public LocalWidgetSelectPane getWidgetListPane() { return contentPanel; } @@ -375,7 +383,7 @@ public class GroupPane extends JPanel { DEFAULT { @Override public GroupPane creteGroupPane(Group group) { - return new GroupPane(group); + return new GroupPane(group, group.isDefaultExpend()); } }, EXPANDED { @@ -384,7 +392,7 @@ public class GroupPane extends JPanel { return new GroupPane(group, true); } }, - CLOSURE { + COLLAPSED { @Override public GroupPane creteGroupPane(Group group) { return new GroupPane(group, false); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java index 522574ce0..d2ad2d6f5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoPane.java @@ -390,7 +390,7 @@ public class LocalWidgetRepoPane extends BasicPane { List updatableWidgetProviders = LocalWidgetRepoUpdater.getInstance().getUpdatableWidgetProviders(); updateTipPane.setVisible(updatableWidgetProviders.size() > 0); if (updatableWidgetProviders.size() > 0) { - refreshAllGroupPane(GroupPane.GroupCreateStrategy.EXPANDED); + refreshAllGroupPane(GroupPane.GroupCreateStrategy.DEFAULT); } } } @@ -413,7 +413,7 @@ public class LocalWidgetRepoPane extends BasicPane { toolbarPane.reset(); managePane.switchPanel(false); switchPane(LocalPaneStatus.NORMAL); - refreshAllGroupPane(GroupPane.GroupCreateStrategy.EXPANDED); + refreshAllGroupPane(GroupPane.GroupCreateStrategy.DEFAULT); List blockList = getUpdatableBlocks(); if (blockList.size() == 0) { @@ -428,7 +428,7 @@ public class LocalWidgetRepoPane extends BasicPane { LocalWidgetRepoUpdater updater = LocalWidgetRepoUpdater.getInstance(); for (LocalWidgetBlock block: blockList) { - OnlineShareWidget remoteLatestWidget = updater.checkUpdate(block.getWidget()); + OnlineShareWidget remoteLatestWidget = updater.findLatestRemoteWidget(block.getWidget()); block.getUpdater().updateWidget(remoteLatestWidget.getId(), new LocalWidgetUpdater.UpdateListener() { @Override public void onUpdated(boolean success, String group, String id) { @@ -505,7 +505,7 @@ public class LocalWidgetRepoPane extends BasicPane { LocalWidgetBlock widgetBlock = (LocalWidgetBlock) component; SharableWidgetProvider localProvider = widgetBlock.getWidget(); - OnlineShareWidget remoteLatestWidget = updater.checkUpdate(localProvider); + OnlineShareWidget remoteLatestWidget = updater.findLatestRemoteWidget(localProvider); if (remoteLatestWidget != null) { blockList.add(widgetBlock); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoUpdater.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoUpdater.java index 03eb751f2..4cf949fad 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoUpdater.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/LocalWidgetRepoUpdater.java @@ -55,7 +55,11 @@ public class LocalWidgetRepoUpdater { remoteLatestWidgetsBackup.clear(); } - public OnlineShareWidget checkUpdate(SharableWidgetProvider provider) { + public boolean checkUpdatable(SharableWidgetProvider provider) { + return findLatestRemoteWidget(provider) != null; + } + + public OnlineShareWidget findLatestRemoteWidget(SharableWidgetProvider provider) { OnlineShareWidget remoteLatestWidget = remoteLatestWidgetsBackup.get(provider.getId()); if (remoteLatestWidget != null && StringUtils.isNotEmpty(remoteLatestWidget.getVersion())) { Version remoteLatestVersion = Version.create(remoteLatestWidget.getVersion()); @@ -76,7 +80,7 @@ public class LocalWidgetRepoUpdater { for (Group group: groups) { SharableWidgetProvider[] widgetProviders = group.getAllBindInfoList(); for (SharableWidgetProvider widgetProvider: widgetProviders) { - if (checkUpdate(widgetProvider) != null) { + if (checkUpdatable(widgetProvider)) { updatableProviders.add(widgetProvider); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java index 67e2efe3f..387c1a135 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/local/ManagePane.java @@ -135,7 +135,7 @@ class ManagePane extends JPanel implements ShareUIAspect { String userInput = getFileName().replaceAll("[\\\\/:*?\"<>|]", StringUtils.EMPTY); //新建分组,刷新显示 if (DefaultShareGroupManager.getInstance().createGroup(userInput)) { - LocalWidgetRepoPane.getInstance().refreshAllGroupPane(GroupPane.GroupCreateStrategy.CLOSURE); + LocalWidgetRepoPane.getInstance().refreshAllGroupPane(GroupPane.GroupCreateStrategy.COLLAPSED); } else { ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Basic_Make_Failure")); }