当前位置: 首页>>代码示例>>Java>>正文


Java CompositeAction.getActions方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.action.CompositeAction.getActions方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeAction.getActions方法的具体用法?Java CompositeAction.getActions怎么用?Java CompositeAction.getActions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.action.CompositeAction的用法示例。


在下文中一共展示了CompositeAction.getActions方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CompositeRenditionDefinitionImpl

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
public CompositeRenditionDefinitionImpl(CompositeAction compositeAction)
{
    super(compositeAction, CompositeRenderingEngine.NAME);
    for (Action action : compositeAction.getActions())
    {
        RenditionDefinition subDefinition;
        if (action instanceof CompositeAction)
        {
            CompositeAction compAction = (CompositeAction) action;
            subDefinition = new CompositeRenditionDefinitionImpl(compAction);
        }
        else
        {
            subDefinition = new RenditionDefinitionImpl(action);
        }
        addAction(subDefinition);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:19,代码来源:CompositeRenditionDefinitionImpl.java

示例2: populateActions

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
protected void populateActions(FacesContext context, CompositeAction compositeAction)
{
   // populate the actions list with maps of properties representing each action
   List<Action> actions = compositeAction.getActions();
   for (Action action : actions)
   {
      this.currentActionProperties = new HashMap<String, Serializable>(3);
      this.currentEmailRecipientsDataModel = null;
      this.action = action.getActionDefinitionName();
      this.currentActionProperties.put(PROP_ACTION_NAME, this.action);
      
      IHandler handler = this.actionHandlers.get(this.action);
      if (handler != null)
      {
         // use the handler to populate the properties and summary
         handler.prepareForEdit(this.currentActionProperties, action.getParameterValues());
         this.currentActionProperties.put(PROP_ACTION_SUMMARY, handler.generateSummary(context, this,
               this.currentActionProperties));
      }
      else
      {
         // there's no handler, so we presume it is a no-parameter
         // action, use the action title as the summary
         ActionDefinition actionDef = this.getActionService().getActionDefinition(this.action);
         this.currentActionProperties.put(PROP_ACTION_SUMMARY, actionDef.getTitle());
         // add the no params marker so we can disable the edit action
         this.currentActionProperties.put(NO_PARAMS_MARKER, "no-params");
      }

      // add the populated currentActionProperties to the list
      this.allActionsProperties.add(this.currentActionProperties);
   }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:34,代码来源:EditRuleWizard.java

示例3: testActions

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
public void testActions()
{
    Action action1 = new ActionImpl(null, ACTION1_ID, ACTION1_NAME, null);
    Action action2 = new ActionImpl(null, ACTION2_ID, ACTION2_NAME, null);
    Action action3 = new ActionImpl(null, ACTION3_ID, ACTION3_NAME, null);
    
    CompositeAction compositeAction = new CompositeActionImpl(null, ID);
    
    // Check has no action
    assertFalse(compositeAction.hasActions());
    List<Action> noActions = compositeAction.getActions();
    assertNotNull(noActions);
    assertEquals(0, noActions.size());

    // Add actions
    compositeAction.addAction(action1);
    compositeAction.addAction(action2);
    compositeAction.addAction(action3);
    
    // Check that the actions that are there and in the correct order
    assertTrue(compositeAction.hasActions());
    List<Action> actions = compositeAction.getActions();
    assertNotNull(actions);
    assertEquals(3, actions.size());
    int counter = 0;
    for (Action action : actions)
    {
        if (counter == 0)
        {
            assertEquals(action1, action);
        }
        else if (counter == 1)
        {
            assertEquals(action2, action);
        }
        else if (counter == 2)
        {
            assertEquals(action3, action);
        }
        counter+=1;
    }        
    assertEquals(action1, compositeAction.getAction(0));
    assertEquals(action2, compositeAction.getAction(1));
    assertEquals(action3, compositeAction.getAction(2));
    
    // Check remove
    compositeAction.removeAction(action3);
    assertEquals(2, compositeAction.getActions().size());
    
    // Check set
    compositeAction.setAction(1, action3);
    assertEquals(action1, compositeAction.getAction(0));
    assertEquals(action3, compositeAction.getAction(1));
    
    // Check index of
    assertEquals(0, compositeAction.indexOfAction(action1));
    assertEquals(1, compositeAction.indexOfAction(action3));
    
    // Test insert
    compositeAction.addAction(1, action2);
    assertEquals(3, compositeAction.getActions().size());
    assertEquals(action1, compositeAction.getAction(0));
    assertEquals(action2, compositeAction.getAction(1));
    assertEquals(action3, compositeAction.getAction(2));
    
    // Check remote all
    compositeAction.removeAllActions();
    assertFalse(compositeAction.hasActions());
    assertEquals(0, compositeAction.getActions().size());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:71,代码来源:CompositeActionImplTest.java

示例4: testActions

import org.alfresco.service.cmr.action.CompositeAction; //导入方法依赖的package包/类
public void testActions()
  {
  	Action action1 = new ActionImpl(null, ACTION1_ID, ACTION1_NAME, null);
  	Action action2 = new ActionImpl(null, ACTION2_ID, ACTION2_NAME, null);
  	Action action3 = new ActionImpl(null, ACTION3_ID, ACTION3_NAME, null);

CompositeAction compositeAction = new CompositeActionImpl(null, ID);
  	
  	// Check has no action
  	assertFalse(compositeAction.hasActions());
  	List<Action> noActions = compositeAction.getActions();
  	assertNotNull(noActions);
  	assertEquals(0, noActions.size());
  
  	// Add actions
  	compositeAction.addAction(action1);
  	compositeAction.addAction(action2);
  	compositeAction.addAction(action3);
  	
  	// Check that the actions that are there and in the correct order
  	assertTrue(compositeAction.hasActions());
  	List<Action> actions = compositeAction.getActions();
  	assertNotNull(actions);
  	assertEquals(3, actions.size());
  	int counter = 0;
  	for (Action action : actions)
{
	if (counter == 0)
	{
		assertEquals(action1, action);
	}
	else if (counter == 1)
	{
		assertEquals(action2, action);
	}
	else if (counter == 2)
	{
		assertEquals(action3, action);
	}
	counter+=1;
}    	
  	assertEquals(action1, compositeAction.getAction(0));
  	assertEquals(action2, compositeAction.getAction(1));
  	assertEquals(action3, compositeAction.getAction(2));
  	
  	// Check remove
  	compositeAction.removeAction(action3);
  	assertEquals(2, compositeAction.getActions().size());
  	
  	// Check set
  	compositeAction.setAction(1, action3);
  	assertEquals(action1, compositeAction.getAction(0));
  	assertEquals(action3, compositeAction.getAction(1));
  	
  	// Check index of
  	assertEquals(0, compositeAction.indexOfAction(action1));
  	assertEquals(1, compositeAction.indexOfAction(action3));
  	
  	// Test insert
  	compositeAction.addAction(1, action2);
  	assertEquals(3, compositeAction.getActions().size());
  	assertEquals(action1, compositeAction.getAction(0));
  	assertEquals(action2, compositeAction.getAction(1));
  	assertEquals(action3, compositeAction.getAction(2));
  	
  	// Check remote all
  	compositeAction.removeAllActions();
  	assertFalse(compositeAction.hasActions());
  	assertEquals(0, compositeAction.getActions().size());
  }
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:71,代码来源:CompositeActionImplTest.java


注:本文中的org.alfresco.service.cmr.action.CompositeAction.getActions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。