Browse Source

Merge remote-tracking branch 'origin/feature/10.0' into feature/10.0

master
ju 7 years ago
parent
commit
c1e23aa71e
  1. 2
      designer-base/src/com/fr/design/extra/PluginUtils.java
  2. 6
      designer-base/src/com/fr/design/extra/WebViewDlgHelper.java
  3. 86
      designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java
  4. 5
      designer-realize/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

2
designer-base/src/com/fr/design/extra/PluginUtils.java

@ -109,7 +109,7 @@ public class PluginUtils {
private static String getDownloadPath(String id) throws Exception { private static String getDownloadPath(String id) throws Exception {
HashMap<String, String> map = new HashMap<String, String>(); HashMap<String, String> map = new HashMap<String, String>();
map.put("id", id); map.put("id", id);
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts")); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.scripts_10"));
httpClient.asGet(); httpClient.asGet();
String resText = httpClient.getResponseText(); String resText = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(resText); JSONObject resultJSONObject = new JSONObject(resText);

6
designer-base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -72,10 +72,12 @@ public class WebViewDlgHelper {
if (rv == JOptionPane.OK_OPTION) { if (rv == JOptionPane.OK_OPTION) {
downloadShopScripts(SHOP_SCRIPTS); downloadShopScripts(SHOP_SCRIPTS);
} }
return;
} }
String jar_version = PluginStoreConstants.getInstance().getProps(ENV_VERSION, StringUtils.EMPTY); String jar_version = PluginStoreConstants.getInstance().getProps(ENV_VERSION, StringUtils.EMPTY);
if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) { if (ComparatorUtils.equals(jar_version, ProductConstants.VERSION)) {
updateShopScripts(SHOP_SCRIPTS); updateShopScripts(SHOP_SCRIPTS);
showPluginDlg();
} else { } else {
int rv = JOptionPane.showConfirmDialog( int rv = JOptionPane.showConfirmDialog(
null, null,
@ -281,7 +283,6 @@ public class WebViewDlgHelper {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome);
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等 PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE);
showPluginDlg();
} }
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -295,7 +296,7 @@ public class WebViewDlgHelper {
new SwingWorker<Void, Void>() { new SwingWorker<Void, Void>() {
@Override @Override
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv_10") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
httpClient.asGet(); httpClient.asGet();
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) {
String text = httpClient.getResponseText(); String text = httpClient.getResponseText();
@ -314,7 +315,6 @@ public class WebViewDlgHelper {
} }
} }
} }
showPluginDlg();
return null; return null;
} }
}.execute(); }.execute();

86
designer-chart/src/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java

@ -1,13 +1,6 @@
package com.fr.design.chart.series.SeriesCondition.impl; package com.fr.design.chart.series.SeriesCondition.impl;
import java.awt.BorderLayout;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import javax.swing.JPanel;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -22,17 +15,26 @@ import com.fr.general.Inter;
import com.fr.js.FormHyperlinkProvider; import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
+ * Created with IntelliJ IDEA. * + * Created with IntelliJ IDEA.
+ * User: zx * + * User: zx
+ * Date: 14-8-6 * + * Date: 14-8-6
+ * Time: 下午2:53 * + * Time: 下午2:53
+ */ * +
public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider> { *
* @author zx
*/
public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider> {
private UITextField itemNameTextField; private UITextField itemNameTextField;
private boolean needRenamePane = false; private boolean needRenamePane = false;
private Widget[] formHyperlinkEditors; private Widget[] formHyperlinkEditors;
private UIComboBox targetFrameComboBox; private UIComboBox targetFrameComboBox;
public FormHyperlinkNorthPane(boolean needRenamePane) { public FormHyperlinkNorthPane(boolean needRenamePane) {
@ -47,21 +49,16 @@ public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
formHyperlinkEditors = getFormHyperlinkEditors(); formHyperlinkEditors = getFormHyperlinkEditors();
targetFrameComboBox = formHyperlinkEditors == null ? new UIComboBox() : new UIComboBox(getFormHyperlinkEditNames()); targetFrameComboBox = formHyperlinkEditors == null ? new UIComboBox() : new UIComboBox(getFormHyperlinkEditNames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { targetFrameComboBox.setRenderer(new DefaultListCellRenderer());
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
return this;
}
});
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p, p};
double[] columnSize = {p, TableLayout.FILL}; double[] columnSize = {p, TableLayout.FILL};
Component[][] components; Component[][] components;
if(!this.needRenamePane){ if (!this.needRenamePane) {
components = new Component[][]{ components = new Component[][]{
{new UILabel(Inter.getLocText("FR-Designer_Form-Object")), targetFrameComboBox}, {new UILabel(Inter.getLocText("FR-Designer_Form-Object")), targetFrameComboBox},
}; };
}else{ } else {
itemNameTextField = new UITextField(); itemNameTextField = new UITextField();
components = new Component[][]{ components = new Component[][]{
{new UILabel(Inter.getLocText("FR-Designer_Name_has_Colon")), itemNameTextField}, {new UILabel(Inter.getLocText("FR-Designer_Name_has_Colon")), itemNameTextField},
@ -72,33 +69,33 @@ public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider
centerPane.add(northPane, BorderLayout.NORTH); centerPane.add(northPane, BorderLayout.NORTH);
} }
public Widget getEditingEditor(){ public Widget getEditingEditor() {
if (formHyperlinkEditors == null){ if (formHyperlinkEditors == null) {
return null; return null;
} }
String editingEditorName = (String)targetFrameComboBox.getSelectedItem(); String editingEditorName = (String) targetFrameComboBox.getSelectedItem();
for (Widget editor : formHyperlinkEditors){ for (Widget editor : formHyperlinkEditors) {
if (ComparatorUtils.equals(editingEditorName,editor.getWidgetName())){ if (ComparatorUtils.equals(editingEditorName, editor.getWidgetName())) {
return editor; return editor;
} }
} }
return null; return null;
} }
private Widget[] getFormHyperlinkEditors(){ private Widget[] getFormHyperlinkEditors() {
return DesignModelAdapter.getCurrentModelAdapter().getLinkableWidgets(); return DesignModelAdapter.getCurrentModelAdapter().getLinkableWidgets();
} }
private String[] getFormHyperlinkEditNames(){ private String[] getFormHyperlinkEditNames() {
String[] editorNames = new String[formHyperlinkEditors.length]; String[] editorNames = new String[formHyperlinkEditors.length];
int i =0; int i = 0;
for(Widget editor : formHyperlinkEditors){ for (Widget editor : formHyperlinkEditors) {
editorNames[i] = editor.getWidgetName(); editorNames[i] = editor.getWidgetName();
i++; i++;
} }
return editorNames; return editorNames;
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
@ -107,27 +104,34 @@ public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider
@Override @Override
public void populateBean(FormHyperlinkProvider formHyperlink) { public void populateBean(FormHyperlinkProvider formHyperlink) {
if(itemNameTextField != null){ formHyperlinkEditors = getFormHyperlinkEditors();
if (itemNameTextField != null) {
this.itemNameTextField.setText(formHyperlink.getItemName()); this.itemNameTextField.setText(formHyperlink.getItemName());
} }
String editorName = formHyperlink.getRelateEditorName(); String editorName = formHyperlink.getRelateEditorName();
//防止初始的时候有空白选项 //防止初始的时候有空白选项
if (editorName == null){ if (editorName == null) {
return; return;
} }
targetFrameComboBox.setSelectedItem(editorName); if (targetFrameComboBox != null) {
//noinspection unchecked
targetFrameComboBox.setModel(new DefaultComboBoxModel(getFormHyperlinkEditNames()));
targetFrameComboBox.setSelectedItem(editorName);
}
} }
@Override @Override
public FormHyperlinkProvider updateBean() { public FormHyperlinkProvider updateBean() {
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink =
StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
updateBean(formHyperlink); updateBean(formHyperlink);
return formHyperlink; return formHyperlink;
} }
@Override
public void updateBean(FormHyperlinkProvider formHyperlink) { public void updateBean(FormHyperlinkProvider formHyperlink) {
if(itemNameTextField != null){ if (itemNameTextField != null) {
formHyperlink.setItemName(this.itemNameTextField.getText()); formHyperlink.setItemName(this.itemNameTextField.getText());
} }
formHyperlink.setRelateEditorName((String) targetFrameComboBox.getSelectedItem()); formHyperlink.setRelateEditorName((String) targetFrameComboBox.getSelectedItem());

5
designer-realize/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -12,6 +12,7 @@ import com.fr.design.designer.EditingState;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
@ -260,7 +261,9 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
@Override @Override
public JPanel getHyperlinkPane(JTemplate jt) { public JPanel getHyperlinkPane(JTemplate jt) {
return jt.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance()); HyperlinkGroupPane hyperlinkGroupPane = jt.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(elementCasePane);
return hyperlinkGroupPane;
} }

Loading…
Cancel
Save