I was wondering whether it was possible to switch between views from within a Java class called by a trigger.
To start with just listing all tha available views , I've tried the following code :
public void listViews()
{
ModelRepository mr = ModelRepository.getInstance();
InstanceRepository ir = mr.getInstanceRepository();
ModelInstanceRepository mir = (ModelInstanceRepository)ir;
List<View> l = ViewManager.getInstance().getViews(mir.getInstance("70b1009_209"));
for (View v : l)
{
System.out.println(v.getName());
}
return;
}
with, of course, the right imports beforehands.
However, the call to ViewManager.getInstance() fails (shown by commenting line by line).The Java error message seems to be caught by GEMS, so all I've got is a dialog box saying
Error invoking method public void MyBean.listViews() on bean MyBean:@f1cdfb:null
Reason: Error invoking method public void MyBean.listViews() on bean MyBean:@f1cdfb:null
Now, I'm not even sure these functions are supposed to be called by anyone but Eclipse itself...
So : is my goal achievable ?
Side question : if it is possible, is it possible to dynamically create a new view ?
Thank you for any feedback,
Marcanpilami.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I was wondering whether it was possible to switch between views from within a Java class called by a trigger.
To start with just listing all tha available views , I've tried the following code :
public void listViews()
{
ModelRepository mr = ModelRepository.getInstance();
InstanceRepository ir = mr.getInstanceRepository();
ModelInstanceRepository mir = (ModelInstanceRepository)ir;
List<View> l = ViewManager.getInstance().getViews(mir.getInstance("70b1009_209"));
for (View v : l)
{
System.out.println(v.getName());
}
return;
}
with, of course, the right imports beforehands.
However, the call to ViewManager.getInstance() fails (shown by commenting line by line).The Java error message seems to be caught by GEMS, so all I've got is a dialog box saying
Error invoking method public void MyBean.listViews() on bean MyBean:@f1cdfb:null
Reason: Error invoking method public void MyBean.listViews() on bean MyBean:@f1cdfb:null
Now, I'm not even sure these functions are supposed to be called by anyone but Eclipse itself...
So : is my goal achievable ?
Side question : if it is possible, is it possible to dynamically create a new view ?
Thank you for any feedback,
Marcanpilami.