summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2013-02-14 14:49:20 +0200
committerArtur Signell <artur@vaadin.com>2013-02-14 14:52:32 +0200
commit54597654e13a2d2dd98fae14e762eb8e325ec514 (patch)
treeb75fc7286046e3f0180a16a70a31556e3cef0788
parent69d6f8b78983302785c6bd9ab02bd8b42194b2b7 (diff)
downloadvaadin-framework-54597654e13a2d2dd98fae14e762eb8e325ec514.tar.gz
vaadin-framework-54597654e13a2d2dd98fae14e762eb8e325ec514.zip
Fixed problem with removing the icon from a Button (#10543)
Change-Id: Ia119b93643678494db95d36ffe031a44b76ba578
-rw-r--r--client/src/com/vaadin/client/ui/button/ButtonConnector.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html72
-rw-r--r--uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java38
3 files changed, 111 insertions, 1 deletions
diff --git a/client/src/com/vaadin/client/ui/button/ButtonConnector.java b/client/src/com/vaadin/client/ui/button/ButtonConnector.java
index 0439cd4fdc..9733d206c7 100644
--- a/client/src/com/vaadin/client/ui/button/ButtonConnector.java
+++ b/client/src/com/vaadin/client/ui/button/ButtonConnector.java
@@ -77,7 +77,7 @@ public class ButtonConnector extends AbstractComponentConnector implements
}
});
- addStateChangeHandler("resources.icon", new StateChangeHandler() {
+ addStateChangeHandler("resources", new StateChangeHandler() {
@Override
public void onStateChanged(StateChangeEvent stateChangeEvent) {
if (getIcon() != null) {
diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html
new file mode 100644
index 0000000000..642abd8120
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.html
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="http://localhost:8888/" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.button.ButtonToggleIcons?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]</td>
+ <td>40,14</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]</td>
+ <td>40,14</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonToggleIcons::/VVerticalLayout[0]/Slot[1]/VNativeButton[0]/domChild[0]</td>
+ <td>v-icon</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java
new file mode 100644
index 0000000000..626ed1d250
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.components.button;
+
+import com.vaadin.server.ThemeResource;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.UI;
+import com.vaadin.ui.VerticalLayout;
+
+@SuppressWarnings("serial")
+public class ButtonToggleIcons extends UI {
+
+ @Override
+ protected void init(final VaadinRequest request) {
+ final VerticalLayout layout = new VerticalLayout();
+ setContent(layout);
+
+ final ThemeResource iconResource = new ThemeResource(
+ "../runo/icons/16/arrow-left.png");
+
+ final ClickListener iconToggleListener = new ClickListener() {
+ @Override
+ public void buttonClick(final ClickEvent event) {
+ final Button btn = event.getButton();
+ if (btn.getIcon() == null) {
+ btn.setIcon(iconResource);
+ } else {
+ btn.setIcon(null);
+ }
+ }
+ };
+
+ layout.addComponent(new Button("Toggle icon", iconToggleListener));
+ layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
+ }
+} \ No newline at end of file
47339/stable29'>backport/47339/stable29 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/db/oraclemigrator.php
blob: ceb89cf64d43c428a665846331982693b5288727 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <icewind@owncloud.com>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 *
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */

namespace OC\DB;

use Doctrine\DBAL\Schema\Schema;

class OracleMigrator extends NoCheckMigrator {
	/**
	 * @param Schema $targetSchema
	 * @param \Doctrine\DBAL\Connection $connection
	 * @return \Doctrine\DBAL\Schema\SchemaDiff
	 */
	protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) {
		$schemaDiff = parent::getDiff($targetSchema, $connection);

		// oracle forces us to quote the identifiers
		foreach ($schemaDiff->changedTables as $tableDiff) {
			$tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name);
			foreach ($tableDiff->changedColumns as $column) {
				$column->oldColumnName = $this->connection->quoteIdentifier($column->oldColumnName);
			}
		}

		return $schemaDiff;
	}

	/**
	 * @param string $name
	 * @return string
	 */
	protected function generateTemporaryTableName($name) {
		return 'oc_' . uniqid();
	}

	/**
	 * @param $statement
	 * @return string
	 */
	protected function convertStatementToScript($statement) {
		if (substr($statement, -1) === ';') {
			return $statement . PHP_EOL . '/' . PHP_EOL;
		}
		$script = $statement . ';';
		$script .= PHP_EOL;
		$script .= PHP_EOL;
		return $script;
	}

	protected function getFilterExpression() {
		return '/^"' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
	}

}