Browse Source

Merge pull request #496 in DESIGN/design from ~YAOH.WU/design:release/10.0 to release/10.0

* commit 'abd64f7ba774b00ccd3919082fc27d60ba79853d':
  无JIRA任务,多线程问题
  删除重复代码
  关闭未保存的文件交互修订
  REPORT-11395 用户搜索交互修订
  REPORT-11394 二次选择某些场景下可能删除失败
final/10.0
yaoh.wu 6 years ago
parent
commit
b86bfa1b3d
  1. 26
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  2. 21
      designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java
  3. 12
      designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java
  4. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png
  5. BIN
      designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png
  6. 7
      designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

26
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -17,6 +17,7 @@ import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants;
import com.fr.stable.ProductConstants;
import com.fr.third.javax.annotation.Nonnull;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator;
@ -677,34 +678,31 @@ public class MutilTempalteTabPane extends JComponent {
//当前激活的模板
String filename = openedTemplate.get(selectedIndex).getPath();
filename = FilenameUtils.standard(filename);
if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) {
specifiedTemplate.stopEditing();
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (returnVal == JOptionPane.YES_OPTION) {
specifiedTemplate.saveTemplate();
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath());
activeTemplate(filename);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
closeTpl(specifiedTemplate, filename);
} else if (returnVal == JOptionPane.NO_OPTION) {
closeTpl(specifiedTemplate, filename);
}
} else {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath());
activeTemplate(filename);
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
closeTpl(specifiedTemplate, filename);
}
}
private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
// release lock
WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath());
activeTemplate(fileName);
}
/**
* 关闭模板
*

21
designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java

@ -253,23 +253,16 @@ public class AuthorityListControlPane extends BasicPane {
* @param authorities authority
*/
public void setAuthority(List<DesignAuthority> authorities) {
if (authorities == null || authorities.isEmpty()) {
return;
}
DefaultListModel<DesignAuthority> model = (DefaultListModel<DesignAuthority>) authorityList.getModel();
model.clear();
for (DesignAuthority authority : authorities) {
model.addElement(authority);
if (authorities != null && !authorities.isEmpty()) {
for (DesignAuthority authority : authorities) {
model.addElement(authority);
}
int size = model.getSize() - 1;
authorityList.setSelectedIndex(size);
authorityList.ensureIndexIsVisible(size);
}
int size = model.getSize() - 1;
authorityList.setSelectedIndex(size);
authorityList.ensureIndexIsVisible(size);
authorityList.revalidate();
authorityList.repaint();
}

12
designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java

@ -1,5 +1,6 @@
package com.fr.design.remote.ui;
import com.fr.base.BaseUtils;
import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
@ -240,13 +241,14 @@ public class UserManagerPane extends BasicPane {
);
// 搜索
JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchPanel.setBorder(BorderFactory.createEmptyBorder());
keyField.setPreferredSize(new Dimension(250, 20));
JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5));
searchPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
keyField.setPreferredSize(new Dimension(270, 20));
keyField.requestFocus();
keyField.addKeyListener(keyFieldKeyListener);
keyField.getDocument().addDocumentListener(documentListener);
keyButton.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search"));
keyButton.setIcon(BaseUtils.readIcon("com/fr/design/images/buttonicon/user_search_normal.png"));
keyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search"));
keyButton.addActionListener(keyButtonActionListener);
searchPanel.add(keyField);
searchPanel.add(keyButton);
@ -367,9 +369,9 @@ public class UserManagerPane extends BasicPane {
final SwingWorker getMemberWorker = new SwingWorker<List<RemoteDesignMember>, Void>() {
@Override
protected List<RemoteDesignMember> doInBackground() {
addingMembers.clear();
String username = WorkContext.getCurrent().getConnection().getUserName();
synchronized (addingMembers) {
addingMembers.clear();
Collection<RemoteDesignMember> more = WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword);
pageNum = 1;
if (!more.isEmpty()) {

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

BIN
designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 844 B

7
designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

@ -19,7 +19,7 @@ public class ImagePreLoader {
int start = 0;
for (int i = 0; i < len; i++) {
if (i != 0 && i % THRESHOLD == 0) {
loadImage(start,i, service);
loadImage(start, i, service);
start = i;
}
if (len - i < THRESHOLD) {
@ -401,6 +401,9 @@ public class ImagePreLoader {
"com/fr/design/images/control/up.png",
"com/fr/design/images/control/down.png",
"com/fr/design/images/condition/bracket.png",
"com/fr/design/images/condition/unBracket.png"
"com/fr/design/images/condition/unBracket.png",
"com/fr/design/images/buttonicon/user_search_normal.png",
"com/fr/design/remote/images/icon_Member_normal@1x.png",
"/com/fr/design/images/buttonicon/add.png"
};
}

Loading…
Cancel
Save