Skip to main content
summaryrefslogtreecommitdiffstats
blob: fa495de810827ced5746f092db97ed31249510fb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*******************************************************************************
 * Copyright (c) 2001, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.wsdl.ui.internal.adapters.commands;

import org.eclipse.gef.commands.Command;
import org.eclipse.wst.wsdl.Fault;
import org.eclipse.wst.wsdl.Operation;
import org.eclipse.wst.wsdl.ui.internal.asd.Messages;
import org.eclipse.wst.wsdl.ui.internal.commands.AddBaseParameterCommand;
import org.eclipse.wst.wsdl.ui.internal.commands.AddFaultParameterCommand;

public class W11AddFaultParameterCommand extends Command {
	protected Operation operation;
	protected Fault fault;
	
	public W11AddFaultParameterCommand(Operation operation, Fault fault) {
        super(Messages.getString("_UI_ACTION_ADD_FAULT"));
		this.operation = operation;
		this.fault = fault;
	}
	
	public void execute() {
		// Determine which Pattern we should use.  For example, ADDBaseParameterCommand.PART_ELEMENT_SEQ_ELEMENT
		int pattern = AddBaseParameterCommand.getParameterPattern(operation);
		AddFaultParameterCommand command = new AddFaultParameterCommand(operation, fault);
		command.setStyle(pattern);
		command.run();
	}
}

Back to the top