Browse Source

Merge branch 'release/9.0' of http://www.finedevelop.com:2015/scm/~vito/design into release/9.0

master
vito 7 years ago
parent
commit
fb04cfc980
  1. 6
      designer/src/com/fr/design/mainframe/SheetNameTabPane.java
  2. 12
      designer_base/src/com/fr/design/extra/PluginOperateUtils.java
  3. 22
      designer_base/src/com/fr/design/extra/PluginUtils.java
  4. 2
      designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  5. 3
      designer_base/src/com/fr/file/FILEChooserPane.java

6
designer/src/com/fr/design/mainframe/SheetNameTabPane.java

@ -554,10 +554,12 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse
for (int i = scrollIndex; i <= lastOneIndex; i++) {
int textWidth = widthArray[i];
if (evtX >= textX && evtX < textX + textWidth) {
if (getSelectedIndex() != i) {
boolean needRefreshPropertiesPane = getSelectedIndex() != i;
setSelectedIndex(i);
if (needRefreshPropertiesPane) {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
}
setSelectedIndex(i);
isBlank = false;
reportComposite.setComposite();
if (isAuthorityEditing) {

12
designer_base/src/com/fr/design/extra/PluginOperateUtils.java

@ -140,7 +140,8 @@ public class PluginOperateUtils {
String result = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.getJSONArray("result");
jsCallback.execute(jsonArray.toString());
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(jsonArray);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -171,7 +172,8 @@ public class PluginOperateUtils {
String result = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(result);
JSONArray resultArr = resultJSONObject.getJSONArray("result");
jsCallback.execute(resultArr.toString());
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(resultArr);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -190,7 +192,9 @@ public class PluginOperateUtils {
try {
HttpClient httpClient = new HttpClient(plistUrl.toString());
String result = httpClient.getResponseText();
jsCallback.execute(result);
JSONArray jsonArray = new JSONArray(result);
JSONArray resultJSONArray = PluginUtils.filterPluginsFromVersion(jsonArray);
jsCallback.execute(resultJSONArray.toString());
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
@ -300,4 +304,6 @@ public class PluginOperateUtils {
return pluginInfo.toString();
}
}

22
designer_base/src/com/fr/design/extra/PluginUtils.java

@ -7,6 +7,8 @@ import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
import com.fr.json.JSONObject;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
@ -184,4 +186,24 @@ public class PluginUtils {
}
return null;
}
/**
* 在不同设计器版本下展示不同插件
* @return 插件
*/
public static JSONArray filterPluginsFromVersion(JSONArray oriJSONArray) throws Exception{
JSONArray resultJSONArray = JSONArray.create();
for(int i = 0; i < oriJSONArray.length(); i++){
JSONObject jo = oriJSONArray.getJSONObject(i);
String envVersion = jo.optString("env-version");
if(isCompatibleCurrentEnv(envVersion)){
resultJSONArray.put(jo);
}
}
return resultJSONArray;
}
private static boolean isCompatibleCurrentEnv(String envVersion){
return VersionIntervalFactory.create(envVersion).contain(Version.currentEnvVersion());
}
}

2
designer_base/src/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -77,7 +77,7 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback {
}else {
jsCallback.execute("failed");
FRLogger.getLogger().info(Inter.getLocText("FR-Plugin_Install_Failed"));
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Designer-Plugin_Warning"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, PluginUtils.getMessageByErrorCode(result.errorCode()), Inter.getLocText("FR-Plugin_Install_Failed"), JOptionPane.ERROR_MESSAGE);
}
}
}

3
designer_base/src/com/fr/file/FILEChooserPane.java

@ -16,6 +16,7 @@ import com.fr.design.gui.itextfield.UIAutoCompletionField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerFrame;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.filetree.FileNode;
@ -475,7 +476,7 @@ public class FILEChooserPane extends BasicPane {
this.suffix = suffix;
dialog = showWindow((Window) parent, false);
dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false);
JPanel contentPane = (JPanel) dialog.getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());
contentPane.add(this, BorderLayout.CENTER);

Loading…
Cancel
Save