mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
refactor init method
This commit is contained in:
parent
0afc301825
commit
ec75361305
@ -142,7 +142,7 @@ public abstract class WindowManager {
|
||||
try {
|
||||
invokeMethod(window, "init", params);
|
||||
} catch (NoSuchMethodException e) {
|
||||
invokeMethod(window, "init");
|
||||
// Do nothing
|
||||
}
|
||||
return window;
|
||||
} catch (Throwable e) {
|
||||
@ -349,7 +349,7 @@ public abstract class WindowManager {
|
||||
try {
|
||||
invokeMethod(res, "init", params);
|
||||
} catch (NoSuchMethodException e) {
|
||||
invokeMethod(res, "init");
|
||||
// do nothing
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
throw new RuntimeException(e);
|
||||
|
@ -12,6 +12,8 @@ package com.haulmont.cuba.gui.components;
|
||||
import org.dom4j.Element;
|
||||
import com.haulmont.cuba.gui.data.DsContext;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class AbstractWindow extends AbstractFrame implements Window, Component.HasXmlDescriptor {
|
||||
public AbstractWindow(IFrame frame) {
|
||||
super(frame);
|
||||
@ -64,4 +66,8 @@ public class AbstractWindow extends AbstractFrame implements Window, Component.H
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
}
|
||||
|
||||
protected void init(Map<String, Object> params) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -14,13 +14,15 @@ import com.haulmont.cuba.gui.components.AbstractWindow;
|
||||
import com.haulmont.cuba.gui.components.Window;
|
||||
import com.haulmont.cuba.gui.components.Tree;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class GroupBrowser extends AbstractWindow
|
||||
{
|
||||
public GroupBrowser(Window frame) {
|
||||
super(frame);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected void init(Map<String, Object> params) {
|
||||
Tree tree = getComponent("groups");
|
||||
tree.getDatasource().refresh();
|
||||
tree.expandTree();
|
||||
|
@ -15,6 +15,7 @@ import com.haulmont.cuba.gui.WindowManager;
|
||||
import com.haulmont.cuba.security.entity.Role;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.Map;
|
||||
|
||||
public class RoleBrowser extends AbstractWindow
|
||||
{
|
||||
@ -22,7 +23,7 @@ public class RoleBrowser extends AbstractWindow
|
||||
super(frame);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected void init(Map<String, Object> params) {
|
||||
final Table table = getComponent("roles");
|
||||
|
||||
table.addAction(
|
||||
|
@ -12,12 +12,14 @@ package com.haulmont.cuba.web.app.ui.security.user.browse;
|
||||
import com.haulmont.cuba.gui.components.*;
|
||||
import com.haulmont.cuba.web.gui.components.ComponentsHelper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class UserBrowser extends AbstractLookup {
|
||||
public UserBrowser(Window frame) {
|
||||
super(frame);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected void init(Map<String, Object> params) {
|
||||
final Button button = getComponent("filter.apply");
|
||||
final Table table = getComponent("users");
|
||||
|
||||
|
@ -14,13 +14,14 @@ import com.haulmont.cuba.gui.WindowManager;
|
||||
import com.haulmont.cuba.security.entity.User;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class UserEditor extends AbstractEditor {
|
||||
public UserEditor(Window frame) {
|
||||
super(frame);
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
protected void init(Map<String, Object> params) {
|
||||
Button button = getComponent("browse");
|
||||
button.setAction(new AbstractAction("Browse") {
|
||||
public String getCaption() {
|
||||
|
Loading…
Reference in New Issue
Block a user