Package org.cfeclipse.cfml.views.packageview.objects

Examples of org.cfeclipse.cfml.views.packageview.objects.FunctionNode


        funcCreateObject = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                FunctionNode obj = (FunctionNode) ((IStructuredSelection) selection).getFirstElement();
                insert(obj.getCreateObjectSnippet());
            }
        };
        funcCreateObject.setText("Insert CreateObject");
        funcCreateObject.setToolTipText("Inserts CreateObject code");

        funcInvokeObject = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                FunctionNode obj = (FunctionNode) ((IStructuredSelection) selection).getFirstElement();
                insert(obj.getInvokeSnippet());
            }
        };
        funcInvokeObject.setText("Insert Invoke");
        funcInvokeObject.setToolTipText("Inserts cfinvoke code");

        getFunctionDetails = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                FunctionNode obj = (FunctionNode) ((IStructuredSelection) selection).getFirstElement();
                showMessage(obj.getDetails());

            }
        };
        getFunctionDetails.setText("Get Details");

        getComponentDetails = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                ComponentNode obj = (ComponentNode) ((IStructuredSelection) selection).getFirstElement();
                showMessage(obj.getDetails());
            }
        };
        getComponentDetails.setText("Get Details");

        getDescription = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                ComponentNode obj = (ComponentNode) ((IStructuredSelection) selection).getFirstElement();
                //showMessage(obj.getDetails());
                CFMLPropertyManager propMan = new CFMLPropertyManager();

                try
                {
                    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
                    BrowserView browser = (BrowserView) page.showView(BrowserView.ID_BROWSER);
                    String rootURL = propMan.defaultProjectURL();

                    URL projURL = new URL(rootURL);

                    //todo
                    //browser.setUrl("http://" + projURL.getHost() + "/CFIDE/componentutils/cfcexplorer.cfc?METHOD=getcfcinhtml&NAME=" + obj.getPackageName());
                    //browser.setFocus();
                }
                catch (PartInitException e)
                {
                    e.printStackTrace();
                }
                catch (MalformedURLException mue)
                {
                    mue.printStackTrace();
                }

            }
        };
        getDescription.setText("Get Description");

        /*
        action1 = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                FunctionNode obj = (FunctionNode) ((IStructuredSelection) selection).getFirstElement();
                showMessage(obj.getCreateObjectSnippet());
            }
        };
        action1.setText("Insert CreateObject");
        action1.setToolTipText("Inserts CreateObject code");
        action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
        */

        doubleClickAction = new Action()
        {
            public void run()
            {
                ISelection selection = viewer.getSelection();
                Object obj = ((IStructuredSelection) selection).getFirstElement();

                if (obj instanceof ComponentNode)
                {
                    ComponentNode component = (ComponentNode) obj;
                    GenericOpenFileAction openAction = new GenericOpenFileAction(component.getFile());
                    openAction.run();
                }
                else if (obj instanceof FunctionNode)
                {
                    FunctionNode fnode = (FunctionNode) obj;
                    insert(fnode.getInvokeSnippet());
                }
                else {
                  viewer.expandToLevel(obj, 1);
                }

View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.views.packageview.objects.FunctionNode

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.