List of usage examples for org.eclipse.jdt.core Flags AccDefault
int AccDefault
To view the source code for org.eclipse.jdt.core Flags AccDefault.
Click Source Link
From source file:ar.com.comunidadesfera.observatorio.jdt.PaginaAsistenteCrearClaseJava.java
License:Open Source License
@Override public int getModifiers() { /* sin utilizar modificadores de acceso se minimiza la definicin de la clase */ return Flags.AccDefault; }
From source file:ca.uvic.chisel.javasketch.ui.internal.presentation.TraceThreadLabelProvider.java
License:Open Source License
@Override public Color getBackground(Object element) { if (element instanceof IActivation) { try {/*ww w.j ava 2 s . c o m*/ IJavaElement je = JavaSearchUtils.findElement((IActivation) element, new NullProgressMonitor()); if (je instanceof IMethod) { IMethod method = (IMethod) je; int flags = method.getFlags(); if ((flags & Flags.AccPrivate) != 0) { return ISketchColorConstants.PRIVATE_BG; } else if ((flags & Flags.AccProtected) != 0) { return ISketchColorConstants.PROTECTED_BG; } else if ((flags & Flags.AccDefault) != 0) { return ISketchColorConstants.FRIEND_BG; } else if ((flags & Flags.AccPublic) != 0) { return ISketchColorConstants.PUBLIC_BG; } } } catch (JavaModelException e) { } catch (InterruptedException e) { } catch (CoreException e) { } catch (Exception e) { } } else if (element instanceof String) { return ISketchColorConstants.PACKAGE; } return null; }
From source file:ca.uvic.chisel.javasketch.ui.internal.presentation.TraceThreadLabelProvider.java
License:Open Source License
@Override public Color getForeground(Object element) { IPreferenceStore store = SketchPlugin.getDefault().getPreferenceStore(); boolean recon = store.getBoolean(ISketchPluginPreferences.DIAGRAM_RECONNAISSANCE); if (recon) {/*from w w w . j a va 2 s .c om*/ if (SketchPlugin.getDefault().getDOI().getInterest(element) < .3) { return PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_GRAY); } } if (element instanceof IActivation) { try { IJavaElement je = JavaSearchUtils.findElement((IActivation) element, new NullProgressMonitor()); if (je instanceof IMethod) { IMethod method = (IMethod) je; int flags = method.getFlags(); if ((flags & Flags.AccPrivate) != 0) { return ISketchColorConstants.PRIVATE_FG; } else if ((flags & Flags.AccProtected) != 0) { return ISketchColorConstants.PROTECTED_FG; } else if ((flags & Flags.AccDefault) != 0) { return ISketchColorConstants.FRIEND_FG; } else { return ISketchColorConstants.PUBLIC_FG; } } } catch (JavaModelException e) { } catch (InterruptedException e) { } catch (CoreException e) { } catch (Exception e) { } } else if (element instanceof IThrow) { return PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_RED); } else if (element instanceof IMessage) { return PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_BLACK); } return null; }
From source file:com.salesforce.ide.ui.editors.internal.apex.completions.ApexSystemInstanceMembersProcessorForFields.java
License:Open Source License
public Image getFieldImage() { int accessorFlags_JVM = Flags.AccDefault; int accessorFlags_JDT = JavaElementImageDescriptor.FINAL; ImageDescriptor desc = JavaElementImageProvider.getFieldImageDescriptor(false, accessorFlags_JVM); ApexElementImageDescriptor decoratedDesc = new ApexElementImageDescriptor(desc, accessorFlags_JDT, APEX_ICON_SIZE);//from w ww .ja va 2 s. c o m return ForceImages.get(ForceImages.JDT_FIELD, accessorFlags_JVM, decoratedDesc); }
From source file:com.salesforce.ide.ui.editors.internal.apex.completions.ApexSystemInstanceMembersProcessorForLocals.java
License:Open Source License
public Image getLocalsImage() { int accessorFlags_JVM = Flags.AccDefault; int accessorFlags_JDT = 0; ImageDescriptor desc = JavaElementImageProvider.getFieldImageDescriptor(false, accessorFlags_JVM); ApexElementImageDescriptor decoratedDesc = new ApexElementImageDescriptor(desc, accessorFlags_JDT, APEX_ICON_SIZE);//from w w w. j a v a 2 s. c o m return ForceImages.get(ForceImages.JDT_LOCAL_VAR, accessorFlags_JVM, decoratedDesc); }
From source file:com.sun.codemodel.ClassGenerator.java
License:Apache License
private void modifyObjectFactory(ElementClass ec, IProgressMonitor pm) throws JavaModelException { JDefinedClass c = ec.getjDefClass(); if (ec.getElementType() != null) { IPackageFragmentRoot pfr = project.getPackageFragmentRoot(generated); if (pfr != null && pfr.exists()) { IPackageFragment pf = pfr.getPackageFragment(c.getPackage().name()); if (pf != null && pf.exists()) { ICompilationUnit of = pf.getCompilationUnit("ObjectFactory.java"); if (of != null && !of.exists()) { of = pf.createCompilationUnit("ObjectFactory.java", "", true, pm); of.createPackageDeclaration(c.getPackage().name(), pm); of.createImport("javax.xml.bind.annotation.XmlRegistry", null, Flags.AccDefault, pm); String lineDelimiter = StubUtility.getLineDelimiterUsed(project); IType t = of.createType(generateObjectFactory(lineDelimiter), null, false, pm); t.createMethod("public ObjectFactory(){}" + lineDelimiter, null, false, pm); }// w w w .j a v a2 s .c o m of = addClass(ec, of, pm); } else throw new JavaModelException( new Exception("Error package " + c.getPackage().name() + " does not exists"), JavaModelStatus.ERROR); } else throw new JavaModelException( new Exception("Error package root " + generated.getName() + " does not exists"), JavaModelStatus.ERROR); } }
From source file:com.sun.codemodel.ClassGenerator.java
License:Apache License
private ICompilationUnit addClass(ElementClass ec, ICompilationUnit of, IProgressMonitor pm) throws JavaModelException { JDefinedClass c = ec.getjDefClass(); IImportDeclaration imp = of.getImport("javax.xml.namespace.QName"); if (imp == null || (!imp.exists())) { of.createImport("javax.xml.namespace.QName", null, Flags.AccDefault, pm); }/*w w w.j ava2 s. c om*/ imp = of.getImport("javax.xml.bind.annotation.XmlElementDecl"); if (imp == null || (!imp.exists())) { of.createImport("javax.xml.bind.annotation.XmlElementDecl", null, Flags.AccDefault, pm); } imp = of.getImport("javax.xml.bind.JAXBElement"); if (imp == null || (!imp.exists())) { of.createImport("javax.xml.bind.JAXBElement", null, Flags.AccDefault, pm); } IType t = of.getType("ObjectFactory"); if (t != null && t.exists()) { String lineDelimiter = StubUtility.getLineDelimiterUsed(project); t.createField("private final static QName _" + c.name() + "_QNAME= new QName(\"" + ec.getElementType().getNamespaceURI() + "\", \"" + ec.getElementType().getLocalPart() + "\");" + lineDelimiter, null, false, pm); t.createMethod(generateFirstMethod(c, lineDelimiter), null, false, pm); t.createMethod(generateSecondMethod(ec, lineDelimiter), null, false, pm); } else throw new JavaModelException( new Exception("Error ObjectFactory class does not exists in compilation unit"), JavaModelStatus.ERROR); return of; }
From source file:de.ovgu.featureide.core.CorePlugin.java
License:Open Source License
private int getFlagOfSignature(AbstractSignature element) { if (element instanceof AbstractMethodSignature) { //TODO add constructor icon switch (((AbstractMethodSignature) element).getVisibilty()) { case AbstractSignature.VISIBILITY_DEFAULT: return Flags.AccDefault; case AbstractSignature.VISIBILITY_PRIVATE: return Flags.AccPrivate; case AbstractSignature.VISIBILITY_PROTECTED: return Flags.AccProtected; case AbstractSignature.VISIBILITY_PUBLIC: return Flags.AccPublic; }//w ww . j a v a 2s. c o m } else if (element instanceof AbstractFieldSignature) { switch (((AbstractFieldSignature) element).getVisibilty()) { case AbstractSignature.VISIBILITY_DEFAULT: return Flags.AccDefault; case AbstractSignature.VISIBILITY_PRIVATE: return Flags.AccPrivate; case AbstractSignature.VISIBILITY_PROTECTED: return Flags.AccProtected; case AbstractSignature.VISIBILITY_PUBLIC: return Flags.AccPublic; } } return 0; }
From source file:es.bsc.servicess.ide.model.MethodCoreElement.java
License:Apache License
@Override protected String[] generateParametersAnnotations(IType t, String[] parameterTypes, String[] parameterNames, String[] currentParamAnnotations, IProgressMonitor arg0) throws JavaModelException { String[] paramAnnotations = null; if (parameterNames != null) { if (parameterNames.length == getParameters().size()) { String[] paramDir = new String[getParameters().size()]; for (int i = 0; i < getParameters().size(); i++) { CoreElementParameter p = (CoreElementParameter) getParameters().get(i); paramDir[i] = p.getDirection(); }/* ww w. j a v a 2 s . co m*/ if (t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Parameter") == null) { t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Parameter", null, Flags.AccDefault, arg0); t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Parameter.*", null, Flags.AccDefault, arg0); } else if (!t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Parameter") .exists()) { t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Parameter", null, Flags.AccDefault, arg0); t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Parameter.*", null, Flags.AccDefault, arg0); } else { log.debug("Parameter already exists in the import container"); } paramAnnotations = new String[parameterNames.length]; if (currentParamAnnotations == null) { for (int i = 0; i < parameterNames.length; i++) { if (parameterTypes[i].startsWith("Type.")) { paramAnnotations[i] = "@Parameter(type = " + parameterTypes[i] + ", direction = Direction." + paramDir[i] + ") "; } else { paramAnnotations[i] = "@Parameter(direction = Direction." + paramDir[i] + ") "; } } } else if (currentParamAnnotations.length == parameterNames.length) { for (int i = 0; i < parameterNames.length; i++) { if (parameterTypes[i].startsWith("Type.")) { paramAnnotations[i] = "@Parameter(type = " + parameterTypes[i] + ", direction = Direction." + paramDir[i] + ") " + currentParamAnnotations[i]; } else { paramAnnotations[i] = "@Parameter(direction = Direction." + paramDir[i] + ") " + currentParamAnnotations[i]; } } } else throw new JavaModelException( new Exception("Method number of annotions and names are different"), IJavaModelStatus.ERROR); } else throw new JavaModelException(new Exception("Method number of directions and names are different"), IJavaModelStatus.ERROR); } return paramAnnotations; }
From source file:es.bsc.servicess.ide.model.MethodCoreElement.java
License:Apache License
@Override protected String generateAnnotations(IType t, IProgressMonitor arg0) throws JavaModelException { @SuppressWarnings("restriction") String lineDelimiter = StubUtility.getLineDelimiterUsed(t.getJavaProject()); String str = new String(); if (this.getConstraints().size() > 0) { if (t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Constraints") == null) { t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Constraints", null, Flags.AccDefault, arg0); } else if (!t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Constraints") .exists()) {// ww w. j a va 2 s. c o m t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Constraints", null, Flags.AccDefault, arg0); } else { log.debug("Orchestration already exists in the import container"); } str = str.concat("@Constraints"); boolean first = true; for (Entry<String, String> e : this.getConstraints().entrySet()) { if (first) { str = str.concat("(" + e.getKey() + " = " + ConstraintsUtils.convertValueToAnnotationString(e.getKey(), e.getValue())); first = false; } else { str = str.concat(", " + e.getKey() + " = " + ConstraintsUtils.convertValueToAnnotationString(e.getKey(), e.getValue())); } } str = str.concat(")" + lineDelimiter); } if (t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Method") == null) { t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Method", null, Flags.AccDefault, arg0); } else if (!t.getCompilationUnit().getImport("integratedtoolkit.types.annotations.Method").exists()) { t.getCompilationUnit().createImport("integratedtoolkit.types.annotations.Method", null, Flags.AccDefault, arg0); } else { log.debug("Method already exists in the import container"); } str = str.concat("@Method(declaringClass = \"" + declaringClass + "\", isModifier = " + modifier + ", isInit = " + init + ")" + lineDelimiter); return str; }