Java 8 compilation (get rid of generic return type in Window). #PL-5830

This commit is contained in:
Konstantin Krivopustov 2015-10-06 13:49:18 +00:00
parent 36cbb21986
commit f9fab9cb9d
9 changed files with 37 additions and 36 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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