Browse Source

sonarCube

master
rinoux 7 years ago
parent
commit
0846a98d07
  1. 28
      designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java
  2. 5
      designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

28
designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java

@ -15,6 +15,7 @@ import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.webattr.ToolBarButton;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.tree.TreePath;
@ -37,8 +38,12 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
private AuthorityToolBarPane authorityToolBarPane;
private String[] selectedPathArray;
public AuthorityEditToolBarPane(List<ToolBarButton> buttonlists) {
public AuthorityEditToolBarPane(List<ToolBarButton> buttonList) {
super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate());
this.init(buttonList);
}
private void init(List<ToolBarButton> buttonList) {
this.setLayout(new BorderLayout());
this.setBorder(null);
UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Permissions",
@ -54,7 +59,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
northPane.add(authorityTitle, BorderLayout.CENTER);
northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR));
this.add(northPane, BorderLayout.NORTH);
authorityEditPane = new AuthorityEditPane(buttonlists);
authorityEditPane = new AuthorityEditPane(buttonList);
this.add(authorityEditPane, BorderLayout.CENTER);
}
@ -94,8 +99,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void itemStateChanged(ItemEvent e) {
String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName();
initSelectedPathArray();
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole ==
null || selectedPathArray == null) {
if (ComparatorUtils.equals(selectedRole, Inter.getLocText("FR-Designer_Role")) || selectedRole == null || selectedPathArray == null) {
return;
}
ToolBarButton selectedButton = null;
@ -210,29 +214,29 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane {
public void populateType() {
if (name.getText() == "") {
type.setText("");
if (StringUtils.EMPTY.equals(name.getText())) {
type.setText(StringUtils.EMPTY);
} else {
type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"}));
}
}
public void populateName() {
String names = "";
StringBuilder names = new StringBuilder();
for (int i = 0; i < buttonlists.size(); i++) {
if (buttonlists.get(i).isSelected()) {
names += "," + buttonlists.get(i).getNameOption().optionName();
names.append(",").append(buttonlists.get(i).getNameOption().optionName());
}
}
if (names != "") {
names = names.substring(1);
if (names.length() > 0) {
names.deleteCharAt(0);
}
name.setText(names);
name.setText(names.toString());
}
public void populateCheckPane() {
checkPane.removeAll();
if (name.getText() == "") {
if (StringUtils.EMPTY.equals(name.getText())) {
return;
}
double f = TableLayout.FILL;

5
designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -215,11 +215,13 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
ReportWebAttr rw = wbTpl.getReportWebAttr();
ConfigManagerProvider cm = ConfigManager.getProviderInstance();
ReportWebAttr webAttr = ((ReportWebAttr) cm.getGlobalAttribute(ReportWebAttr.class));
if (webAttr == null) {
return;
}
//wbTpl.clear先清空
//再将所有的保存进去
//看是存在服务器还存在模板里面
if (webAttr != null) {
if (choseComboBox.getSelectedIndex() == 0) {
//分页
if (rw == null || rw.getWebPage() == null) {
@ -237,7 +239,6 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
}
}
}
}
private void dealWithWebContent(WebContent wc, Widget widget, boolean isSelected, String selectedRole) {
ToolBarManager[] managers = wc.getToolBarManagers();

Loading…
Cancel
Save