modelElement = meInput.getModelElement();
//project = modelElement.getProject();
projectSpace = WorkspaceManager.getProjectSpace(modelElement);
project = projectSpace.getProject();
initializeEditingDomain();
ModelElementChangeObserver modelelementChangeObserver = new ModelElementChangeObserver()
{
@Override
protected void onNotify(Notification notification, EObject element)
{
updateIcon();
updateTitle();
}
@Override
protected void onElementDeleted(EObject element)
{
if (element == modelElement)
{
close(false);
project.removeIdEObjectCollectionChangeObserver(this);
}
}
/*
@Override
public void projectDeleted(IdEObjectCollection project)
{
// TODO Auto-generated method stub
System.out.println("call: projectDeleted");
}
*/
@Override
public void notify(Notification notification, IdEObjectCollection project, EObject modelElement)
{
// TODO Auto-generated method stub
System.out.println("call: notify");
}
@Override
public void modelElementAdded(IdEObjectCollection project, EObject modelElement)
{
// TODO Auto-generated method stub
System.out.println("call: modelElementAdded");
}
@Override
public void modelElementRemoved(IdEObjectCollection project, EObject modelElement)
{
// TODO Auto-generated method stub
System.out.println("call: modelElementRemoved");
}
};
initStatusProvider();
updateTitle();
updateIcon();
ILabelProviderListener labelProviderListener = new ILabelProviderListener()
{
public void labelProviderChanged(LabelProviderChangedEvent event)
{
updateIcon();
}
};
meInput.getLabelProvider().addListener(labelProviderListener);
modelelementChangeObserver.observeElement(modelElement);
project.addIdEObjectCollectionChangeObserver(modelelementChangeObserver);
}
else
{