Package org.jboss.ide.eclipse.freemarker.model

Examples of org.jboss.ide.eclipse.freemarker.model.Interpolation


    @Override
    public void runWithEvent(Event event) {
      Tree tree = getTreeViewer().getTree();
      TreeItem[] items = tree.getSelection();
      Interpolation interpolation = null;
      for (int i=0; i<items.length; i++) {
        TreeItem item = items[i];
        if (item.getData() instanceof Interpolation) {
          interpolation = (Interpolation) item.getData();
          try {
            SelectionDialog sd = JavaUI.createTypeDialog(new Shell(), null, SearchEngine.createWorkspaceScope(),
                IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES, false);
            sd.open();
            Object[] objects = sd.getResult();
            if (null != objects && objects.length > 0) {
              ConfigurationManager configuration = ConfigurationManager.getInstance(interpolation.getResource().getProject());
              IType type = (IType) objects[0];
              try {
                configuration.addContextValue(
                    new ContextValue(interpolation.getFirstToken(),
                        configuration.getClass(type.getFullyQualifiedName()), null), interpolation.getResource());
              }
              catch (ClassNotFoundException e) {
                Plugin.log(e);
              }
            }
View Full Code Here

TOP

Related Classes of org.jboss.ide.eclipse.freemarker.model.Interpolation

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.