Examples of ConfigGroup


Examples of org.apache.uima.taeconfigurator.model.ConfigGroup

   * @param existing -
   *          null or an existing tree item being edited
   */
  private boolean addNewOrEditExistingGroup(String names, TreeItem existing) {
    valueChanged = true; // preset
    ConfigGroup mcg = null;
    String[] oldGroupNames = stringArray0;
    String[] newGroupNames = groupNamesToArray(names);
    String[] groupNamesToAdd;
    String[] groupNamesToDrop = stringArray0;

    if (null != existing) {
      mcg = getCorrespondingModelGroup(existing);
      oldGroupNames = mcg.getNameArray();

      groupNamesToDrop = setDiff(oldGroupNames, newGroupNames);
      groupNamesToAdd = setDiff(newGroupNames, oldGroupNames);
    } else {
      groupNamesToAdd = newGroupNames;
    }

    // it is legal to define a group name more than once, but the same set of group names
    // shouldn't be defined more than once
    if (groupNameAlreadyDefined(newGroupNames)) {
      Utility.popMessage("Group Already Defined",
              "This set of group names has already been defined." + "\n\nGroup: " + names,
              MessageDialog.ERROR);
      return false;
    }

    TreeItem item;
    if (existing == null) {
      ConfigurationGroup cg = new ConfigurationGroup_impl();
      cg.setConfigurationParameters(configurationParameterArray0);
      cg.setNames(groupNamesToArray(names));
      item = addGroupToGUI(names, cg);
      addGroupToModel(cg);
    } else { // editing existing group
      valueChanged = groupNamesToDrop.length != 0 || groupNamesToAdd.length != 0;
      item = existing;
      setGroupText(item, names);

      for (int i = 0; i < groupNamesToDrop.length; i++) {
        removeIncludedParmSettingsFromSingleGroup(groupNamesToDrop[i], mcg.getConfigParms());
      }
      mcg.setNameArray(groupNamesToArray(names));
      if (null != settings) {
        for (int i = 0; i < groupNamesToAdd.length; i++) {
          TreeItem settingsItem = getSettingsTreeGroup(groupNamesToAdd[i]);
          if (null == settingsItem) {
            settingsItem = new TreeItem(settingsTree, SWT.NONE);
            setGroupText(settingsItem, groupNamesToAdd[i]);
            settingsItem.setData(null);
            fill(mcg.getConfigParms(), settingsItem);
            fill(commonParms, settingsItem);
          } else {
            fillInFrontOfCommon(mcg.getConfigParms(), settingsItem);
          }
        }
      }

    }
View Full Code Here

Examples of org.apache.uima.taeconfigurator.model.ConfigGroup

  }

  protected TreeItem addGroupToGUI(String names, ConfigurationGroup cg) {
    TreeItem groupItem = new TreeItem(tree, SWT.NONE);
    setGroupText(groupItem, names);
    ConfigGroup mcg;
    if (names.equals(COMMON_GROUP))
      mcg = new ConfigGroup(cpd, ConfigGroup.COMMON);
    else if (names.equals(NOT_IN_ANY_GROUP))
      mcg = new ConfigGroup(cpd, ConfigGroup.NOT_IN_ANY_GROUP);
    else
      mcg = new ConfigGroup(cpd, cg);
    groupItem.setData(mcg);
    String[] nameArray = groupNamesToArray(names);
    if (null != settingsTree) {
      for (int i = 0; i < nameArray.length; i++) {
        TreeItem[] settingsItems = settingsTree.getItems();
View Full Code Here

Examples of org.apache.uima.taeconfigurator.model.ConfigGroup

    // cpd1 = ((CasConsumerDescription)delegate)
    // .getMetaData().getConfigurationParameterDeclarations();
    // else
    // throw new InternalErrorCDE("Invalid state");

    ConfigGroup noGroup = new ConfigGroup(cpd1, ConfigGroup.NOT_IN_ANY_GROUP);
    ConfigGroup commonGroup = new ConfigGroup(cpd1, ConfigGroup.COMMON);

    addDelegateGroupToGUI(parent, noGroup);
    addDelegateGroupToGUI(parent, commonGroup);
    ConfigurationGroup[] cgs = cpd1.getConfigurationGroups();
    if (cgs != null) {
      for (int i = 0; i < cgs.length; i++) {
        addDelegateGroupToGUI(parent, new ConfigGroup(cpd1, cgs[i]));
      }
    }
  }
View Full Code Here

Examples of org.apache.uima.taeconfigurator.model.ConfigGroup

    }
  }

  private void addNewParameter(ConfigurationParameter parm, ConfigGroup delegateGroup, String key) {

    ConfigGroup group = getCorrespondingModelGroup(delegateGroup);

    if (null == group) {
      group = parmSection.addGroup(delegateGroup);
    }
    ConfigurationParameter parmInGroup;
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

        }
    }

    private ConfigGroup getGlobalConfiguration() {
        //Global Configurations used by many of Drools Workbench editors
        final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.GLOBAL,
                                                                       GLOBAL_SETTINGS,
                                                                       "" );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.dateformat",
                                                                 "dd-MMM-yyyy" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.datetimeformat",
                                                                 "dd-MMM-yyyy hh:mm:ss" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultlanguage",
                                                                 "en" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultcountry",
                                                                 "US" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "build.enable-incremental",
                                                                 "true" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "rule-modeller-onlyShowDSLStatements",
                                                                 "false" ) );
        return group;
    }
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

        }
    }

    private ConfigGroup getGlobalConfiguration() {
        //Global Configurations used by many of Drools Workbench editors
        final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.GLOBAL,
                                                                       GLOBAL_SETTINGS,
                                                                       "" );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.dateformat",
                                                                 "dd-MMM-yyyy" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.datetimeformat",
                                                                 "dd-MMM-yyyy hh:mm:ss" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultlanguage",
                                                                 "en" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "drools.defaultcountry",
                                                                 "US" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "build.enable-incremental",
                                                                 "true" ) );
        group.addConfigItem( configurationFactory.newConfigItem( "rule-modeller-onlyShowDSLStatements",
                                                                 "false" ) );
        return group;
    }
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

                                                                 "false" ) );
        return group;
    }

    private ConfigGroup getTestScenarioElementDefinitions() {
        final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.EDITOR,
                                                                       ScenarioTestEditorService.TEST_SCENARIO_EDITOR_SETTINGS,
                                                                       "" );

        ConfigItem<Integer> configItem = new ConfigItem<Integer>();
        configItem.setName( ScenarioTestEditorService.TEST_SCENARIO_EDITOR_MAX_RULE_FIRINGS );
        configItem.setValue( 10000 );
        group.addConfigItem( configItem );

        return group;
    }
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

        //   - Underscores ('_') in the key will be converted in whitespaces (' ') and
        //     will be used as Button's labels.
        //   - The value will be the text pasted into the editor when an element in the
        //     palette is selected. You can use a pipe ('|') to specify the place where
        //     the cursor should be put after pasting the element into the editor.
        final ConfigGroup group = configurationFactory.newConfigGroup( ConfigType.EDITOR,
                                                                       WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS,
                                                                       "" );
        group.addConfigItem( configurationFactory.newConfigItem( WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DEFINITION,
                                                                 "import org.drools.core.process.core.datatype.impl.type.StringDataType;\n" +
                                                                         "import org.drools.core.process.core.datatype.impl.type.ObjectDataType;\n" +
                                                                         "\n" +
                                                                         "[\n" +
                                                                         "  [\n" +
                                                                         "    \"name\" : \"MyTask|\", \n" +
                                                                         "    \"parameters\" : [ \n" +
                                                                         "        \"MyFirstParam\" : new StringDataType(), \n" +
                                                                         "        \"MySecondParam\" : new StringDataType(), \n" +
                                                                         "        \"MyThirdParam\" : new ObjectDataType() \n" +
                                                                         "    ], \n" +
                                                                         "    \"results\" : [ \n" +
                                                                         "        \"Result\" : new ObjectDataType(\"java.util.Map\") \n" +
                                                                         "    ], \n" +
                                                                         "    \"displayName\" : \"My Task\", \n" +
                                                                         "    \"icon\" : \"\" \n" +
                                                                         "  ]\n" +
                                                                         "]" ) );
        group.addConfigItem( configurationFactory.newConfigItem( WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_PARAMETER,
                                                                 "\"MyParam|\" : new StringDataType()" ) );
        group.addConfigItem( configurationFactory.newConfigItem( WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_RESULT,
                                                                 "\"Result|\" : new ObjectDataType()" ) );
        group.addConfigItem( configurationFactory.newConfigItem( WorkItemsEditorService.WORK_ITEMS_EDITOR_SETTINGS_DISPLAY_NAME,
                                                                 "\"displayName\" : \"My Task|\"" ) );
        return group;
    }
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

        return project;
    }

    protected void addSecurityRoles( final T project ) {
        //Copy in Security Roles required to access this resource
        final ConfigGroup projectConfiguration = findProjectConfig( project.getRootPath() );
        if ( projectConfiguration != null ) {
            ConfigItem<List<String>> roles = projectConfiguration.getConfigItem( "security:roles" );
            if ( roles != null ) {
                for ( String role : roles.getValue() ) {
                    project.getRoles().add( role );
                }
            }
View Full Code Here

Examples of org.guvnor.structure.server.config.ConfigGroup

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public void addRole( final Project project,
                         final String role ) {
        ConfigGroup thisProjectConfig = findProjectConfig( project.getRootPath() );

        if ( thisProjectConfig == null ) {
            thisProjectConfig = configurationFactory.newConfigGroup( ConfigType.PROJECT,
                                                                     project.getRootPath().toURI(),
                                                                     "Project '" + project.getProjectName() + "' configuration" );
            thisProjectConfig.addConfigItem( configurationFactory.newConfigItem( "security:roles",
                                                                                 new ArrayList<String>() ) );
            configurationService.addConfiguration( thisProjectConfig );
        }

        if ( thisProjectConfig != null ) {
            final ConfigItem<List> roles = thisProjectConfig.getConfigItem( "security:roles" );
            roles.getValue().add( role );

            configurationService.updateConfiguration( thisProjectConfig );

        } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.