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


Java ValidatingUserInputDialog类代码示例

本文整理汇总了Java中org.apache.taverna.lang.ui.ValidatingUserInputDialog的典型用法代码示例。如果您正苦于以下问题:Java ValidatingUserInputDialog类的具体用法?Java ValidatingUserInputDialog怎么用?Java ValidatingUserInputDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValidatingUserInputDialog类属于org.apache.taverna.lang.ui包,在下文中一共展示了ValidatingUserInputDialog类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	Set<String> usedOutputPorts = new HashSet<>();
	for (OutputWorkflowPort usedOutputPort : dataflow.getOutputPorts())
		if (!usedOutputPort.getName().equals(port.getName()))
			usedOutputPorts.add(usedOutputPort.getName());

	DataflowOutputPortPanel inputPanel = new DataflowOutputPortPanel();

	ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
			"Edit Workflow Output Port", inputPanel);
	vuid.addTextComponentValidation(inputPanel.getPortNameField(),
			"Set the workflow output port name.", usedOutputPorts,
			"Duplicate workflow output port name.",
			"[\\p{L}\\p{Digit}_.]+", "Invalid workflow output port name.");
	vuid.setSize(new Dimension(400, 200));

	inputPanel.setPortName(port.getName());

	try {
		if (vuid.show(component))
			changeOutputPort(inputPanel);
	} catch (EditException ex) {
		logger.debug("Rename workflow output port failed", ex);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:27,代码来源:EditDataflowOutputPortAction.java

示例2: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	Set<String> usedProcessors = new HashSet<>();
	for (Processor usedProcessor : dataflow.getProcessors())
		if (!usedProcessor.getName().equals(processor.getName()))
			usedProcessors.add(usedProcessor.getName());

	ProcessorPanel inputPanel = new ProcessorPanel();

	ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
			"Rename service", inputPanel);
	vuid.addTextComponentValidation(inputPanel.getProcessorNameField(),
			"Set the service name.", usedProcessors, "Duplicate service.",
			"[\\p{L}\\p{Digit}_.]+", "Invalid service name.");
	vuid.setSize(new Dimension(400, 200));

	inputPanel.setProcessorName(processor.getName());

	try {
		if (vuid.show(component))
			changeProcessorName(inputPanel);
	} catch (EditException e1) {
		logger.debug("Rename service (processor) failed", e1);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:26,代码来源:RenameProcessorAction.java

示例3: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
	try {
		Set<String> usedInputPorts = new HashSet<>();
		for (InputWorkflowPort inputPort : dataflow.getInputPorts())
			usedInputPorts.add(inputPort.getName());

		DataflowInputPortPanel inputPanel = new DataflowInputPortPanel();

		ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
				"Add Workflow Input Port", inputPanel);
		vuid.addTextComponentValidation(inputPanel.getPortNameField(),
				"Set the workflow input port name.", usedInputPorts,
				"Duplicate workflow input port name.",
				"[\\p{L}\\p{Digit}_.]+",
				"Invalid workflow input port name.");
		vuid.addMessageComponent(inputPanel.getSingleValueButton(),
				"Set the input port type.");
		vuid.addMessageComponent(inputPanel.getListValueButton(),
				"Set the input port list depth.");
		vuid.setSize(new Dimension(400, 250));

		inputPanel.setPortDepth(0);

		if (vuid.show(component)) {
			InputWorkflowPort dataflowInputPort = new InputWorkflowPort();
			dataflowInputPort.setName(inputPanel.getPortName());
			dataflowInputPort.setDepth(inputPanel.getPortDepth());
			editManager.doDataflowEdit(dataflow.getParent(),
					new AddWorkflowInputPortEdit(dataflow,
							dataflowInputPort));
		}
	} catch (EditException e) {
		logger.warn("Adding a new workflow input port failed");
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:37,代码来源:AddDataflowInputAction.java

示例4: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
	try {
		Set<String> usedOutputPorts = new HashSet<>();
		for (OutputWorkflowPort outputPort : dataflow.getOutputPorts())
			usedOutputPorts.add(outputPort.getName());

		DataflowOutputPortPanel inputPanel = new DataflowOutputPortPanel();

		ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
				"Add Workflow Output Port", inputPanel);
		vuid.addTextComponentValidation(inputPanel.getPortNameField(),
				"Set the workflow output port name.", usedOutputPorts,
				"Duplicate workflow output port name.",
				"[\\p{L}\\p{Digit}_.]+",
				"Invalid workflow output port name.");
		vuid.setSize(new Dimension(400, 200));

		if (vuid.show(component)) {
			String portName = inputPanel.getPortName();
			OutputWorkflowPort dataflowOutputPort = new OutputWorkflowPort();
			dataflowOutputPort.setName(portName);
			editManager.doDataflowEdit(dataflow.getParent(),
					new AddWorkflowOutputPortEdit(dataflow,
							dataflowOutputPort));
		}
	} catch (EditException e) {
		logger.debug("Create workflow output port failed", e);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:31,代码来源:AddDataflowOutputAction.java

示例5: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	Set<String> usedInputPorts = new HashSet<>();
	for (InputWorkflowPort usedInputPort : dataflow.getInputPorts())
		if (!usedInputPort.getName().equals(port.getName()))
			usedInputPorts.add(usedInputPort.getName());

	DataflowInputPortPanel inputPanel = new DataflowInputPortPanel();

	ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
			"Edit Workflow Input Port", inputPanel);
	vuid.addTextComponentValidation(inputPanel.getPortNameField(),
			"Set the workflow input port name.", usedInputPorts,
			"Duplicate workflow input port name.", "[\\p{L}\\p{Digit}_.]+",
			"Invalid workflow input port name.");
	vuid.addMessageComponent(inputPanel.getSingleValueButton(),
			"Set the input port type.");
	vuid.addMessageComponent(inputPanel.getListValueButton(),
			"Set the input port list depth.");
	vuid.setSize(new Dimension(400, 250));

	inputPanel.setPortName(port.getName());
	inputPanel.setPortDepth(port.getDepth());

	try {
		if (vuid.show(component))
			changeInputPort(inputPanel);
	} catch (EditException e1) {
		logger.warn("Rename workflow input port failed", e1);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:32,代码来源:EditDataflowInputPortAction.java

示例6: actionPerformed

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	Preferences prefs = Preferences.userNodeForPackage(getClass());
	String currentUrl = prefs.get("currentUrl",
			"http://www.mygrid.org.uk/");

	UrlPanel urlPanel = new UrlPanel();

	ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
			"Add an http URL", urlPanel);
	vuid.addTextComponentValidation(urlPanel.getUrlField(),
			"Set the URL.", null, "", URL_REGEX,
			"Not a valid http URL.");
	vuid.setSize(new Dimension(400, 200));
	urlPanel.setUrl(currentUrl);

	if (vuid.show(RegistrationPanel.this)) {
		String urlString = urlPanel.getUrl();
		try {
			URL url = new URL(urlString);
			prefs.put("currentUrl", url.toString());

			DefaultMutableTreeNode node = getSelectedNode();

			@SuppressWarnings("unused")
			DefaultMutableTreeNode added = addPojo(node, url, 0);
			setStatus("Added URL : " + url, null);
		} catch (MalformedURLException e1) {
			setStatus("Invalid URL.", null);
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:33,代码来源:RegistrationPanel.java

示例7: showDialogue

import org.apache.taverna.lang.ui.ValidatingUserInputDialog; //导入依赖的package包/类
protected void showDialogue(OutputWorkflowPort portTemplate) {
	Set<String> usedOutputPorts = new HashSet<String>();
	for (OutputWorkflowPort usedInputPort : workflow.getOutputPorts()) {
		usedOutputPorts.add(usedInputPort.getName());
	}
	DataflowOutputPortPanel outputPanel = new DataflowOutputPortPanel();

	ValidatingUserInputDialog vuid = new ValidatingUserInputDialog(
			ADD_WORKFLOW_OUTPUT_PORT, outputPanel);
	vuid.addTextComponentValidation(outputPanel.getPortNameField(),
			SET_THE_WORKFLOW_OUTPUT_PORT_NAME, usedOutputPorts,
			DUPLICATE_WORKFLOW_OUTPUT_PORT_NAME,
			VALID_PORT_NAME_REGEX, INVALID_WORKFLOW_OUTPUT_PORT_NAME);
	vuid.setSize(OUTPUT_PORT_DIALOGUE_SIZE);
	outputPanel.setPortName(portTemplate.getName());

	if (vuid.show(parentComponent)) {
		OutputWorkflowPort outputWorkflowPort = new OutputWorkflowPort();
		outputWorkflowPort.setName(outputPanel.getPortName());
		List<Edit<?>> editList = new ArrayList<Edit<?>>();
		editList.add(new AddWorkflowOutputPortEdit(workflow, outputWorkflowPort));
		DataLink dataLink = new DataLink();
		dataLink.setReceivesFrom((SenderPort) port);
		dataLink.setSendsTo(outputWorkflowPort);
		editList.add(new AddDataLinkEdit(workflow, dataLink));
		try {
			CompoundEdit compoundEdit = new CompoundEdit(editList);
			editManager.doDataflowEdit(workflow.getParent(), compoundEdit);
		} catch (EditException ex) {
			logger.warn("Can't create or connect new workflow output port", ex);
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:34,代码来源:CreateAndConnectDataflowPortAction.java


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