refactor init method

This commit is contained in:
Dmitry Abramov 2009-02-18 12:01:08 +00:00
parent 0afc301825
commit ec75361305
6 changed files with 18 additions and 6 deletions

View File

@ -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);

View File

@ -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) {
}
}

View File

@ -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();

View File

@ -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(

View File

@ -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");

View File

@ -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() {