Author: jjankovi
Date: 2012-05-22 05:13:50 -0400 (Tue, 22 May 2012)
New Revision: 41236
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
Log:
Class for work with Project Archives view
Added:
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
===================================================================
---
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java
(rev 0)
+++
trunk/archives/tests/org.jboss.tools.archives.ui.bot.test/src/org/jboss/tools/archives/ui/bot/test/view/ProjectArchivesView.java 2012-05-22
09:13:50 UTC (rev 41236)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2010-2012 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.archives.ui.bot.test.view;
+
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree;
+import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem;
+import org.jboss.tools.archives.ui.bot.test.context.ArchiveContextMenu;
+import org.jboss.tools.archives.ui.bot.test.dialog.ArchivePublishSettingsDialog;
+import org.jboss.tools.archives.ui.bot.test.dialog.EditArchiveDialog;
+import org.jboss.tools.archives.ui.bot.test.dialog.NewJarDialog;
+import org.jboss.tools.ui.bot.ext.gen.ActionItem.View.JBossToolsProjectarchives;
+import org.jboss.tools.ui.bot.ext.helper.TreeHelper;
+import org.jboss.tools.ui.bot.ext.types.IDELabel;
+import org.jboss.tools.ui.bot.ext.view.ViewBase;
+
+/**
+ *
+ * @author jjankovi
+ *
+ */
+public class ProjectArchivesView extends ViewBase {
+
+ private ArchiveContextMenu contextTool = null;
+
+ public ProjectArchivesView() {
+ super();
+ viewObject = JBossToolsProjectarchives.LABEL;
+ contextTool = new ArchiveContextMenu();
+ }
+
+ public void buildArchiveNode(String... path) {
+ open.selectTreeNode(this.bot(), path);
+ show().toolbarButton(IDELabel.ArchivesView.BUTTON_BUILD_ARCHIVE_NODE).click();
+ }
+
+ public NewJarDialog createNewJarArchive(String project) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = tree.getTreeItem(project);
+ return contextTool.createNewJarArchive(tree, treeItem);
+ }
+
+ public void buildProjectFull(String project) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = tree.getTreeItem(project);
+ contextTool.buildProjectFull(tree, treeItem);
+ }
+
+ public void buildArchiveFull(String... pathToArchive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
+ contextTool.buildArchiveFull(tree, treeItem);
+ }
+
+ public EditArchiveDialog editArchive(String... pathToArchive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
+ return contextTool.editArchive(tree, treeItem);
+ }
+
+ public void deleteArchive(String... pathToArchive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
+ contextTool.deleteArchive(tree, treeItem);
+ }
+
+ public ArchivePublishSettingsDialog publishToServer(String... pathToArchive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
+ return contextTool.publishToServer(tree, treeItem);
+ }
+
+ public ArchivePublishSettingsDialog editPublishSettings(String... pathToArchive) {
+ SWTBotTree tree = this.bot().tree();
+ SWTBotTreeItem treeItem = TreeHelper.expandNode(this.bot(), pathToArchive);
+ return contextTool.editPublishSettings(tree, treeItem);
+ }
+
+}