use of org.eclipse.wst.web.internal.DelegateConfigurationElement in project webtools.sourceediting by eclipse.
the class NewProjectDataModelFacetWizard method postPerformFinish.
/**
* <p>
* Invoked after the user has clicked the "Finish" button of the wizard. The default
* implementation will attempt to update the final perspective to the value specified by
* { @link #getFinalPerspectiveID() }
* </p>
*
* @throws InvocationTargetException
*
* @see org.eclipse.wst.common.frameworks.internal.ui.wizard.WTPWizard#postPerformFinish()
*/
protected void postPerformFinish() throws InvocationTargetException {
String projName = getProjectName();
IProject newProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
IWorkbench workbench = WSTWebUIPlugin.getDefault().getWorkbench();
// add to the selected working sets
if (newProject != null && beginingPages != null && beginingPages.length > 0 && beginingPages[0] instanceof DataModelFacetCreationWizardPage) {
DataModelFacetCreationWizardPage mainPage = (DataModelFacetCreationWizardPage) beginingPages[0];
IWorkingSet[] workingSets = mainPage.getSelectedWorkingSets();
workbench.getWorkingSetManager().addToWorkingSets(newProject, workingSets);
}
// open the "final" perspective
if (getFinalPerspectiveID() != null && getFinalPerspectiveID().length() > 0) {
final IConfigurationElement element = new DelegateConfigurationElement(configurationElement) {
@Override
public String getAttribute(String aName) {
if (aName.equals("finalPerspective")) {
// $NON-NLS-1$
return getFinalPerspectiveID();
}
return super.getAttribute(aName);
}
};
BasicNewProjectResourceWizard.updatePerspective(element);
} else
BasicNewProjectResourceWizard.updatePerspective(configurationElement);
// select and reveal
BasicNewResourceWizard.selectAndReveal(newProject, workbench.getActiveWorkbenchWindow());
}
use of org.eclipse.wst.web.internal.DelegateConfigurationElement in project liferay-ide by liferay.
the class BaseProjectWizard method openLiferayPerspective.
protected void openLiferayPerspective(IProject newProject) {
final IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
IPerspectiveDescriptor perspective = activePage.getPerspective();
if (perspective.getId().equals(LiferayWorkspacePerspectiveFactory.ID)) {
return;
}
// open the "final" perspective
final IConfigurationElement element = new DelegateConfigurationElement(null) {
@Override
public String getAttribute(String aName) {
if (aName.equals("finalPerspective")) {
return LiferayWorkspacePerspectiveFactory.ID;
}
return super.getAttribute(aName);
}
};
BasicNewProjectResourceWizard.updatePerspective(element);
// select and reveal
BasicNewResourceWizard.selectAndReveal(newProject, workbench.getActiveWorkbenchWindow());
}
use of org.eclipse.wst.web.internal.DelegateConfigurationElement in project liferay-ide by liferay.
the class NewLiferayPluginProjectWizard method openLiferayPerspective.
@Override
protected void openLiferayPerspective(IProject newProject) {
final IWorkbench workbench = PlatformUI.getWorkbench();
// open the "final" perspective
final IConfigurationElement element = new DelegateConfigurationElement(null) {
@Override
public String getAttribute(String aName) {
if (aName.equals("finalPerspective")) {
return LiferayPerspectiveFactory.ID;
}
return super.getAttribute(aName);
}
};
BasicNewProjectResourceWizard.updatePerspective(element);
// select and reveal
BasicNewResourceWizard.selectAndReveal(newProject, workbench.getActiveWorkbenchWindow());
}
Aggregations