|
|
@ -5,6 +5,7 @@ import com.fr.data.TableDataSource; |
|
|
|
import com.fr.data.impl.DBTableData; |
|
|
|
import com.fr.data.impl.DBTableData; |
|
|
|
import com.fr.data.impl.TableDataSourceDependent; |
|
|
|
import com.fr.data.impl.TableDataSourceDependent; |
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
import com.fr.design.DesignModelAdapter; |
|
|
|
|
|
|
|
import com.fr.design.DesignerEnvManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.actions.UpdateAction; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
@ -53,10 +54,12 @@ import com.fr.plugin.manage.PluginFilter; |
|
|
|
import com.fr.plugin.observer.PluginEvent; |
|
|
|
import com.fr.plugin.observer.PluginEvent; |
|
|
|
import com.fr.plugin.observer.PluginEventListener; |
|
|
|
import com.fr.plugin.observer.PluginEventListener; |
|
|
|
import com.fr.stable.core.PropertyChangeAdapter; |
|
|
|
import com.fr.stable.core.PropertyChangeAdapter; |
|
|
|
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.Icon; |
|
|
|
import javax.swing.Icon; |
|
|
|
|
|
|
|
import javax.swing.JLabel; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
@ -64,6 +67,7 @@ import javax.swing.SwingWorker; |
|
|
|
import javax.swing.ToolTipManager; |
|
|
|
import javax.swing.ToolTipManager; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
import javax.swing.tree.TreePath; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
import java.awt.GridLayout; |
|
|
|
import java.awt.GridLayout; |
|
|
|
import java.awt.dnd.DnDConstants; |
|
|
|
import java.awt.dnd.DnDConstants; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
@ -106,6 +110,7 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
private EsdOnAction esdAction; |
|
|
|
private EsdOnAction esdAction; |
|
|
|
private EsdOffAction esdOffAction; |
|
|
|
private EsdOffAction esdOffAction; |
|
|
|
private PreviewTableDataAction previewTableDataAction; |
|
|
|
private PreviewTableDataAction previewTableDataAction; |
|
|
|
|
|
|
|
private JPanel serverDatasetAuthTipJPanel = new JPanel(); |
|
|
|
|
|
|
|
|
|
|
|
private TableDataTreePane() { |
|
|
|
private TableDataTreePane() { |
|
|
|
initPane(); |
|
|
|
initPane(); |
|
|
@ -149,10 +154,12 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
|
|
|
|
|
|
|
|
UIScrollPane scrollPane = new UIScrollPane(tableDataTree); |
|
|
|
UIScrollPane scrollPane = new UIScrollPane(tableDataTree); |
|
|
|
scrollPane.setBorder(null); |
|
|
|
scrollPane.setBorder(null); |
|
|
|
|
|
|
|
initServerDatasetAuthTipJPanel(); |
|
|
|
initButtonGroup(); |
|
|
|
initButtonGroup(); |
|
|
|
JPanel jPanel = new JPanel(new BorderLayout(0, 0)); |
|
|
|
JPanel jPanel = new JPanel(new BorderLayout(0, 0)); |
|
|
|
JPanel buttonPane = new JPanel(new GridLayout()); |
|
|
|
JPanel buttonPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
buttonPane.add(buttonGroup, BorderLayout.CENTER); |
|
|
|
buttonPane.add(buttonGroup, BorderLayout.CENTER); |
|
|
|
|
|
|
|
buttonPane.add(serverDatasetAuthTipJPanel, BorderLayout.SOUTH); |
|
|
|
jPanel.add(buttonPane, BorderLayout.NORTH); |
|
|
|
jPanel.add(buttonPane, BorderLayout.NORTH); |
|
|
|
jPanel.add(scrollPane, BorderLayout.CENTER); |
|
|
|
jPanel.add(scrollPane, BorderLayout.CENTER); |
|
|
|
this.add(jPanel, BorderLayout.CENTER); |
|
|
|
this.add(jPanel, BorderLayout.CENTER); |
|
|
@ -172,6 +179,38 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
checkButtonEnabled(); |
|
|
|
checkButtonEnabled(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initServerDatasetAuthTipJPanel() { |
|
|
|
|
|
|
|
String[] lineTips = Toolkit.i18nText("Fine-Design_Server_Dataset_Auth_Tip").split("\n"); |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel = new JPanel(); |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel.setLayout(new GridLayout(lineTips.length, 1)); |
|
|
|
|
|
|
|
for (int i = 0; i < lineTips.length; i++) { |
|
|
|
|
|
|
|
String lineTip = lineTips[i]; |
|
|
|
|
|
|
|
List<JLabel> jLabels = new ArrayList<>(); |
|
|
|
|
|
|
|
jLabels.add(new JLabel(lineTip)); |
|
|
|
|
|
|
|
if (i == (lineTips.length - 1)) { |
|
|
|
|
|
|
|
JLabel jLabel = new JLabel(Toolkit.i18nText("Fine-Design_Basic_Alphafine_No_Remind")); |
|
|
|
|
|
|
|
jLabel.setForeground(Color.lightGray); |
|
|
|
|
|
|
|
jLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
|
|
|
DesignerEnvManager.getEnvManager().setShowServerDatasetAuthTip(false); |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
jLabels.add(jLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel.add(getLineTipJPanel(jLabels)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private JPanel getLineTipJPanel(List<JLabel> jLabels) { |
|
|
|
|
|
|
|
JPanel jPanel = new JPanel(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
|
|
|
|
for (JLabel jLabel : jLabels) { |
|
|
|
|
|
|
|
jPanel.add(jLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return jPanel; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void createPluginListener() { |
|
|
|
private void createPluginListener() { |
|
|
|
//菜单栏监听
|
|
|
|
//菜单栏监听
|
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { |
|
|
|
GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { |
|
|
@ -532,6 +571,11 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
String[] textArray = {Toolkit.i18nText("Fine-Design_Basic_Tabledata_Source_Type_Template"), Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData")}; |
|
|
|
String[] textArray = {Toolkit.i18nText("Fine-Design_Basic_Tabledata_Source_Type_Template"), Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData")}; |
|
|
|
buttonGroup = new UIHeadGroup(textArray) { |
|
|
|
buttonGroup = new UIHeadGroup(textArray) { |
|
|
|
public void tabChanged(int index) { |
|
|
|
public void tabChanged(int index) { |
|
|
|
|
|
|
|
if (isShowServerDatasetAuthTipJPanel(textArray[index])) { |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel.setVisible(true); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
serverDatasetAuthTipJPanel.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
if (op != null) { |
|
|
|
if (op != null) { |
|
|
|
op.setDataMode(modeArray[buttonGroup.getSelectedIndex()]); |
|
|
|
op.setDataMode(modeArray[buttonGroup.getSelectedIndex()]); |
|
|
|
addMenuDef.setEnabled(modeArray[buttonGroup.getSelectedIndex()] == TEMPLATE_TABLE_DATA); |
|
|
|
addMenuDef.setEnabled(modeArray[buttonGroup.getSelectedIndex()] == TEMPLATE_TABLE_DATA); |
|
|
@ -539,6 +583,15 @@ public class TableDataTreePane extends BasicTableDataTreePane { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean isShowServerDatasetAuthTipJPanel(String name) { |
|
|
|
|
|
|
|
if (ComparatorUtils.equals(name, Toolkit.i18nText("Fine-Design_Basic_DS_Server_TableData")) |
|
|
|
|
|
|
|
&& DesignerEnvManager.getEnvManager().isShowServerDatasetAuthTip() |
|
|
|
|
|
|
|
&& !WorkContext.getCurrent().isLocal()) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
buttonGroup.setNeedLeftRightOutLine(false); |
|
|
|
buttonGroup.setNeedLeftRightOutLine(false); |
|
|
|
} |
|
|
|
} |
|
|
|