mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
Java 8 compilation (get rid of generic return type in Window). #PL-5830
This commit is contained in:
parent
36cbb21986
commit
f9fab9cb9d
@ -152,25 +152,25 @@ public class DesktopFrame
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return getWindowManager().openEditor(windowInfo, item, openType, params, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return getWindowManager().openEditor(windowInfo, item, openType, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return getWindowManager().openEditor(windowInfo, item, openType, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return getWindowManager().openEditor(windowInfo, item, openType);
|
||||
}
|
||||
|
@ -527,22 +527,22 @@ public class DesktopWindow implements Window, Component.Disposable,
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
return delegate.openEditor(windowAlias, item, openType, params, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
return delegate.openEditor(windowAlias, item, openType, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
return delegate.openEditor(windowAlias, item, openType, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
|
||||
return delegate.openEditor(windowAlias, item, openType);
|
||||
}
|
||||
|
||||
|
@ -369,28 +369,24 @@ public class AbstractFrame implements Frame, Component.Wrapper, Component.Ordere
|
||||
return (AbstractWindow) frame.openWindow(windowAlias, openType);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T extends Entity> AbstractEditor<T> openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
return (AbstractEditor<T>) frame.openEditor(windowAlias, item, openType, params, parentDs);
|
||||
public AbstractEditor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
return (AbstractEditor) frame.openEditor(windowAlias, item, openType, params, parentDs);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T extends Entity> AbstractEditor<T> openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
return (AbstractEditor<T>) frame.openEditor(windowAlias, item, openType, params);
|
||||
public AbstractEditor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
return (AbstractEditor) frame.openEditor(windowAlias, item, openType, params);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T extends Entity> AbstractEditor<T> openEditor(String windowAlias, T item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
return (AbstractEditor<T>) frame.openEditor(windowAlias, item, openType, Collections.<String, Object>emptyMap(), parentDs);
|
||||
public AbstractEditor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
return (AbstractEditor) frame.openEditor(windowAlias, item, openType, Collections.<String, Object>emptyMap(), parentDs);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public <T extends Entity> AbstractEditor<T> openEditor(String windowAlias, T item, WindowManager.OpenType openType) {
|
||||
return (AbstractEditor<T>) frame.openEditor(windowAlias, item, openType, Collections.<String, Object>emptyMap());
|
||||
public AbstractEditor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
|
||||
return (AbstractEditor) frame.openEditor(windowAlias, item, openType, Collections.<String, Object>emptyMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -121,7 +121,7 @@ public interface Frame
|
||||
* datasource instead of directly to database
|
||||
* @return created window
|
||||
*/
|
||||
<T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType,
|
||||
Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType,
|
||||
Map<String, Object> params, Datasource parentDs);
|
||||
|
||||
/**
|
||||
@ -133,7 +133,7 @@ public interface Frame
|
||||
* @param params parameters to pass to <code>init()</code> method of the screen's controller
|
||||
* @return created window
|
||||
*/
|
||||
<T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType,
|
||||
Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType,
|
||||
Map<String, Object> params);
|
||||
|
||||
/**
|
||||
@ -146,8 +146,7 @@ public interface Frame
|
||||
* datasource instead of directly to database
|
||||
* @return created window
|
||||
*/
|
||||
<T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType,
|
||||
Datasource parentDs);
|
||||
Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs);
|
||||
|
||||
/**
|
||||
* Open an edit screen.
|
||||
@ -157,7 +156,7 @@ public interface Frame
|
||||
* @param openType how to open the screen
|
||||
* @return created window
|
||||
*/
|
||||
<T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType);
|
||||
Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType);
|
||||
|
||||
/**
|
||||
* Open a lookup screen.
|
||||
|
@ -13,6 +13,7 @@ import com.haulmont.cuba.gui.components.actions.ItemTrackingAction;
|
||||
import com.haulmont.cuba.gui.components.actions.RefreshAction;
|
||||
import com.haulmont.cuba.gui.data.CollectionDatasource;
|
||||
import com.haulmont.cuba.web.app.ui.jmxcontrol.ds.ManagedBeanInfoDatasource;
|
||||
import com.haulmont.cuba.web.app.ui.jmxinstance.edit.JmxInstanceEditor;
|
||||
import com.haulmont.cuba.web.jmx.JmxControlAPI;
|
||||
import com.haulmont.cuba.web.jmx.JmxControlException;
|
||||
import com.haulmont.cuba.web.jmx.entity.ManagedBeanInfo;
|
||||
@ -125,7 +126,8 @@ public class MbeansDisplayWindow extends AbstractWindow {
|
||||
jmxConnectionField.addAction(new AbstractAction("actions.Add") {
|
||||
@Override
|
||||
public void actionPerform(Component component) {
|
||||
final AbstractEditor<JmxInstance> instanceEditor = openEditor("sys$JmxInstance.edit", new JmxInstance(), OpenType.DIALOG);
|
||||
final JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor("sys$JmxInstance.edit",
|
||||
new JmxInstance(), OpenType.DIALOG);
|
||||
instanceEditor.addCloseListener(actionId -> {
|
||||
if (COMMIT_ACTION_ID.equals(actionId)) {
|
||||
jmxInstancesDs.refresh();
|
||||
|
@ -20,6 +20,7 @@ import com.haulmont.cuba.gui.components.Timer;
|
||||
import com.haulmont.cuba.gui.data.CollectionDatasource;
|
||||
import com.haulmont.cuba.gui.export.ExportDisplay;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.web.app.ui.jmxinstance.edit.JmxInstanceEditor;
|
||||
import com.haulmont.cuba.web.export.LogDataProvider;
|
||||
import com.haulmont.cuba.web.gui.components.WebComponentsHelper;
|
||||
import com.haulmont.cuba.web.jmx.JmxControlAPI;
|
||||
@ -145,7 +146,8 @@ public class ServerLogWindow extends AbstractWindow {
|
||||
jmxConnectionField.addAction(new AbstractAction("actions.Add") {
|
||||
@Override
|
||||
public void actionPerform(Component component) {
|
||||
AbstractEditor<JmxInstance> instanceEditor = openEditor("sys$JmxInstance.edit", new JmxInstance(), OpenType.DIALOG);
|
||||
JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor("sys$JmxInstance.edit",
|
||||
new JmxInstance(), OpenType.DIALOG);
|
||||
instanceEditor.addCloseListener(actionId -> {
|
||||
if (COMMIT_ACTION_ID.equals(actionId)) {
|
||||
jmxInstancesDs.refresh();
|
||||
|
@ -15,6 +15,7 @@ import com.haulmont.cuba.gui.WindowManager.OpenType;
|
||||
import com.haulmont.cuba.gui.components.*;
|
||||
import com.haulmont.cuba.gui.data.CollectionDatasource;
|
||||
import com.haulmont.cuba.gui.data.GroupDatasource;
|
||||
import com.haulmont.cuba.web.app.ui.jmxinstance.edit.JmxInstanceEditor;
|
||||
import com.haulmont.cuba.web.jmx.JmxControlAPI;
|
||||
import com.haulmont.cuba.web.jmx.JmxControlException;
|
||||
|
||||
@ -99,7 +100,8 @@ public class StatisticsWindow extends AbstractWindow {
|
||||
jmxConnectionField.addAction(new AbstractAction("actions.Add") {
|
||||
@Override
|
||||
public void actionPerform(Component component) {
|
||||
AbstractEditor<JmxInstance> instanceEditor = openEditor("sys$JmxInstance.edit", new JmxInstance(), OpenType.DIALOG);
|
||||
JmxInstanceEditor instanceEditor = (JmxInstanceEditor) openEditor("sys$JmxInstance.edit",
|
||||
new JmxInstance(), OpenType.DIALOG);
|
||||
instanceEditor.addCloseListener(actionId -> {
|
||||
if (COMMIT_ACTION_ID.equals(actionId)) {
|
||||
jmxInstancesDs.refresh();
|
||||
|
@ -389,22 +389,22 @@ public class WebWindow implements Window, Component.Wrapper,
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
return delegate.openEditor(windowAlias, item, openType, params, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
return delegate.openEditor(windowAlias, item, openType, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
return delegate.openEditor(windowAlias, item, openType, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
|
||||
return delegate.openEditor(windowAlias, item, openType);
|
||||
}
|
||||
|
||||
|
@ -187,25 +187,25 @@ public class WebFrame extends WebVBoxLayout implements Frame, WrappedFrame {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params, Datasource parentDs) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return App.getInstance().getWindowManager().openEditor(windowInfo, item, openType, params, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Map<String, Object> params) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return App.getInstance().getWindowManager().openEditor(windowInfo, item, openType, params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType, Datasource parentDs) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return App.getInstance().getWindowManager().openEditor(windowInfo, item, openType, parentDs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends Entity> Window.Editor openEditor(String windowAlias, T item, WindowManager.OpenType openType) {
|
||||
public Window.Editor openEditor(String windowAlias, Entity item, WindowManager.OpenType openType) {
|
||||
WindowInfo windowInfo = windowConfig.getWindowInfo(windowAlias);
|
||||
return App.getInstance().getWindowManager().openEditor(windowInfo, item, openType);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user