Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IType


     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
     */
    public void run(IAction action) {
        IStructuredSelection structured = (IStructuredSelection) selection;
        Object element = structured.getFirstElement();
        IType type = null;
        if (element instanceof IType) {
            type = (IType) element;
        } else if (element instanceof ICompilationUnit) {
            type = ((ICompilationUnit) element).findPrimaryType();
            if (type == null) {
View Full Code Here


        setTitle("Exception Cut Customization");
        setDescription("Select an optional target exception that must match.");

        fTargetExceptionDialogField = new StringButtonDialogField(new IStringButtonAdapter() {
            public void changeControlPressed(DialogField field) {
                IType type = chooseTargetException();
                if (type != null) {
                  fTargetExceptionDialogField.setText(JavaModelUtil.getFullyQualifiedName(type));
                }
            }
        });
View Full Code Here

    /* (non-Javadoc)
     * @see ch.ethz.prose.eclipse.internal.wizards.NewCrosscutWizardPage#writeAdviceSignature(ch.ethz.prose.eclipse.internal.wizards.ImportsManager, java.lang.StringBuffer)
     */
    public void writeAdviceSignature(ImportsManager imports, StringBuffer source) {
        IType targetException = getTargetException();
        String targetClassName = getTargetExceptionName();
        if (targetException != null) {
            imports.addImport(targetException.getFullyQualifiedName());
            source.append(targetException.getElementName());
        } else if (targetClassName.length() != 0) {
            source.append(targetClassName);
        } else {
            return;
        }
View Full Code Here

            status.setError("Target exception name is not valid.");
            return status;
        }
        if (root != null) {
            try {
                IType type = resolveClassName(root.getJavaProject(), targetClassName);
                if (type == null) {
                    status.setWarning("Target exception does not exist in current project.");
                    return status;
                }
                // TODO Check if exception is subclass of Throwable
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.swt.dnd.DropTargetListener#drop(org.eclipse.swt.dnd.DropTargetEvent)
     */
    public void drop(DropTargetEvent event) {
        IType type = null;
        AspectManagerNode targetManager = (AspectManagerNode) getTarget(event);
        Object source = SelectionUtil.getSingleElement(LocalSelectionTransfer.getInstance().getSelection());
        if (source instanceof AspectNode) {
            AspectNode aspect = (AspectNode) source;

View Full Code Here

        classToDecompiled = new WeakHashMap();
        DebugContextManager.getDefault().addDebugContextListener(this);
    }

    public char[] getSource(IClassFile classFile, BitSet decompilerFlags) {
        IType type;
        type = classFile.getType();
        if (type == null || !type.isBinary()) {
            return null;
        }
        IBinaryType info = null;
        try {
            info = (IBinaryType) ((BinaryType) type).getElementInfo();
View Full Code Here

        /*
         * the check if we changed from inner class to outer class or vice versa
         */
        if (lastChildElement != null && childEl != null) {
            IType newEnclosingType = JdtUtils.getEnclosingType(childEl);
            IType oldEnclosingType = JdtUtils
                .getEnclosingType(lastChildElement);
            return newEnclosingType == null
                || !newEnclosingType.equals(oldEnclosingType);
        }
        return false;
View Full Code Here

            return sb.append(iMethod.getSignature()).toString();
        }

        // start method parameter descriptions list
        sb.append('(');
        IType declaringType = iMethod.getDeclaringType();
        String[] parameterTypes = iMethod.getParameterTypes();

        /*
         * For non - static inner classes bytecode constructor should contain as first
         * parameter the enclosing type instance, but in Eclipse AST there are no
View Full Code Here

        return Signature.C_RESOLVED + name + Signature.C_SEMICOLON;
    }

    private static void appendGenericType(StringBuffer sb, IMethod iMethod,
        String unresolvedType) throws JavaModelException{
        IType declaringType = iMethod.getDeclaringType();

        // unresolvedType is here like "QA;" => we remove "Q" and ";"
        if(unresolvedType.length() < 3){
            // ???? something wrong here ....
            sb.append(unresolvedType);
            return;
        }
        unresolvedType = unresolvedType.substring(1, unresolvedType.length() - 1);

        ITypeParameter typeParameter = iMethod.getTypeParameter(unresolvedType);
        if(typeParameter == null || !typeParameter.exists()){
            typeParameter = declaringType.getTypeParameter(unresolvedType);
        }

        String[] bounds = typeParameter.getBounds();
        if(bounds.length == 0){
            sb.append("Ljava/lang/Object;");
View Full Code Here

            IClassFile iClass = (IClassFile) input;
            IJavaElement ref = iClass.getElementAt(selection.getOffset());
            if (ref != null) {
                // If we are in the inner class, try to refine search result now
                if(ref instanceof IType){
                    IType type = (IType) ref;
                    IClassFile classFile = type.getClassFile();
                    if(classFile != iClass){
                        /*
                         * WORKAROUND it seems that source range for constructors from
                         * bytecode with source attached from zip files is not computed
                         * in Eclipse (SourceMapper returns nothing useful).
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.