Package org.jboss.ide.eclipse.freemarker.configuration

Examples of org.jboss.ide.eclipse.freemarker.configuration.ContextValue


  @Override
  public Class<?> getSingularReturnClass(Class<?> parentClass, List<Fragment> fragments, Map<String, Class<?>> context, IResource resource, IProject project) {
    if (null == singulaReturnClass) {
      String content = getContent();
      if (isStartFragment()) {
        ContextValue contextValue = ConfigurationManager.getInstance(project).getContextValue(content, resource, true);
        if (null == contextValue || null == contextValue.singularClass)
          singulaReturnClass = Object.class;
        else
          singulaReturnClass = contextValue.singularClass;
      }
View Full Code Here


        public void doWork() {
            int index = contextValuesTable.getSelectionIndex();
            if (index >= 0) {
                String key = contextValuesTable.getSelection()[0].getText(0);
                ContextValue value = ConfigurationManager.getInstance(getResource().getProject()).getContextValue(key,
                        getResource(), false);
                ContextValueDialog dialog = new ContextValueDialog(new Shell(),
                        value, getResource());
                if (IDialogConstants.OK_ID == dialog.open()) {
                    reloadContextValues();
View Full Code Here

                            .openConfirm(new Shell(), Messages.ContextProperties_ConfirmationTitle,
                                    Messages.ContextProperties_DeleteValueConfirmation);
                    if (confirm) {
                        String key = contextValuesTable.getSelection()[0]
                                .getText(0);
                        ContextValue value = ConfigurationManager.getInstance(getResource().getProject())
                                .getContextValue(key, getResource(), false);
                        ConfigurationManager.getInstance(getResource().getProject()).removeContextValue(value.name,
                                getResource());
                        reloadContextValues();
                    }
View Full Code Here

        if (className.length() == 0) MessageDialog.openError(getShell(), Messages.ContextValueDialog_ERROR, Messages.ContextValueDialog_MUST_CHOOSE_CLASS);
        String singularClassName = singleValueText.getText().trim();
        Class<?> singularClass = null;
        if (null != singularClassName && singularClassName.trim().length() > 0) singularClass = ConfigurationManager.getInstance(resource.getProject()).getClass(singularClassName);
        if (className.length() == 0) singularClassName = null;
          contextValue = new ContextValue(
                  name,
                  ConfigurationManager.getInstance(resource.getProject()).getClass(className),
                  singularClass);
          ConfigurationManager.getInstance(resource.getProject()).addContextValue(contextValue, resource);
      }
View Full Code Here

            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

    public void doWork() {
      int index = contextValuesTable.getSelectionIndex();
      if (index >= 0) {
        String key = contextValuesTable.getSelection()[0].getText(0);
        ContextValue value = ConfigurationManager.getInstance(vEditor.getFile().getProject()).getContextValue(key, vEditor.getFile(), false);
        ContextValueDialog dialog = new ContextValueDialog(new Shell(), value, vEditor.getFile());
        if (IDialogConstants.OK_ID == dialog.open()) {
          reloadContextValues();
        }
      }
View Full Code Here

      if (index >= 0) {
        try {
          boolean confirm = MessageDialog.openConfirm(new Shell(), Messages.FreemarkerMultiPageEditor_CONFIRMATION_TITLE, Messages.FreemarkerMultiPageEditor_CONFIRMATION_TO_DELETE_MESSAGE);
          if (confirm) {
            String key = contextValuesTable.getSelection()[0].getText(0);
            ContextValue value = ConfigurationManager.getInstance(vEditor.getFile().getProject()).getContextValue(key, vEditor.getFile(), false);
            ConfigurationManager.getInstance(vEditor.getFile().getProject()).removeContextValue(value.name, vEditor.getFile());
            reloadContextValues();
          }
        }
        catch (Exception e1) {
View Full Code Here

TOP

Related Classes of org.jboss.ide.eclipse.freemarker.configuration.ContextValue

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.