Browse Source

Merge pull request #10331 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '9b7cc899a330a92ad96be8cd3c1df40ac3f8d9a2':
  REPORT-82112 模板锁定,超管强制解锁的按钮没了--抽方法,看起来更整洁
  REPORT-82112 模板锁定,超管强制解锁的按钮没了--改了一下非final变量改回小写
  REPORT-82112 模板锁定,超管强制解锁的按钮没了
bugfix/11.0
superman 2 years ago
parent
commit
eaeb52fcb4
  1. 36
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java

36
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -172,8 +172,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
tooBarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH); tooBarPane.add(new UIMenuHighLight(), BorderLayout.SOUTH);
searchToolbarPane = new TemplateTreeSearchToolbarPane(toolBar); searchToolbarPane = new TemplateTreeSearchToolbarPane(toolBar);
searchToolbarPane.add(createUpToolBarPane(), BorderLayout.EAST);
searchToolbarPane.setPreferredSize(new Dimension(this.getWidth(), 23)); searchToolbarPane.setPreferredSize(new Dimension(this.getWidth(), 23));
add(searchToolbarPane, BorderLayout.NORTH); add(searchToolbarPane, BorderLayout.NORTH);
CardLayout card; CardLayout card;
JPanel cardPane = new JPanel(card = new CardLayout()); JPanel cardPane = new JPanel(card = new CardLayout());
@ -183,7 +183,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
card.show(cardPane, FILE); card.show(cardPane, FILE);
TemplateTreePane.getInstance().setToolbarStateChangeListener(this); TemplateTreePane.getInstance().setToolbarStateChangeListener(this);
add(cardPane, BorderLayout.CENTER); add(cardPane, BorderLayout.CENTER);
stateChange(); stateChange();
} }
@ -219,7 +218,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
private JPanel createUpToolBarPane() { private JPanel createUpToolBarPane() {
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(toolBar, BorderLayout.CENTER);
if (WorkContext.getCurrent().isRoot()) { if (WorkContext.getCurrent().isRoot()) {
rightToolBar = new UIToolbar(FlowLayout.RIGHT); rightToolBar = new UIToolbar(FlowLayout.RIGHT);
rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR)); rightToolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.TOOLBAR_BORDER_COLOR));
@ -461,6 +459,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
// 交换层级 // 交换层级
searchToolbarPane.switchPane(TemplateTreeSearchToolbarPane.SEARCH_PANE); searchToolbarPane.switchPane(TemplateTreeSearchToolbarPane.SEARCH_PANE);
refreshRightToolBarByContentPaneType();
TemplateTreePane.getInstance().refreshDockingView(); TemplateTreePane.getInstance().refreshDockingView();
TemplateTreeSearchManager.getInstance().switchToSearch(TemplateTreePane.getInstance().getTemplateFileTree()); TemplateTreeSearchManager.getInstance().switchToSearch(TemplateTreePane.getInstance().getTemplateFileTree());
} }
@ -595,15 +594,36 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
} }
} }
/**
* 搜索状态下不显示rightToolBar
*/
public void refreshRightToolBarByContentPaneType() {
if (rightToolBar != null) {
if (StringUtils.equals(TemplateTreeSearchToolbarPane.contentPaneType, TemplateTreeSearchToolbarPane.SEARCH_PANE)) {
rightToolBar.setVisible(false);
}
}
}
public void refreshRightToolBarBy(FileNode fileNode) { public void refreshRightToolBarBy(FileNode fileNode) {
refreshRightToolBarByNode(fileNode);
refreshRightToolBarByContentPaneType();
}
/**
* 根据当前选中节点判断是否锁定状态
*
* @param fileNode 选中文件节点
*/
public void refreshRightToolBarByNode(FileNode fileNode) {
if (rightToolBar != null) { if (rightToolBar != null) {
boolean locked = fileNode != null boolean locked = fileNode != null
&& StringUtils.isNotEmpty(fileNode.getLock()) && StringUtils.isNotEmpty(fileNode.getLock())
&& !ComparatorUtils.equals(fileNode.getLock(), fileNode.getUserID()); && !ComparatorUtils.equals(fileNode.getLock(), fileNode.getUserID());
boolean visible = locked boolean visible = locked
&& WorkContext.getCurrent().isRoot() && WorkContext.getCurrent().isRoot()
&& WorkContext.getCurrent().get(LockInfoOperator.class).isUnLockable() && WorkContext.getCurrent().get(LockInfoOperator.class).isUnLockable()
&& !WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(fileNode.getEnvPath()); && !WorkContext.getCurrent().get(LockInfoOperator.class).isTplUnLocked(fileNode.getEnvPath());
rightToolBar.setVisible(visible); rightToolBar.setVisible(visible);
} }
} }

6
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java

@ -39,6 +39,11 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS
public static final String SEARCH_PANE = "searchPane"; public static final String SEARCH_PANE = "searchPane";
/**
* 判断工具栏是处于搜索栏还是非搜索栏
*/
public static String contentPaneType = "toolbarPane";
/** /**
* 工具栏 * 工具栏
*/ */
@ -187,6 +192,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS
*/ */
public void switchPane(String name) { public void switchPane(String name) {
cardLayout.show(contentPane, name); cardLayout.show(contentPane, name);
contentPaneType = name;
} }
public void setPlaceHolder(String placeHolder) { public void setPlaceHolder(String placeHolder) {

Loading…
Cancel
Save