use of org.eclipse.sapphire.java.JavaTypeName in project liferay-ide by liferay.
the class ServiceImplJavaTypeConstraintService method _getServiceTypes.
private Set<String> _getServiceTypes() {
JavaTypeName type = _service.getServiceType().content(false);
Set<String> types = new HashSet<>();
if (type != null) {
types.add(type.qualified() + "Wrapper");
}
return types;
}
use of org.eclipse.sapphire.java.JavaTypeName in project liferay-ide by liferay.
the class ServiceTypeImplBrowseActionHandler method _getServiceType.
private String _getServiceType(Element element) {
String retval = null;
ServiceWrapper service = element.nearest(ServiceWrapper.class);
JavaTypeName javaTypeName = service.getServiceType().content(false);
if (javaTypeName != null) {
retval = javaTypeName.qualified();
}
return retval;
}
use of org.eclipse.sapphire.java.JavaTypeName in project liferay-ide by liferay.
the class OpenPortletResourceAction method openPortletJavaClass.
/**
* @param file
*/
protected void openPortletJavaClass(IFile file) {
Element modelElement = ((PortletNode) selectedNode).getModel();
if (modelElement instanceof Portlet) {
Portlet portlet = (Portlet) modelElement;
JavaTypeName portletClassFile = portlet.getPortletClass().content();
Runnable run = new Runnable() {
public void run() {
IJavaProject project = JavaCore.create(file.getProject());
String fullyQualifiedName = portletClassFile.qualified();
try {
IType type = project.findType(fullyQualifiedName);
if ((type != null) && type.exists()) {
IResource resource = type.getResource();
if (resource instanceof IFile) {
IFile javaFile = (IFile) resource;
IEditorDescriptor editorDescriptor = findEditor(javaFile);
IEditorPart editorPart = null;
if (editorDescriptor != null) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
try {
editorPart = page.findEditor(new FileEditorInput(javaFile));
if (editorPart == null) {
editorPart = page.openEditor(new FileEditorInput(javaFile), editorDescriptor.getId());
}
} catch (Exception e) {
MessageDialog.openError(page.getWorkbenchWindow().getShell(), Msgs.errorOpeningFile, e.getMessage());
}
}
}
}
} catch (JavaModelException jme) {
PortletUIPlugin.logError(jme);
}
}
};
Display.getDefault().asyncExec(run);
}
}
Aggregations