*
* @since 3.1.1.1
*/
public void openView(final String parentID, final Class<?> cla, String id,
final Object data, final boolean closeable) {
final MultipleDocumentInterfaceSWT mdi = UIFunctionsManagerSWT.getUIFunctionsSWT().getMDISWT();
if (mdi == null) {
return;
}
if (id == null) {
id = cla.getName();
int i = id.lastIndexOf('.');
if (i > 0) {
id = id.substring(i + 1);
}
}
IView viewFromID = mdi.getIViewFromID(id);
if (viewFromID != null) {
mdi.showEntryByID(id);
}
final String _id = id;
Utils.execSWTThreadLater(0, new AERunnable() {
public void runSupport() {
if (mdi.showEntryByID(_id)) {
return;
}
if (UISWTViewEventListener.class.isAssignableFrom(cla)) {
UISWTViewEventListener l = null;
try {
Constructor<?> constructor = cla.getConstructor(new Class[] {
data.getClass()
});
l = (UISWTViewEventListener) constructor.newInstance(new Object[] {
data
});
} catch (Exception e) {
}
try {
if (l == null) {
l = (UISWTViewEventListener) cla.newInstance();
}
mdi.createEntryFromEventListener(parentID, l, _id, closeable,
data);
} catch (Exception e) {
Debug.out(e);
}
} else {
mdi.createEntryFromIViewClass(parentID, _id, null, cla,
null, null, data, null, true);
}
mdi.showEntryByID(_id);
}
});
}