|
Lines 4032-4052
Link Here
|
| 4032 |
perspective.getId(), window); |
4032 |
perspective.getId(), window); |
| 4033 |
|
4033 |
|
| 4034 |
if (modelPerspective == null) { |
4034 |
if (modelPerspective == null) { |
| 4035 |
|
|
|
| 4036 |
// couldn't find the perspective, create a new one |
4035 |
// couldn't find the perspective, create a new one |
| 4037 |
modelPerspective = modelService.createModelElement(MPerspective.class); |
4036 |
modelPerspective = createPerspective(perspective); |
| 4038 |
|
|
|
| 4039 |
// tag it with the same id |
| 4040 |
modelPerspective.setElementId(perspective.getId()); |
| 4041 |
|
| 4042 |
// instantiate the perspective |
| 4043 |
IPerspectiveFactory factory = ((PerspectiveDescriptor) perspective).createFactory(); |
| 4044 |
ModeledPageLayout modelLayout = new ModeledPageLayout(window, modelService, |
| 4045 |
partService, modelPerspective, perspective, this, true); |
| 4046 |
factory.createInitialLayout(modelLayout); |
| 4047 |
PerspectiveTagger.tagPerspective(modelPerspective, modelService); |
| 4048 |
PerspectiveExtensionReader reader = new PerspectiveExtensionReader(); |
| 4049 |
reader.extendLayout(getExtensionTracker(), perspective.getId(), modelLayout); |
| 4050 |
} |
4037 |
} |
| 4051 |
|
4038 |
|
| 4052 |
modelPerspective.setLabel(perspective.getLabel()); |
4039 |
modelPerspective.setLabel(perspective.getLabel()); |
|
Lines 4076-4081
Link Here
|
| 4076 |
UIEvents.publishEvent(UIEvents.UILifeCycle.PERSPECTIVE_OPENED, modelPerspective); |
4063 |
UIEvents.publishEvent(UIEvents.UILifeCycle.PERSPECTIVE_OPENED, modelPerspective); |
| 4077 |
} |
4064 |
} |
| 4078 |
|
4065 |
|
|
|
4066 |
/** |
| 4067 |
* @param perspective |
| 4068 |
* @return never null |
| 4069 |
*/ |
| 4070 |
public MPerspective createPerspective(IPerspectiveDescriptor perspective) { |
| 4071 |
MPerspective modelPerspective = modelService.createModelElement(MPerspective.class); |
| 4072 |
|
| 4073 |
// tag it with the same id |
| 4074 |
modelPerspective.setElementId(perspective.getId()); |
| 4075 |
|
| 4076 |
// instantiate the perspective |
| 4077 |
IPerspectiveFactory factory = ((PerspectiveDescriptor) perspective).createFactory(); |
| 4078 |
ModeledPageLayout modelLayout = new ModeledPageLayout(window, modelService, |
| 4079 |
partService, modelPerspective, perspective, this, true); |
| 4080 |
factory.createInitialLayout(modelLayout); |
| 4081 |
PerspectiveTagger.tagPerspective(modelPerspective, modelService); |
| 4082 |
PerspectiveExtensionReader reader = new PerspectiveExtensionReader(); |
| 4083 |
reader.extendLayout(getExtensionTracker(), perspective.getId(), modelLayout); |
| 4084 |
return modelPerspective; |
| 4085 |
} |
| 4086 |
|
| 4079 |
void perspectiveActionSetChanged(Perspective perspective, IActionSetDescriptor descriptor, |
4087 |
void perspectiveActionSetChanged(Perspective perspective, IActionSetDescriptor descriptor, |
| 4080 |
int changeType) { |
4088 |
int changeType) { |
| 4081 |
if (perspective == getActivePerspective()) { |
4089 |
if (perspective == getActivePerspective()) { |