use of com.liferay.ide.portlet.ui.navigator.PortletsNode in project liferay-ide by liferay.
the class NewPortletAction method run.
/**
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
public void run() {
if (isEnabled()) {
if (selectedNode instanceof PortletsNode) {
PortletsNode portletsNode = (PortletsNode) selectedNode;
IProject currentProject = portletsNode.getParent().getProject();
NewPortletWizard newPortletWizard = new NewPortletWizard(currentProject);
WizardDialog wizardDialog = new WizardDialog(Display.getDefault().getActiveShell(), newPortletWizard);
wizardDialog.create();
wizardDialog.open();
}
}
}
use of com.liferay.ide.portlet.ui.navigator.PortletsNode in project liferay-ide by liferay.
the class OpenPortletResourceAction method initEditorPart.
protected IFile initEditorPart() {
IFile file = null;
if (selectedNode instanceof PortletsNode) {
PortletsNode portletsNode = (PortletsNode) selectedNode;
PortletResourcesRootNode rootNode = portletsNode.getParent();
file = ProjectUtil.getPortletXmlFile(rootNode.getProject());
} else if (selectedNode instanceof PortletNode) {
PortletNode portletNode = (PortletNode) selectedNode;
PortletResourcesRootNode rootNode = portletNode.getParent().getParent();
file = ProjectUtil.getPortletXmlFile(rootNode.getProject());
}
if ((editorPart == null) && (file != null)) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorReference[] editorReferences = page.getEditorReferences();
for (IEditorReference iEditorReference : editorReferences) {
if (file.getName().equals(iEditorReference.getName())) {
editorPart = iEditorReference.getEditor(false);
}
}
}
return file;
}
Aggregations