Browse Source

Merge branch 'feature/10.0' of http://cloud.finedevelop.com:2015/scm/~plough/10-design into feature/10.0

research/10.0
plough 6 years ago
parent
commit
109d0ce931
  1. 29
      designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java
  2. 275
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  3. 100
      designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java
  4. 57
      designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java
  5. 39
      designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java
  6. 21
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

29
designer-base/src/main/java/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -4,14 +4,16 @@ import com.fr.base.Parameter;
import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.js.WebHyperlink;
import com.fr.stable.ParameterProvider;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.util.HashMap;
import java.util.List;
@ -19,8 +21,6 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
private static final int BORDER_WIDTH = 4;
private WebHyperNorthPane northPane;
private UICheckBox useCJKCheckBox;
private UICheckBox extendParametersCheckBox;
public WebHyperlinkPane() {
@ -42,16 +42,15 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null));
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Parameters"), null));
useCJKCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Use_CJK_To_Encode_Parameter"));
extendParametersCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters"));
this.add(GUICoreUtils.createFlowPane(new Component[]{useCJKCheckBox, extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH);
extendParametersCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters"));
this.add(GUICoreUtils.createFlowPane(new Component[]{extendParametersCheckBox}, FlowLayout.LEFT), BorderLayout.SOUTH);
}
@Override
public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link");
return Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link");
}
@Override
@ -63,7 +62,6 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
ParameterProvider[] parameters = ob.getParameters();
parameterViewPane.populate(parameters);
useCJKCheckBox.setSelected(ob.isUseCJK());
extendParametersCheckBox.setSelected(ob.isExtendParameters());
}
@ -88,7 +86,6 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
} else {
webHyperlink.setParameters(null);
}
webHyperlink.setUseCJK(this.useCJKCheckBox.isSelected());
webHyperlink.setExtendParameters(this.extendParametersCheckBox.isSelected());
}
@ -110,14 +107,6 @@ public class WebHyperlinkPane extends AbstractHyperLinkPane<WebHyperlink> {
this.northPane = northPane;
}
public UICheckBox getUseCJKCheckBox() {
return useCJKCheckBox;
}
public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) {
this.useCJKCheckBox = useCJKCheckBox;
}
public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox;
}

275
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -36,26 +36,17 @@ import java.util.Enumeration;
*/
public class ReportAndFSManagePane extends DockingView implements Prepare4DataSourceChange {
private static final int REPORT_PLATEFORM_MANAGE = 0;
private static final int FS_MANAGE = 1;
private static final int LEFT_GAP = -125;
private static boolean isSupportFS = false;
private TreePath treePath = null;
private static ReportAndFSManagePane singleton = new ReportAndFSManagePane();
private static RoleTree roleTree;
// carl:我先屏了,现在半拉子,等客户要了再好好做
// private AddAction addAction = new AddAction();
// private RemoveAction removeAction = new RemoveAction();
private RefreshAction refreshAction = new RefreshAction();
private UIHeadGroup buttonGroup;
private RoleSourceOP op;
protected String[] roleNames = new String[2];
private String roleNames;
public synchronized static ReportAndFSManagePane getInstance() {
singleton.op = new RoleSourceOP();
singleton.op.setDataMode(isSupportFS ? FS_MANAGE : REPORT_PLATEFORM_MANAGE);
singleton.setDefaultSelectedRole();
return singleton;
@ -99,29 +90,15 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
}
protected void setTabRoleName(String roleName) {
roleNames[getMode()] = roleTree.getSelectedRoleName();
roleNames = roleTree.getSelectedRoleName();
}
};
roleTree.setEnabled(true);
roleTree.setEditable(false);
// RoleTreeCellEditor treeCellEditor = new RoleTreeCellEditor(new UITextField());
// treeCellEditor.addCellEditorListener(treeCellEditor);
// roleTree.setCellEditor(treeCellEditor);
roleTree.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
roleTree.setEditable(false);
// int row = roleTree.getRowForLocation(e.getX(), e.getY());
// TreePath path = roleTree.getPathForLocation(e.getX(), e.getY());
// if (e.getClickCount() == 2 && buttonGroup.getSelectedIndex() == REPORT_PLATEFORM_MANAGE) {
// PrivilegeManagerProvider pm = PrivilegeManager.getProviderInstance();
// AuthenticationProvider ap = pm.getAuthenticationProvider();
// if (!(ap instanceof DaoAuthenticationProvider)) {
// roleTree.setEditable(true);
// roleTree.startEditingAtPath(path);
// treePath = path;
// }
// }
}
});
}
@ -141,7 +118,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
ExpandMutableTreeNode node = (ExpandMutableTreeNode) parent.getLastPathComponent();
String selectedRole = null;
if (singleton != null) {
selectedRole = roleNames[getMode()];
selectedRole = roleNames;
}
if (selectedRole == null) {
if (node.getChildCount() <= 0 || node.getFirstChild().getChildCount() <= 0) {
@ -190,13 +167,12 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
public void tabChanged(int index) {
roleTree.setEditable(false);
if (op != null) {
op.setDataMode(getMode());
//判断是否可编辑
refreshDockingView();
}
setDefaultSelectedRole();
if (singleton != null) {
changeAlreadyEditedPaneRole(roleNames[getMode()]);
changeAlreadyEditedPaneRole(roleNames);
}
}
};
@ -204,37 +180,11 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
buttonGroup.setNeedLeftRightOutLine(false);
}
private int getMode(){
return isSupportFS?FS_MANAGE: REPORT_PLATEFORM_MANAGE;
}
// /**
// * 检查看看是否可以增删刷新按钮是都可以编辑,并且检查角色树是不是可以编辑
// */
// public void checkToolButtonsEnabled() {
// if (buttonGroup.getSelectedIndex() == REPORT_PLATEFORM_MANAGE) {
// PrivilegeManagerProvider pm = PrivilegeManager.getProviderInstance();
// AuthenticationProvider ap = pm.getAuthenticationProvider();
// PrivilegeFilter pf = pm.getPrivilegeFilter();
// boolean isClickable = !(ap instanceof DaoAuthenticationProvider)
// && pf instanceof AuthorityControlFilter;
// addAction.setEnabled(isClickable);
// removeAction.setEnabled(isClickable);
// } else {
// addAction.setEnabled(false);
// removeAction.setEnabled(false);
// }
//
// }
/**
* 刷新界面
*/
public void refreshDockingView() {
populate(new RoleSourceOP());
// this.checkToolButtonsEnabled();
}
private void populate(RoleSourceOP op) {
@ -276,85 +226,6 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
}
// private class AddAction extends UpdateAction {
// public AddAction() {
// this.setName(com.fr.design.i18n.Toolkit.i18nText("Add"));
// this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png"));
// }
//
// @Override
// public void actionPerformed(ActionEvent e) {
// refreshDockingView();
//
// DefaultTreeModel treeModel = (DefaultTreeModel) roleTree.getModel();
// ExpandMutableTreeNode root = (ExpandMutableTreeNode) treeModel.getRoot();
// ExpandMutableTreeNode parentNode = (ExpandMutableTreeNode) root.getChildAt(0);
// String newName = com.fr.design.i18n.Toolkit.i18nText("newNode") + (++newIndex);
// parentNode.add(new ExpandMutableTreeNode(newName));
// op.addAction(newName);
// roleTree.updateUI();
//
// try {
// synchronized (AuthorityRoleDAOManager.class) {
// AuthorityControlFilter pf = AuthorityRoleDAOManager.getAuthControlFilter(true);
//
// if (AuthorityRoleDAOManager.getAuthorityAllocation(pf, newName) != null) {
// newName = com.fr.design.i18n.Toolkit.i18nText("newNode") + (++newIndex);
// roleTree.refreshTreeNode();
// expandTree(roleTree, true);
// }
//
// AuthorityRoleDAOManager.addAuthorityRole(pf, new Authority(newName), new Allocation(), false, true);
//
// AuthorityRoleDAOManager.doEnd(pf);
// }
// } catch (Exception e1) {
// FRContext.getLogger().error(e1.getMessage(), e1);
// }
// }
// }
// private class RemoveAction extends UpdateAction {
//
// public RemoveAction() {
// this.setName(com.fr.design.i18n.Toolkit.i18nText("Remove"));
// this.setSmallIcon(UIConstants.CLEAR_ICON);
// }
//
// @Override
// public void actionPerformed(ActionEvent e) {
//
//
// NameObject selectedNO = roleTree.getSelectedNameObject();
//
// if (selectedNO == null) {
// return;
// }
//
// int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Are_You_Sure_To_Remove_The_Selected_Item") + ":" + selectedNO.getName() + "?",
// com.fr.design.i18n.Toolkit.i18nText("Remove"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
// if (returnVal == JOptionPane.OK_OPTION) {
// op.removeAction(selectedNO.getName());
//
// try {
// AuthorityControlFilter pf = AuthorityRoleDAOManager.getAuthControlFilter(true);
//
// AuthorityRoleDAOManager.removeAuthorityRole(pf, new Authority(selectedNO.getName()), true);
// AuthorityRoleDAOManager.doEnd(pf);
// } catch (Exception e1) {
// FRContext.getLogger().error(e1.getMessage(), e1);
// }
//
// roleTree.refreshTreeNode();
// expandTree(roleTree, true);
// roleTree.updateUI();
// roleTree.requestFocus();
// roleTree.setSelectionRow(roleTree.getRowCount() - 1);
// }
// }
// }
/*
* 刷新ReportletsTree
*/
@ -373,144 +244,6 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
}
}
// private class RoleTreeCellEditor extends DefaultCellEditor implements TreeCellEditor, CellEditorListener {
//
// private NameObject editingNO;
// private String oldName;
// private String newName;
// private UITextField jTextField;
//
// public RoleTreeCellEditor(final UITextField textField) {
// super(textField);
// this.jTextField = textField;
// this.jTextField.setPreferredSize(new Dimension(DesignerEnvManager.getEnvManager().getLastWestRegionContainerWidth() - 5, this.jTextField.getHeight()));
// }
//
// @Override
// public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) {
// editingNO = ReportAndFSManagePane.this.roleTree.getSelectedNameObject();
// oldName = editingNO.getName();
//
// delegate.setValue(oldName);
//
// editorComponent.setPreferredSize(new java.awt.Dimension(ReportAndFSManagePane.this.getPreferredSize().width, editorComponent.getPreferredSize().height));
//
// return editorComponent;
// }
//
// @Override
//
// public boolean isCellEditable(EventObject anEvent) {
// NameObject no = ReportAndFSManagePane.this.roleTree.getSelectedNameObject();
// return !(no.getName() == com.fr.design.i18n.Toolkit.i18nText("Role"));
// }
//
// @Override
// public Object getCellEditorValue() {
// newName = super.getCellEditorValue().toString();
// editingNO.setName(newName);
// return editingNO;
// }
//
//
// private boolean checkRoleNameNotEmpty() {
// refreshDockingView();
//
// String currentText = delegate.getCellEditorValue().toString();
// boolean isContained = false;
// AuthorityControlFilter pf = AuthorityRoleDAOManager.getAuthControlFilter(false);
// if (pf != null &&
// !ComparatorUtils.equals(oldName, currentText)) {
// try {
// Iterator iterator = AuthorityRoleDAOManager.authorityAllocationIterator(pf);
//
// while (iterator.hasNext()) {
// AuthorityAllocation authorityAllocation = (AuthorityAllocation) ((Map.Entry) iterator.next())
// .getValue();
// Authority _authority = authorityAllocation.getAuthority();
// if(ComparatorUtils.equals(_authority.getName(), currentText)){
// isContained = true;
// break;
// }
// }
// } catch (Exception e) {
// }
// }
//
// if (currentText.isEmpty() || isContained) {
// JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("RoleName_Can_Not_Be_Null") + "!");
// roleTree.refreshTreeNode();
// expandTree(roleTree, true);
// delegate.setValue(oldName);
// return false;
// }
// return true;
// }
//
// /*
// * 下面两个方法是CellEditorListener的
// */
// @Override
// public void editingCanceled(ChangeEvent e) {
// if (!checkRoleNameNotEmpty()) {
// treePath = null;
// return;
// }
// roleTree.stopEditing();
// if (treePath == null) {
// return;
// }
// changeValue();
// roleTree.refreshTreeNode();
// expandTree(roleTree, true);
// }
//
// @Override
// public void editingStopped(ChangeEvent e) {
// if (!checkRoleNameNotEmpty()) {
// treePath = null;
// return;
// }
// changeValue();
// roleTree.refreshTreeNode();
// expandTree(roleTree, true);
// roleTree.updateUI();
// }
//
// private void changeValue() {
// newName = delegate.getCellEditorValue().toString();
// if (!newName.isEmpty() && newName != oldName) {
// roleTree.setSelectedRoleName(newName);
// op.rename(oldName, newName);
//
// AuthorityControlFilter pf = AuthorityRoleDAOManager.getAuthControlFilter(false);
// if (pf != null) {
// try {
// Iterator iterator = AuthorityRoleDAOManager.authorityAllocationIterator(pf);
//
// while (iterator.hasNext()) {
// AuthorityAllocation authorityAllocation = (AuthorityAllocation) ((Map.Entry) iterator.next())
// .getValue();
// Authority _authority = authorityAllocation.getAuthority();
// if (ComparatorUtils.equals(_authority.getName(), oldName)) {
// _authority.setName(newName);
// }
// }
// } catch (Exception e) {
// }
// }
//
// try {
// AuthorityRoleDAOManager.doEnd(pf);
// } catch (Exception e) {
// FRContext.getLogger().error(e.getMessage(), e);
// }
// }
// }
// }
/**
* 展开树
* @param tree

100
designer-base/src/main/java/com/fr/design/roleAuthority/RoleSourceOP.java

File diff suppressed because one or more lines are too long

57
designer-base/src/main/java/com/fr/design/roleAuthority/RoleTree.java

@ -1,23 +1,23 @@
package com.fr.design.roleAuthority;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itree.checkboxtree.CheckBoxTree;
import com.fr.design.gui.itree.checkboxtree.CheckBoxTreeSelectionModel;
import com.fr.general.NameObject;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.gui.itree.refreshabletree.UserObjectRefreshJTree;
import com.fr.design.mainframe.AuthorityPropertyPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.NameObject;
import com.fr.start.server.FineEmbedServer;
import javax.swing.SwingUtilities;
import javax.swing.JTree;
import javax.swing.JComponent;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import javax.swing.tree.DefaultMutableTreeNode;
@ -54,13 +54,6 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
this.replaceMouseListener(this, handler, 0);
this.replaceKeyListener(this, handler, 0);
this.addTreeSelectionListener(handler);
// this.removeMouseListener(treeMouseListener);
// this.addTreeSelectionListener(new TreeSelectionListener() {
// public void valueChanged(TreeSelectionEvent e) {
// doWithValueChanged(e);
// }
// });
}
public boolean isCheckBoxVisible(TreePath path) {
@ -68,6 +61,13 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
}
@Override
protected ExpandMutableTreeNode[] loadChildTreeNodes(ExpandMutableTreeNode selectedTreeNode) {
// 启动平台模块加载角色列表, server内部已经做了启动状态与Workspace判断.
FineEmbedServer.start();
return super.loadChildTreeNodes(selectedTreeNode);
}
/**
* Creates the mouse listener and key listener used by RoleTree.
*
@ -100,26 +100,8 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
return null;
}
// if (clicksInCheckBox(e, path)) {
return path;
// } else {
// return null;
// }
}
// protected boolean clicksInCheckBox(MouseEvent e, TreePath path) {
// if (!_tree.isCheckBoxVisible(path)) {
// return false;
// } else {
// Rectangle bounds = _tree.getPathBounds(path);
// if (_tree.getComponentOrientation().isLeftToRight()) {
// return e.getX() < bounds.x + _hotspot;
// } else {
// return e.getX() > bounds.x + bounds.width - _hotspot;
// }
// }
// }
}
private TreePath preventToggleEvent(MouseEvent e) {
TreePath pathForMouseEvent = getTreePathForMouseEvent(e);
@ -220,9 +202,6 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
TreePath tmpTreePath = treePaths[i];
toggleSelection(tmpTreePath);
}
// for (TreePath treePath : treePaths) {
// toggleSelection(treePath);
// }
}
}
@ -366,9 +345,6 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
for (int i = 0, length = listeners.length; i < length; i++) {
component.removeMouseListener(listeners[i]);
}
// for (MouseListener listener : listeners) {
// component.removeMouseListener(listener);
// }
for (int i = 0; i < listeners.length; i++) {
MouseListener listener = listeners[i];
if (index == i) {
@ -399,9 +375,6 @@ public class RoleTree extends UserObjectRefreshJTree<RoleSourceOP> {
for (int i = 0, length = listeners.length; i < length; i++) {
component.removeKeyListener(listeners[i]);
}
// for (MouseListener listener : listeners) {
// component.removeMouseListener(listener);
// }
for (int i = 0; i < listeners.length; i++) {
KeyListener listener = listeners[i];
if (index == i) {

39
designer-base/src/main/java/com/fr/design/roleAuthority/RolesEditedSourceOP.java

@ -1 +1,38 @@
package com.fr.design.roleAuthority; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.mainframe.JTemplate; import com.fr.general.NameObject; import com.fr.privilege.PrivilegeEditedRoleProvider; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:57 */ public class RolesEditedSourceOP extends RoleSourceOP { /** * 获取报表平台的角色 */ protected void addReportRoles(Map<String, RoleDataWrapper> report_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager")); report_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Server_Platform_Manager"), tdw); } /** * 获取数据决策系统的角色 */ protected void addFSRoles(Map<String, RoleDataWrapper> FS_roles) { RoleDataWrapper tdw = new RoleDataWrapper(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate")); FS_roles.put(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name_Duplicate"), tdw); } /** * 生成子节点 * * @return */ @Override public ExpandMutableTreeNode[] load() { Map<String, RoleDataWrapper> report_roles = null; // Map<String, RoleDataWrapper> FS_roles = null; if (this != null) { report_roles = this.init().get(0); // FS_roles = this.init().get(1); } else { report_roles = Collections.emptyMap(); // FS_roles = Collections.emptyMap(); } List<ExpandMutableTreeNode> list = new ArrayList<ExpandMutableTreeNode>(); //所有的角色 List<ExpandMutableTreeNode> reportlist = new ArrayList<ExpandMutableTreeNode>(); //报表平台橘色 // List<ExpandMutableTreeNode> FSlist = new ArrayList<ExpandMutableTreeNode>(); //数据决策系统角色 list.add(initReportRolseNode(report_roles)); addNodeToList(report_roles, reportlist); // list.add(initFSRolseNode(FS_roles)); // addNodeToList(FS_roles, FSlist); return list.toArray(new ExpandMutableTreeNode[list.size()]); } protected ExpandMutableTreeNode initReportRolseNode(Map<String, RoleDataWrapper> report_roles) { ExpandMutableTreeNode templateNode = new ExpandMutableTreeNode(new NameObject(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Roles_Already_Authority_Edited"), 0), true); templateNode.addChildTreeNodes(getNodeArrayFromMap(report_roles)); return templateNode; } protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) { List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>(); Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator(); while (entryIt.hasNext()) { Map.Entry<String, RoleDataWrapper> entry = entryIt.next(); String name = entry.getKey(); RoleDataWrapper t = entry.getValue(); JTemplate jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget(); ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet())); for (ExpandMutableTreeNode expandMutableTreeNode : expand) { roleList.add(expandMutableTreeNode); } } return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]); } }
package com.fr.design.roleAuthority;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.JTemplate;
import com.fr.privilege.PrivilegeEditedRoleProvider;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
* Author : daisy
* Date: 13-9-25
* Time: 下午4:57
*/
public class RolesEditedSourceOP extends RoleSourceOP {
protected ExpandMutableTreeNode[] getNodeArrayFromMap(Map<String, RoleDataWrapper> map) {
List<ExpandMutableTreeNode> roleList = new ArrayList<ExpandMutableTreeNode>();
Iterator<Map.Entry<String, RoleDataWrapper>> entryIt = map.entrySet().iterator();
while (entryIt.hasNext()) {
Map.Entry<String, RoleDataWrapper> entry = entryIt.next();
RoleDataWrapper t = entry.getValue();
JTemplate jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
PrivilegeEditedRoleProvider pe = (PrivilegeEditedRoleProvider) jt.getTarget();
ExpandMutableTreeNode[] expand = t.load(Arrays.asList(pe.getAllEditedRoleSet()));
for (ExpandMutableTreeNode expandMutableTreeNode : expand) {
roleList.add(expandMutableTreeNode);
}
}
return roleList.toArray(new ExpandMutableTreeNode[roleList.size()]);
}
}

21
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -67,6 +67,7 @@ import javax.swing.event.ListSelectionListener;
import java.awt.AWTEvent;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
@ -83,6 +84,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionListener;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;
@ -1161,6 +1163,8 @@ public class AlphaFineDialog extends UIDialog {
} else if (e.getClickCount() == 1) {
if (selectedValue instanceof MoreModel && ((MoreModel) selectedValue).isNeedMore()) {
dealWithMoreOrLessResult(selectedIndex, (MoreModel) selectedValue);
}else if(selectedValue instanceof BottomModel){
dealWithSearchResult(selectedValue);
}
}
}
@ -1175,6 +1179,23 @@ public class AlphaFineDialog extends UIDialog {
}
});
addMouseMotionListener(new MouseMotionListener() {
@Override
public void mouseMoved(MouseEvent e) {
final int x = e.getX();
final int y = e.getY();
final Rectangle cellBounds = getCellBounds(getModel().getSize() - 1, getModel().getSize() - 1);
if (cellBounds != null && cellBounds.contains(x, y)) {
setCursor(new Cursor(Cursor.HAND_CURSOR));
} else {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
@Override
public void mouseDragged(MouseEvent e) {
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {

Loading…
Cancel
Save