|
|
|
@ -4,6 +4,7 @@ import com.fanruan.workplace.http.ServiceType;
|
|
|
|
|
import com.fr.datacenters.tabledata.DCTableData; |
|
|
|
|
import com.fr.datacenters.tabledata.bean.DCNameBean; |
|
|
|
|
import com.fr.datacenters.tabledata.bean.DCTableDataBean; |
|
|
|
|
import com.fr.design.data.DesignTableDataManager; |
|
|
|
|
import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; |
|
|
|
|
import com.fr.design.dialog.DialogActionListener; |
|
|
|
|
import com.fr.design.dialog.UIDialog; |
|
|
|
@ -14,10 +15,15 @@ import com.fr.json.revise.EmbedJson;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.third.guava.collect.ImmutableMap; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.teamdev.jxbrowser.browser.callback.InjectJsCallback; |
|
|
|
|
|
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Window; |
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
|
|
import static com.fr.design.ui.ModernUIConstants.DOT; |
|
|
|
|
import static com.fr.design.ui.ModernUIConstants.WINDOW; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 数据中心数据集面板 |
|
|
|
@ -26,7 +32,7 @@ import java.awt.Window;
|
|
|
|
|
* @since 11.0 |
|
|
|
|
* Created on 2024/6/17 |
|
|
|
|
*/ |
|
|
|
|
public class DatacentersPane extends AbstractTableDataPane<DCTableData> { |
|
|
|
|
public class DCTableDataPane extends AbstractTableDataPane<DCTableData> { |
|
|
|
|
|
|
|
|
|
private static final JxEngine JX_ENGINE = JxEngine.newInstance(false); |
|
|
|
|
|
|
|
|
@ -37,31 +43,7 @@ public class DatacentersPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
// 用于复制粘贴场景
|
|
|
|
|
private DCTableData dcTableData; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 借用,只运行一次 |
|
|
|
|
*/ |
|
|
|
|
private void addDialogActionListener() { |
|
|
|
|
|
|
|
|
|
// 保证在窗口加载完成后执行
|
|
|
|
|
SwingUtilities.invokeLater(() -> { |
|
|
|
|
Window ancestor = SwingUtilities.getWindowAncestor(DatacentersPane.this); |
|
|
|
|
if (ancestor instanceof UIDialog) { |
|
|
|
|
((UIDialog) ancestor).addDialogActionListener(new DialogActionListener() { |
|
|
|
|
@Override |
|
|
|
|
public void doOk() { |
|
|
|
|
dataCenterJxUIPane.disposeBrowser(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void doCancel() { |
|
|
|
|
dataCenterJxUIPane.disposeBrowser(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public DatacentersPane() { |
|
|
|
|
public DCTableDataPane() { |
|
|
|
|
setLayout(new BorderLayout()); |
|
|
|
|
dataCenterJxUIPane = getJxUIPane(); |
|
|
|
|
add(dataCenterJxUIPane, BorderLayout.CENTER); |
|
|
|
@ -73,7 +55,7 @@ public class DatacentersPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
return new JxUIPane.Builder<String>() |
|
|
|
|
.engine(JX_ENGINE) |
|
|
|
|
.namespace(DATA_CENTER) |
|
|
|
|
.bindWindow(DATA_CENTER_HELPER, DatacentersJSBridge::getBridge) |
|
|
|
|
.bindWindow(DATA_CENTER_HELPER, DCTableDataJSBridge::getBridge) |
|
|
|
|
.withEMB("com/fr/design/data/tabledata/datacenter/web/data-choose.prod.html", |
|
|
|
|
ImmutableMap.of("fineServletURL", getDatacentersUrl())) |
|
|
|
|
.build(); |
|
|
|
@ -96,9 +78,11 @@ public class DatacentersPane extends AbstractTableDataPane<DCTableData> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void populateBean(DCTableData ob) { |
|
|
|
|
DatacentersJSBridge.relationPanel(this); |
|
|
|
|
DCTableDataJSBridge.relationPanel(this); |
|
|
|
|
dcTableData = ob; |
|
|
|
|
dataCenterJxUIPane.populate(EmbedJson.encode(ob.toBean())); |
|
|
|
|
String[] allDSNames = DesignTableDataManager.getAllDSNames(DesignTableDataManager.getEditingTableDataSource()); |
|
|
|
|
dataCenterJxUIPane.executeJS(DATA_CENTER + DOT + "datasetNames=" + EmbedJson.encode(allDSNames)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|