diff --git a/.gitignore b/.gitignore index ffc0c373861..0dd90f7ae69 100644 --- a/.gitignore +++ b/.gitignore @@ -169,6 +169,7 @@ packages/dashbuilder/**/dependency-reduced-pom.xml packages/dashbuilder/dashbuilder-runtime-parent/dashbuilder-runtime-client/src/main/webapp/dashbuilder/component **/.apt_generated/ **/.apt_generated_tests/ +packages/dashbuilder/**/.checkstyle #kie-sandbox-fs packages/kie-sandbox-fs/dist @@ -266,4 +267,4 @@ fabric.properties # xml-parser-ts-codegen on some packages packages/bpmn-marshaller/**/ts-gen packages/dmn-marshaller/**/ts-gen -packages/scesim-marshaller/**/ts-gen \ No newline at end of file +packages/scesim-marshaller/**/ts-gen diff --git a/packages/dashbuilder-component-table/static/index.css b/packages/dashbuilder-component-table/static/index.css index b6c2e78cd35..af4ef0c5783 100644 --- a/packages/dashbuilder-component-table/static/index.css +++ b/packages/dashbuilder-component-table/static/index.css @@ -17,7 +17,7 @@ background-color: #dfdfdf !important; } [mode="dark"] .selected-row { - background-color: #393555 !important; + background-color: #454545 !important; } [mode="dark"] { --pf-global--Color--100: #eef1fa !important; @@ -26,7 +26,7 @@ --pf-global--primary-color--100: var(--pf-global--primary-color--light-100) !important; --pf-global--link--Color: var(--pf-global--link--Color--light) !important; --pf-global--link--Color--hover: var(--pf-global--link--Color--light) !important; - --pf-global--BackgroundColor--100: #100c2a !important; + --pf-global--BackgroundColor--100: rgb(27, 29, 33) !important; } [mode="dark"] body, @@ -39,25 +39,25 @@ --pf-global--primary-color--100: var(--pf-global--primary-color--light-100) !important; --pf-global--link--Color: var(--pf-global--link--Color--light) !important; --pf-global--link--Color--hover: var(--pf-global--link--Color--light) !important; - --pf-global--BackgroundColor--100: #100c2a !important; + --pf-global--BackgroundColor--100: rgb(27, 29, 33) !important; } [mode="dark"] .pf-c-options-menu__menu, [mode="dark"] .pf-c-pagination__nav, [mode="dark"] .pf-c-pagination__total-items { - background-color: #100c2a !important; + background-color: rgb(27, 29, 33) !important; color: #eef1fa; } [mode="dark"] .pf-c-options-menu__menu-item:hover, [mode="dark"] .pf-c-table tr.pf-m-hoverable:hover { - background-color: #393555; + background-color: #454545; color: #eef1fa; } [mode="dark"] .pf-c-form-control { --pf-global--Color--100: #eef1fa !important; - --pf-global--BackgroundColor--100: #100c2a !important; + --pf-global--BackgroundColor--100: rgb(27, 29, 33) !important; } [mode="dark"] .pf-c-form-control:disabled { diff --git a/packages/dashbuilder/appformer/pom.xml b/packages/dashbuilder/appformer/pom.xml deleted file mode 100644 index b3b22cd9d41..00000000000 --- a/packages/dashbuilder/appformer/pom.xml +++ /dev/null @@ -1,1112 +0,0 @@ - - - - - 4.0.0 - - org.dashbuilder - dashbuilder-parent - ${revision} - ../pom.xml - - - - org.uberfire - uberfire-parent - pom - - UberFire parent - - The parent contains all metadata (including plugins) and also dependency versions. All UberFire modules - (except for user BOMs like 'uberfire-bom') should (transitively) inherit from this POM. - - 2012 - - JBoss by Red Hat - http://www.jboss.org/ - - - - Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - ${project.version} - ${version.org.kie} - 3.18.1 - 1.0.4 - 1.10.0 - 3.1.1 - 2.29.4 - 0.5.43 - 16.6.0 - 16.6.0 - 2.1.25 - 1.3.3 - - 1.2.61 - 0.1 - 3.0.1 - 5.5.0 - 1.12.1 - - 1.2.7.SP1 - - 2.3.0 - linux-x86_64 - osx-x86_64 - - 3.3.0 - - ${maven.build.timestamp} - https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/ - https://repository.jboss.org/nexus/content/repositories/snapshots/ - - 4.3.5.Final - - - 1.2.11 - 0.3 - 5.0.2 - 1.4.0.Final - ${version.org.uberfire.latestFinal.release} - ${project.version} - - 1.1.1 - 0.1.1 - - - 1.3.6 - 8.0.28 - 42.4.3 - - 1.15.3 - - 1.2.6 - - 1.2.3.GA - - 1.0.0.GA - - - - - jboss-public-repository-group - JBoss Public Repository Group - https://repository.jboss.org/nexus/content/groups/public/ - - true - never - - - true - daily - - - - - - jboss-public-repository-group - JBoss Public Repository Group - https://repository.jboss.org/nexus/content/groups/public/ - - true - - - true - - - - - - scm:git:git@github.com:uberfire/uberfire.git - scm:git:git@github.com:uberfire/uberfire.git - https://github.com/uberfire/uberfire - - - jira - https://issues.jboss.org/browse/UF - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - UTF-8 - - - - org.codehaus.mojo - build-helper-maven-plugin - - - - parse-version - - - - add-source - generate-sources - - add-source - - - - target/generated-sources/annotations - - - - - - - org.codehaus.mojo - gwt-maven-plugin - ${version.com.google.gwt} - - - org.apache.felix - maven-bundle-plugin - true - - - true - - <_removeheaders>Ignore-Package - <_nouses>true - <_snapshot>${osgi.snapshot.qualifier} - - ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier} - - - NONE - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - false - false - true - ${project.build.directory} - true - - - **/*Test.java - - - **/*IntegrationTest.java - - -Xmx1024m -Dfile.encoding=UTF-8 - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - - integration-test - verify - - - - - - **/*IntegrationTest.java - - -Xmx1024m -Dfile.encoding=UTF-8 - - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar-no-fork - - - - - 2 - ${project.artifactId}.source - - ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier} - - ${project.name} - ${project.organization.name} - - ${project.artifactId};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier}";roots:="." - - - - - - - attach-test-sources - - test-jar-no-fork - - - - - 2 - ${project.artifactId}.tests.source - - ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier} - - ${project.name} - ${project.organization.name} - - ${project.artifactId}.tests;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${osgi.snapshot.qualifier}";roots:="." - - - - - - - - - org.commonjava.maven.plugins - project-sources-maven-plugin - 1.0 - - - project-sources-archive - initialize - - archive - - - - - - - org.codehaus.mojo - versions-maven-plugin - 2.2 - - - - org.apache.maven.plugins - maven-release-plugin - - - false - true - - - - - org.codehaus.mojo - jaxb2-maven-plugin - 1.3 - - - - - org.eclipse.m2e - lifecycle-mapping - - 1.0.0 - - - - - - org.codehaus.mojo - build-helper-maven-plugin - [1.7,) - - parse-version - - - - - - - - - org.codehaus.mojo - gwt-maven-plugin - [2.3.0,) - - resources - - - - - - - - - org.apache.maven.plugins - maven-antrun-plugin - [1.8,) - - run - - - - - - - - - - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - - - org.apache.maven.plugins - maven-source-plugin - - - - maven-enforcer-plugin - - - - maven-clean-plugin - - - - ${basedir} - - src/main/webapp/WEB-INF/deploy/ - src/main/webapp/WEB-INF/classes/ - src/main/webapp/WEB-INF/lib/ - .errai/ - .niogit/** - - - - - - - - - com.google.code.maven-replacer-plugin - replacer - - - **/*Constants_de.properties - **/*Constants_es.properties - **/*Constants_fr.properties - **/*Constants_ja.properties - **/*Constants_pt_BR.properties - **/*Constants_zh_CN.properties - **/*Constants_ru.properties - - - **/ErraiApp.properties - - - - '' - ' - - - ' - '' - - - - - - - maven-antrun-plugin - - - - create-default-i18n-resource - process-resources - - - - - - - - - - run - - - - - - - - - - graph - - - - - org.fusesource.mvnplugins - maven-graph-plugin - 1.38 - - - dependency-graph-reactor - install - - reactor - - - - - true - - - - - org.revapi - revapi-maven-plugin - 0.8.1 - - - org.revapi - revapi-java - 0.13.1 - - - - - ${project.groupId}:${project.artifactId}:${revapi.oldUberFireVersion} - - - ${project.groupId}:${project.artifactId}:${revapi.newUberFireVersion} - - - - - src/build/revapi-config.json - - filters - ignores - - - - - nonBreaking - potentiallyBreaking - - - - - check - - check - - verify - - - - report - - report - - package - - - - - - - - - run-code-coverage - - *Lexer - - - - - - org.jacoco - org.jacoco.agent - runtime - ${version.jacoco.plugin} - test - - - - - - org.jacoco - org.jacoco.agent - runtime - test - - - - - - - org.jacoco - jacoco-maven-plugin - ${version.jacoco.plugin} - - true - ${jacoco.exec.file} - - ${jacoco.excludes} - - - - - default-instrument - - instrument - - - - default-restore-instrumented-classes - - restore-instrumented-classes - - - - - - net.ltgt.gwt.maven - gwt-maven-plugin - - true - - - - maven-surefire-plugin - - - ${jacoco.exec.file} - - - - - - - - org.jacoco - jacoco-maven-plugin - - - - - - - - uberfire-commons - uberfire-api - uberfire-client-api - uberfire-testing-utils - uberfire-workbench - uberfire-client-all - uberfire-extensions - - - - - - org.dashbuilder - dashbuilder-bom - ${project.version} - pom - import - - - - org.jboss.errai - errai-jaxrs-client - test-jar - ${version.org.jboss.errai} - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - ${version.jakarta.enterprise.cdi-api} - - - - org.eclipse.jgit - org.eclipse.jgit - ${version.org.eclipse.jgit} - - - commons-logging - commons-logging - - - - - - org.eclipse.jgit - org.eclipse.jgit.http.server - ${version.org.eclipse.jgit} - - - commons-logging - commons-logging - - - javax.servlet - servlet-api - - - - - - org.keycloak - keycloak-core - ${version.org.keycloak} - - - org.keycloak - keycloak-common - ${version.org.keycloak} - - - - com.google.jsinterop - base - ${version.com.google.jsinterop.base} - - - - com.allen-sauer.gwt.dnd - gwt-dnd - ${version.com.allen-sauer.gwt.dnd} - - - javax.servlet - javax.servlet-api - - - - - - org.scannotation - scannotation - ${version.org.scannotation} - - - - javassist - javassist - - - - - - - org.jboss.byteman - byteman - ${version.org.jboss.byteman} - test - - - org.jboss.byteman - byteman-submit - ${version.org.jboss.byteman} - test - - - org.jboss.byteman - byteman-install - ${version.org.jboss.byteman} - test - - - org.jboss.byteman - byteman-bmunit - ${version.org.jboss.byteman} - test - - - - - - io.netty - netty - ${version.io.netty.old} - - - - org.infinispan - infinispan-client-hotrod - ${version.org.infinispan} - - - org.jboss.spec.javax.transaction - jboss-transaction-api_1.2_spec - - - ch.qos.logback - logback-classic - - - org.jboss.marshalling - jboss-marshalling-osgi - - - - - org.infinispan - infinispan-commons - ${version.org.infinispan} - - - org.jboss.marshalling - jboss-marshalling-osgi - - - - - org.infinispan.protostream - protostream - ${version.org.infinispan.protostream} - - - org.wildfly.security - wildfly-elytron - ${version.org.wildfly.security} - - - - org.apache.activemq - artemis-jms-client - ${version.org.apache.activemq.artemis} - - - org.jboss.spec.javax.jms - jboss-jms-api_2.0_spec - - - org.apache.geronimo.specs - geronimo-json_1.0_spec - - - commons-logging - commons-logging - - - - - io.netty - netty-buffer - ${version.io.netty} - - - io.netty - netty-transport - ${version.io.netty} - - - io.netty - netty-handler - ${version.io.netty} - - - io.netty - netty-transport-native-epoll - ${version.io.netty} - ${netty-transport-native-epoll-classifier} - - - io.netty - netty-transport-native-kqueue - ${version.io.netty} - ${netty-transport-native-kqueue-classifier} - - - io.netty - netty-codec-http - ${version.io.netty} - - - com.github.tdomzal - junit-docker-rule - ${version.jnuit.docker.rule} - test - - - com.spotify - docker-client - ${version.com.spotify.docker} - test - - - commons-logging - commons-logging - - - - - ch.qos.logback - logback-classic - ${version.ch.qos.logback} - - - ch.qos.logback - logback-core - ${version.ch.qos.logback} - - - - - org.kie - lienzo-core - ${version.org.kie} - - - - org.kie - lienzo-core - ${version.org.kie} - sources - - - - org.kie - lienzo-tests - ${version.org.kie} - - - - org.kie - lienzo-tests - ${version.org.kie} - sources - - - - org.apache.httpcomponents - httpclient - ${version.org.apache.httpcomponents.httpclient} - - - commons-logging - commons-logging - - - - - - com.jcraft - jsch - ${version.com.jcraft} - - - - - org.codehaus.groovy - groovy-all - indy - ${version.org.codehaus.groovy} - - - - - com.googlecode.json-simple - json-simple - ${version.com.googlecode.jsonsimple} - jar - - - - com.googlecode.jtype - jtype - ${version.com.googlecode.jtype} - - - - org.jboss.msc - jboss-msc - ${version.org.jboss.jboss-msc} - - - - - org.apache.logging.log4j - log4j-to-slf4j - ${version.org.apache.logging.log4j} - - - - - mysql - mysql-connector-java - ${version.org.mysql-driver} - test - - - - org.postgresql - postgresql - ${version.org.postgres-driver} - test - - - - org.mariadb.jdbc - mariadb-java-client - ${version.org.mariadb.jdbc} - test - - - - - - - org.arquillian.cube - arquillian-cube-docker-junit-rule - ${version.org.arquillian.cube} - test - - - javax.enterprise - cdi-api - - - log4j - log4j - - - com.github.docker-java - docker-java - - - org.arquillian.cube - arquillian-cube-requirement-spi - - - - - - org.jboss.marshalling - marshalling-api - ${version.org.jboss.marshalling.api} - test - - - - org.jboss.shrinkwrap - shrinkwrap-impl-base - ${version.org.jboss.shrinkwrap} - test - - - org.assertj - assertj-core - ${version.org.assertj} - - - - - - - - junit - junit - test - - - org.mockito - mockito-core - test - - - org.assertj - assertj-core - test - - - - - com.google.inject - guice - test - - - javax.inject - javax.inject - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java deleted file mode 100644 index 459c489f546..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.debug; - -/** - * Utility methods that help with debugging. - */ -public class Debug { - - /** - * The code requires this list to have 16 entries - */ - private static final String[] CONSONANTS = {"b", "d", "f", "h", - "j", "k", "l", "m", - "n", "p", "r", "s", - "t", "v", "w", "z"}; - - /** - * The code requires this list to have 8 entries - */ - private static final String[] VOWELS = {"a", "e", "ee", "i", - "o", "oo", "u", "y"}; - - /** - * Makes a reasonably easy-to-pronounce gibberish word from the given number. On average, the word will have about - * as many characters as the number would have when printed as a decimal, but (especially for large numbers) it will - * be easier to remember as a single word. - * @param num The number to convert. - * @return The memorable string, unique to the given number. Never null. - */ - public static String toMemorableString(long num) { - StringBuilder memorable = new StringBuilder(); - long hashNum = Math.abs(num); - for (; ; ) { - int chunk = (int) (hashNum & 0xf); - memorable.append(CONSONANTS[chunk]); - hashNum >>= 4; - if (hashNum == 0) { - break; - } - - chunk = (int) (hashNum & 7); - memorable.append(VOWELS[chunk]); - hashNum >>= 3; - if (hashNum == 0) { - break; - } - } - return memorable.toString(); - } - - /** - * Composes a compact, memorable unique string for the given object instance. The name starts with the abbreviated - * fully-qualified class name (see {@link #abbreviatedName(Class)}), an '@' character, then a gibberish word - * representing the object's identity hash code (see {@link #toMemorableString(long)}). - * @param o - * @return - */ - public static String objectId(Object o) { - if (o == null) { - return null; - } - return abbreviatedName(o.getClass()) + "@" + toMemorableString(System.identityHashCode(o)); - } - - /** - * Returns a compact representation of the fully-qualified name of the given class. The string is built with the following components: - *
    - *
  1. the first letter of each component of the package name - *
  2. a dot - *
  3. the class name. If the class is an inner class, the name is of the form Outer$Inner - *
      - *

      - * For classes in the default package, items 1 and 2 are omitted. - * @param c the class whose name to abbreviate. Can be null, but will result in a null return value. - * @return the abbreviated FQCN as described, or null if the input is null. - */ - public static String abbreviatedName(Class c) { - if (c == null) { - return null; - } - StringBuilder result = new StringBuilder(); - String fqcn = c.getName(); - int lastDot = -1; - int thisDot = -1; - while ((thisDot = fqcn.indexOf('.', - thisDot + 1)) != -1) { - result.append(fqcn.charAt(lastDot + 1)); - lastDot = thisDot; - } - if (lastDot != -1) { - result.append('.'); - } - result.append(fqcn.substring(lastDot + 1)); - return result.toString(); - } - - /** - * Returns the short name of the given class (no package name). This is the same as java.lang.Class.shortName(), - * which is not implemented in the GWT version of java.lang.Class. - * @param c the class whose name to abbreviate. Can be null, but will result in a null return value. - * @return the abbreviated FQCN as described, or null if the input is null. - */ - public static String shortName(Class c) { - if (c == null) { - return null; - } - return c.getName().substring(c.getName().lastIndexOf('.') + 1); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnClose.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnClose.java deleted file mode 100644 index 9605644c83d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnClose.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this will be called by the Workbench immediately after a WorkbenchPart is closed. - * WorkbenchParts can perform any clean-up tasks in the annotated method, but this does not include removing the view - * widget from the DOM; this will have already been taken care of by the framework. The method must take zero - * arguments and return void. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnClose { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnContextAttach.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnContextAttach.java deleted file mode 100644 index e77794b7472..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnContextAttach.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnContextAttach { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnFocus.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnFocus.java deleted file mode 100644 index 2b2867628f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnFocus.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the framework should call the target method when the activity is the current activity in the current - * panel. Activities may choose to make their UI more prominent, or begin refreshing their data more aggressively when - * they are focused. - *

      - * This annotation only has meaning on methods declared in or inherited by {@code @WorkbenchScreen} or - * {@code @WorkbenchEditor} classes. - *

      - * The target method must take no arguments and return void. - */ -@Inherited -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnFocus { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnLostFocus.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnLostFocus.java deleted file mode 100644 index 13538d0a5d1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnLostFocus.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Indicates that the framework should call the target method when the activity is no longer the current activity in the - * current panel. Typically, methods bearing this annotation will undo whatever effects they set up on the corresponding - * {@link OnFocus} method. - *

      - * This annotation only has meaning on methods declared in or inherited by {@code @WorkbenchScreen} or - * {@code @WorkbenchEditor} classes. - *

      - * The target method must take no arguments and return void. - */ -@Inherited -@Documented -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnLostFocus { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnMayClose.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnMayClose.java deleted file mode 100644 index 02566a990e4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnMayClose.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.Documented; -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this will be called by the Workbench before the WorkbenchPart is closed. The method must be non-private, - * take zero arguments and return a boolean indicating whether the WorkbenchPart can be closed (true, it can be closed; - * false it cannot be closed). - *

      - * This annotation only works on methods of classes annotated with {@code @WorkbenchScreen} or {@code @WorkbenchEditor}. - */ -@Documented -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnMayClose { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnOpen.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnOpen.java deleted file mode 100644 index 86b9c94273b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnOpen.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this are called by the Workbench when a WorkbenchPart - * is displayed. OnOpen annotated methods are called after the WorkbenchPart's - * OnStartup annotated method. The method should take zero arguments and return - * void. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnOpen { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnSave.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnSave.java deleted file mode 100644 index 5d9d6ffd6ff..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnSave.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * @deprecated The code generated by use of this annotation will never be called by the UberFire framework. Use an - * application-defined mechanism (perhaps a Saveable interface or a CDI event) instead. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnSave { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnShutdown.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnShutdown.java deleted file mode 100644 index c1c3afbab27..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnShutdown.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnShutdown { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnStartup.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnStartup.java deleted file mode 100644 index af63144a08d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/OnStartup.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - *

      - * Methods annotated with this are called by the Workbench before methods - * annotated with {@code @OnOpen}. WorkbenchParts should perform any - * initialisation activities here (for example load their content from a - * persistent store). - *

      - *

      - * For {@code @WorkbenchEditor}'s the method should take a single argument of - * type {@code org.drools.guvnor.vfs.Path}. The Path specifies the URI for the - * resource to be edited. For {@code @WorkbenchScreen} 's the method should have - * zero arguments. The method should return void. - *

      - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface OnStartup { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/Validate.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/Validate.java deleted file mode 100644 index b680d899094..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/lifecycle/Validate.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * - * - */ - -package org.uberfire.lifecycle; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface Validate { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/BiParameterizedCommand.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/BiParameterizedCommand.java deleted file mode 100644 index aabf567a0bf..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/BiParameterizedCommand.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mvp; - -import java.util.function.BiConsumer; - -/** - * A command representing a future activity, with two parameters. Similar to {@link BiConsumer} - * This was deliberately created in addition to the existing GWT Command to allow better - * re-use of menu structures when a WorkbenchPart is embedded within Eclipse. - * This is the two-arity specialization of {@link ParameterizedCommand} - */ -@FunctionalInterface -public interface BiParameterizedCommand { - - void execute(T parameter1, - U parameter2); - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/Commands.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/Commands.java deleted file mode 100644 index c9bb46b833a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/Commands.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mvp; - -/** - * A collection of generic operations that can be used anywhere a {@link Command} is called for. - */ -public class Commands { - - /** - * Has no effect when executed. - */ - public static final Command DO_NOTHING = new Command() { - @Override - public void execute() { - } - }; -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/ParameterizedCommand.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/ParameterizedCommand.java deleted file mode 100644 index c6b44760e7d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/ParameterizedCommand.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.mvp; - -/** - * A command representing a future activity. This was deliberately created in - * addition to the existing GWT Command to allow better re-use of menu - * structures when a WorkbenchPart is embedded within Eclipse. - * In case you need two parameters, see {@link BiParameterizedCommand}. - */ -public interface ParameterizedCommand { - - public void execute(T parameter); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java deleted file mode 100644 index 2028f74e0ea..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mvp; - -import java.util.Map; -import java.util.Set; - -import jsinterop.annotations.JsType; -import org.uberfire.mvp.impl.DefaultPlaceRequest; - -/** - * A request to navigate to a particular UberFire Workbench Place (a WorkbenchPerspective, a WorkbenchScreen, or a - * WorkbenchEditor). Can include optional state parameters that are made available to the requested place. - *

      - * Place requests can be serialized to and created from a valid URL fragment identifier (the string that goes after the - * {@code #} in the browser's location bar). - */ -@JsType -public interface PlaceRequest { - - public static final PlaceRequest NOWHERE = new DefaultPlaceRequest("NOWHERE"); - - String getIdentifier(); - - void setIdentifier(String identifier); - - String getFullIdentifier(); - - String getParameter(final String key, - final String defaultValue); - - Set getParameterNames(); - - Map getParameters(); - - PlaceRequest addParameter(final String name, - final String value); - - // TODO (UF-88) when PlaceRequest is an immutable value type, cloning will no longer be a sensible operation - PlaceRequest clone(); - - /** - * Indicates whether or not the Workbench framework should add a browser history item when navigating to this place. - */ - boolean isUpdateLocationBarAllowed(); - - void setUpdateLocationBar(boolean updateLocationBar); - - /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. - */ - default String asString() { - return this.toString(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ConditionalPlaceRequest.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ConditionalPlaceRequest.java deleted file mode 100644 index 91f230463be..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ConditionalPlaceRequest.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.mvp.impl; - -import java.util.Map; -import java.util.function.Predicate; - -import org.uberfire.mvp.PlaceRequest; - -public class ConditionalPlaceRequest extends DefaultPlaceRequest { - - private PlaceRequest orElsePlaceRequest; - private Predicate predicate; - - public ConditionalPlaceRequest() { - super(); - } - - /** - * A predicate applied to determine if this place request - * should be used or the alternative specified by #orElse - * @param identifier The place ID, or an empty string for the default place. - */ - public ConditionalPlaceRequest(final String identifier) { - super(identifier); - } - - /** - * Creates a conditional place request for the given place ID with the given - * state parameters for that place. - * @param identifier The place ID, or an empty string for the default place. - * @param parameters Place-specific parameters to pass to the place. Must not be null. - */ - public ConditionalPlaceRequest(final String identifier, - final Map parameters) { - super(identifier, - parameters); - } - - /** - * Creates a place request for the given place ID with the given - * state parameters for that place. - * @param predicate Represents if default place request should be used. - * If false, the place request will be orElsePlaceRequest. - */ - public ConditionalPlaceRequest when(Predicate predicate) { - this.predicate = predicate; - return this; - } - - /** - * Creates a place request for the given place ID with the given - * state parameters for that place. - * @param orElsePlaceRequest alternative place request. - */ - public PlaceRequest orElse(PlaceRequest orElsePlaceRequest) { - this.orElsePlaceRequest = orElsePlaceRequest; - return this; - } - - /** - * Return the place request of this conditional PlaceRequest. - * If there is no predicate or orElsePlaceRequest returns the - * default place request. - */ - public PlaceRequest resolveConditionalPlaceRequest() { - if (invalidConditionalPlaceRequest()) { - return this; - } - if (predicate == null || predicate.test(this)) { - return this; - } else { - return resolve(); - } - } - - private boolean invalidConditionalPlaceRequest() { - return predicate == null || orElsePlaceRequest == null; - } - - protected PlaceRequest resolve() { - if (orElsePlaceRequest instanceof ConditionalPlaceRequest) { - return ((ConditionalPlaceRequest) orElsePlaceRequest).resolveConditionalPlaceRequest(); - } else { - return orElsePlaceRequest; - } - } - - @Override - public String getIdentifier() { - if (invalidConditionalPlaceRequest()) { - return identifier; - } - - if (predicate == null || predicate.test(this)) { - return identifier; - } else { - return resolve().getIdentifier(); - } - } - - @Override - public Map getParameters() { - if (invalidConditionalPlaceRequest()) { - return parameters; - } - - if (predicate == null || predicate.test(this)) { - return parameters; - } else { - return resolve().getParameters(); - } - } - - @Override - public PlaceRequest clone() { - return new ConditionalPlaceRequest(identifier, - parameters).when(predicate).orElse(orElsePlaceRequest); - } - - /** - * A conditional place request should be resolved before being compared to another default place request. - * @param o A default or conditional place request. - * @return True if the resolved conditional place request equals to the default place request or resolved - * conditional place request passed, and false otherwise. - */ - @Override - public boolean equals(final Object o) { - if (o == null) { - return false; - } - - if (!(o instanceof DefaultPlaceRequest)) { - return false; - } - - if (this == o) { - return true; - } - - PlaceRequest that = (PlaceRequest) o; - if (o instanceof ConditionalPlaceRequest) { - that = ((ConditionalPlaceRequest) o).resolveConditionalPlaceRequest(); - } - - if (invalidConditionalPlaceRequest()) { - return super.equals(that); - } - - if (predicate == null || predicate.test(this)) { - return super.equals(that); - } else { - return resolve().equals(that); - } - } - - @Override - public int hashCode() { - if (invalidConditionalPlaceRequest()) { - return super.hashCode(); - } - - if (predicate == null || predicate.test(this)) { - return super.hashCode(); - } else { - return resolve().hashCode(); - } - } - - @Override - public String toString() { - if (predicate == null || predicate.test(this)) { - return super.toString(); - } else { - return resolve().toString(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/DefaultPlaceRequest.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/DefaultPlaceRequest.java deleted file mode 100644 index 4e32abd4185..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/DefaultPlaceRequest.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mvp.impl; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Set; - -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.mvp.PlaceRequest; - -@Portable -public class DefaultPlaceRequest implements PlaceRequest { - - protected final Map parameters = new HashMap(); - private boolean updateLocationBar; - protected String identifier; - - public DefaultPlaceRequest() { - this(""); - } - - /** - * Creates a place request for the given place ID. - * @param identifier The place ID, or an empty string for the default place. - */ - public DefaultPlaceRequest(final String identifier) { - this(identifier, - Collections.emptyMap(), - true); - } - - /** - * Creates a place request for the given place ID with the given - * state parameters for that place. - * @param identifier The place ID, or an empty string for the default place. - * @param parameters Place-specific parameters to pass to the place. Must not be null. - */ - public DefaultPlaceRequest(final String identifier, - final Map parameters) { - this(identifier, - parameters, - true); - } - - /** - * Creates a place request for the given place ID, with the given state parameters for that place, and the given - * preference of whether or not the browser's location bar should be updated. - * @param identifier The place ID, or an empty string for the default place. - * @param parameters Place-specific parameters to pass to the place. Must not be null. - * @param updateLocationBar If true, the browser's history will be updated with this place request. If false, the location bar - * will not be modified as a result of this place request. - */ - public DefaultPlaceRequest(final String identifier, - final Map parameters, - final boolean updateLocationBar) { - this.identifier = identifier; - this.parameters.putAll(parameters); - this.updateLocationBar = updateLocationBar; - } - - /** - * Creates a new place request from a string that encodes a place ID and optional parameters in standard URL query - * syntax. - *

      - * For example, the following returns a PlaceRequest with identifier {@code MyPlaceID} and two parameters, - * {@code param1} and {@code param2}. - *

      -     *   DefaultPlaceRequest.parse("MyPlaceID?param1=val1&param2=val2")
      -     * 
      - * @param partNameAndParams specification of the place ID and optional parameter map. Special characters in the identifier, key - * name, or key value can be escaped using URL encoding: for '%' use '%25'; for '&' use '%26'; for - * '=' use '%3d'; for '?' use '%3f'. - * @return a new PlaceRequest configured according to the given string. - */ - public static PlaceRequest parse(CharSequence partNameAndParams) { - Map parameters = new LinkedHashMap(); - - StringBuilder nextToken = new StringBuilder(50); - String foundPartName = null; - String key = null; - for (int i = 0; i < partNameAndParams.length(); i++) { - char ch = partNameAndParams.charAt(i); - switch (ch) { - case '%': - StringBuilder hexVal = new StringBuilder(2); - hexVal.append(partNameAndParams.charAt(i + 1)); - hexVal.append(partNameAndParams.charAt(i + 2)); - nextToken.append((char) Integer.parseInt(hexVal.toString(), - 16)); - i += 2; - break; - - case '?': - if (foundPartName == null) { - foundPartName = nextToken.toString(); - nextToken = new StringBuilder(50); - } else { - nextToken.append('?'); - } - break; - - case '=': - if (foundPartName == null) { - nextToken.append('='); - } else { - key = nextToken.toString(); - nextToken = new StringBuilder(50); - } - break; - - case '&': - parameters.put(key, - nextToken.toString()); - nextToken = new StringBuilder(50); - key = null; - break; - - default: - nextToken.append(ch); - } - } - - if (foundPartName == null) { - foundPartName = nextToken.toString(); - } else if (key != null) { - parameters.put(key, - nextToken.toString()); - } else if (nextToken.length() > 0) { - parameters.put(nextToken.toString(), - ""); - } - - return new DefaultPlaceRequest(foundPartName, - parameters); - } - - @Override - public String getIdentifier() { - return identifier; - } - - @Override - public void setIdentifier(String identifier) { - this.identifier = identifier; - } - - @Override - public String getFullIdentifier() { - StringBuilder fullIdentifier = new StringBuilder(); - fullIdentifier.append(this.getIdentifier()); - - if (!this.getParameterNames().isEmpty()) { - fullIdentifier.append("?"); - } - for (String name : this.getParameterNames()) { - fullIdentifier.append(name).append("=").append(this.getParameter(name, - null).toString()); - fullIdentifier.append("&"); - } - - if (fullIdentifier.length() != 0 && fullIdentifier.lastIndexOf("&") + 1 == fullIdentifier.length()) { - fullIdentifier.deleteCharAt(fullIdentifier.length() - 1); - } - - return fullIdentifier.toString(); - } - - //TODO: Throw ValueFormatException if conversion to a String is not possible - @Override - public String getParameter(final String key, - final String defaultValue) { - - final String value = parameters.get(key); - - if (value == null) { - return defaultValue; - } - return value; - } - - @Override - public Set getParameterNames() { - return parameters.keySet(); - } - - @Override - public Map getParameters() { - return parameters; - } - - @Override - public PlaceRequest addParameter(final String name, - final String value) { - this.parameters.put(name, - value); - return this; - } - - @Override - public PlaceRequest clone() { - return new DefaultPlaceRequest(identifier, - parameters); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (!(o instanceof DefaultPlaceRequest)) { - return false; - } - - final DefaultPlaceRequest that = (DefaultPlaceRequest) o; - - if (getIdentifier() != null ? !getIdentifier().equals(that.getIdentifier()) : that.getIdentifier() != null) { - return false; - } - return !(getParameters() != null ? !getParameters().equals(that.getParameters()) : that.getParameters() != null); - } - - @Override - public boolean isUpdateLocationBarAllowed() { - return updateLocationBar; - } - - @Override - public void setUpdateLocationBar(boolean updateLocationBar) { - this.updateLocationBar = updateLocationBar; - } - - @Override - public int hashCode() { - int result = identifier.hashCode(); - result = ~~result; - result = 31 * result + parameters.hashCode(); - result = ~~result; - return result; - } - - @Override - public String toString() { - return "PlaceRequest[\"" + identifier + "\" " + parameters + "]"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ForcedPlaceRequest.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ForcedPlaceRequest.java deleted file mode 100644 index 35751e25ba8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/impl/ForcedPlaceRequest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mvp.impl; - -import java.util.Map; - -import org.jboss.errai.common.client.api.annotations.Portable; - -@Portable -public class ForcedPlaceRequest - extends DefaultPlaceRequest { - - public ForcedPlaceRequest() { - super(""); - } - - public ForcedPlaceRequest(final String identifier) { - super(identifier); - } - - public ForcedPlaceRequest(final String identifier, - final Map parameters) { - super(identifier, - parameters); - } - - /** - * Creates a place request for the given place ID, with the given state parameters for that place, and the given - * preference of whether or not the browser's location bar should be updated. - * @param identifier The place ID, or an empty string for the default place. - * @param parameters Place-specific parameters to pass to the place. Must not be null. - * @param updateLocationBar If true, the browser's history will be updated with this place request. If false, the location bar - * will not be modified as a result of this place request. - */ - public ForcedPlaceRequest(final String identifier, - final Map parameters, - final boolean updateLocationBar) { - super(identifier, - parameters, - updateLocationBar); - } - - @Override - public String toString() { - return "ForcedPlaceRequest [identifier=" + identifier + ", parameters=" + parameters + "]"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/plugin/PluginUtil.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/plugin/PluginUtil.java deleted file mode 100644 index 4c540f56f46..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/plugin/PluginUtil.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.plugin; - -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import jsinterop.annotations.JsIgnore; -import jsinterop.annotations.JsType; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * Utilities for working with external (GWT-compiled) plugins. - */ -public class PluginUtil { - - private PluginUtil() { - } - - /** - * {@link List} is a {@link JsType} but {@link Collection#iterator()} is - * {@link JsIgnore}d and therefore not exported to JavaScript. - *

      - * This method takes a list and converts it to a new list so it can be - * iterated over in the current script (e.g. using enhanced for loops), even - * if the instance was provided by an external (GWT-compiled) script. - * - * @param externalList A list, possibly provided by an external script. Must not be null. - * @return an immutable list containing the original elements of the - * provided list - */ - public static List ensureIterable(List externalList) { - checkNotNull("externalList", - externalList); - - // toArray(T[]) is @JsIgnored - @SuppressWarnings("unchecked") - final List tmp = (List) Arrays.asList(externalList.toArray()); - return Collections.unmodifiableList(tmp); - } - - /** - * {@link Set} is a {@link JsType} but {@link Collection#iterator()} is - * {@link JsIgnore}d and therefore not exported to JavaScript. - *

      - * This method takes a set and converts it to a new set so it can be - * iterated over in the current script (e.g. using enhanced for loops), even - * if the instance was provided by an external (GWT-compiled) script. - * - * @param externalSet A set, possibly provided by an external script. Must not be null. - * @return an immutable set containing the original elements of the provided - * set - */ - public static Set ensureIterable(Set externalSet) { - checkNotNull("externalSet", - externalSet); - - // toArray(T[]) is @JsIgnored - @SuppressWarnings("unchecked") - final List tmp = (List) Arrays.asList(externalSet.toArray()); - return Collections.unmodifiableSet(new HashSet(tmp)); - } - - /** - * {@link Integer} is not a {@link JsType} and can't be shared across - * scripts. - *

      - * This method converts a regular int to an {@link Integer} using -1 as a - * placeholder for null. - * - * @param value - * @return boxed {@link Integer}, null if provided value is -1. - */ - public static Integer toInteger(int value) { - return (value != -1) ? value : null; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/util/URIUtil.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/util/URIUtil.java deleted file mode 100644 index 2335de87b2c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/util/URIUtil.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.util; - -import java.io.UnsupportedEncodingException; -import java.net.URI; -import java.net.URLDecoder; -import java.net.URLEncoder; - -/** - * Utilities for working with URIs that functions the same in both client and server code. - *

      - * Implementation note: there is a separate GWT super-source implementation of this class for client-side use. If - * modifying this class, be sure to go modify that one too. - */ -public final class URIUtil { - - public static String encode(final String content) { - try { - return URLEncoder.encode(content, - "UTF-8"); - } catch (UnsupportedEncodingException e) { - } - return null; - } - - public static String decode(final String content) { - try { - return URLDecoder.decode(content, - "UTF-8"); - } catch (UnsupportedEncodingException e) { - } - return null; - } - - public static String encodeQueryString(final String content) { - return encode(content); - } - - public static boolean isValid(final String uri) { - try { - URI.create(uri); - return true; - } catch (final Exception ignored) { - } - return false; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/NotificationEvent.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/NotificationEvent.java deleted file mode 100644 index 97ef4a3fe40..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/NotificationEvent.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.events; - -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.mvp.PlaceRequest; - -/** - * An event to show a notification pop-up in the Workbench - */ -@Portable -public class NotificationEvent implements UberFireEvent { - - private String notification; - private NotificationType type; - private boolean isSingleton; - private PlaceRequest placeRequest; - private Integer initialTopOffset; - private boolean autoHide = true; - private String navigationText; - private PlaceRequest navigationPlace; - - public NotificationEvent() { - } - - public NotificationEvent(final String notification) { - this(notification, - NotificationType.DEFAULT, - false, - null); - } - - public NotificationEvent(final String notification, - final NotificationType type) { - this(notification, - type, - false, - null); - } - - public NotificationEvent(final String notification, - final boolean isSingleton) { - this(notification, - NotificationType.DEFAULT, - isSingleton, - null); - } - - public NotificationEvent(final String notification, - final NotificationType type, - final boolean isSingleton) { - this(notification, - NotificationType.DEFAULT, - isSingleton, - null); - } - - public NotificationEvent(final String notification, - final NotificationType type, - final boolean isSingleton, - final PlaceRequest placeRequest) { - - this(notification, - type, - isSingleton, - placeRequest, - null); - } - - public NotificationEvent(final String notification, - final NotificationType type, - final boolean isSingleton, - final PlaceRequest placeRequest, - final Integer initialTopOffset) { - - this.notification = notification; - this.type = type; - this.isSingleton = isSingleton; - this.placeRequest = placeRequest; - this.initialTopOffset = initialTopOffset; - } - - public String getNotification() { - return this.notification; - } - - public NotificationType getType() { - return type; - } - - public boolean isSingleton() { - return isSingleton; - } - - public PlaceRequest getPlaceRequest() { - return placeRequest; - } - - public Integer getInitialTopOffset() { - return initialTopOffset; - } - - public NotificationEvent setAutoHide(final boolean autoHide) { - this.autoHide = autoHide; - return this; - } - - public boolean autoHide() { - return autoHide; - } - - public NotificationEvent setNavigation(final String text, - final PlaceRequest place) { - this.navigationText = text; - this.navigationPlace = place; - return this; - } - - public boolean hasNavigation() { - return navigationText != null - && navigationPlace != null; - } - - public String getNavigationText() { - return navigationText; - } - - public PlaceRequest getNavigationPlace() { - return navigationPlace; - } - - @Override - public String toString() { - return "NotificationEvent [notification=" + notification + ", type=" + type + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + (isSingleton ? 1231 : 1237); - result = prime * result + ((notification == null) ? 0 : notification.hashCode()); - result = prime * result + ((placeRequest == null) ? 0 : placeRequest.hashCode()); - result = prime * result + ((initialTopOffset == null) ? 0 : initialTopOffset.hashCode()); - result = prime * result + ((type == null) ? 0 : type.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - NotificationEvent other = (NotificationEvent) obj; - if (isSingleton != other.isSingleton) { - return false; - } - if (notification == null) { - if (other.notification != null) { - return false; - } - } else if (!notification.equals(other.notification)) { - return false; - } - if (placeRequest == null) { - if (other.placeRequest != null) { - return false; - } - } else if (!placeRequest.equals(other.placeRequest)) { - return false; - } - if (initialTopOffset == null) { - if (other.initialTopOffset != null) { - return false; - } - } else if (!initialTopOffset.equals(other.initialTopOffset)) { - return false; - } - if (type != other.type) { - return false; - } - return true; - } - - public static enum NotificationType { - DEFAULT, - ERROR, - SUCCESS, - INFO, - WARNING - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/UberFireEvent.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/UberFireEvent.java deleted file mode 100644 index e1715214cad..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/events/UberFireEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.events; - -/** - * Marker interface that serves to group all UberFire framework events - * together. For example, this allows you to create a single CDI observer that - * observes all framework events. - */ -public interface UberFireEvent { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ActivityResourceType.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ActivityResourceType.java deleted file mode 100644 index e169fbef42a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ActivityResourceType.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.uberfire.workbench.model; - -public enum ActivityResourceType { - UNKNOWN, - SCREEN, - PERSPECTIVE, - POPUP; - - -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/AppFormerActivities.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/AppFormerActivities.java deleted file mode 100644 index 9ef646ac6a3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/AppFormerActivities.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.workbench.model; - -import java.util.List; - -/** - * Defines the list of entities used in the workbench - * If no backend implementation for this class exists, a default one will be provided. - */ -public interface AppFormerActivities { - - /** - * Returns list of all the editors IDs used in the workbench. - * - * @return List of all editors. - */ - List getAllEditorIds(); - - /** - * Returns list of all the perspectives used in the workbench. - * - * @return List of all perspectives. - */ - List getAllPerpectivesIds(); - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CompassPosition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CompassPosition.java deleted file mode 100644 index d2e311af8a8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CompassPosition.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.api.annotations.Portable; - -/** - * Positions to which a WorkbenchPanel can be added to the Workbench - */ -@Portable -@JsType -public enum CompassPosition implements Position { - - NONE, - //Don't add anywhere - NORTH, - //North internal edge of a Parent panel - SOUTH, - //South internal edge of a Parent panel - EAST, - //East internal edge of a Parent panel - WEST, - //West internal edge of a Parent panel - SELF, - //Add to the Parent panel - ROOT, - //Add to the Workbench root - CENTER; // Add to the panel center - - @Override - public String getName() { - return name(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ContextDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ContextDefinition.java deleted file mode 100644 index 4dd248d424c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/ContextDefinition.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import jsinterop.annotations.JsType; -import org.uberfire.mvp.PlaceRequest; - -/** - * A Part in the Workbench. Parts are added to Panels. - */ -@JsType -public interface ContextDefinition { - - /** - * Get the PlaceRequest that this Part will contain. - * @return the place - */ - public PlaceRequest getPlace(); - - /** - * Set the PlaceRequest that this Part will contain. - * @param place the place to set - */ - public void setPlace(final PlaceRequest place); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java deleted file mode 100644 index 9fe1379361f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import java.util.Optional; - -import com.google.gwt.user.client.ui.HasWidgets; -import jsinterop.annotations.JsIgnore; -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.mvp.PlaceRequest; - -/** - * A custom {@link PanelDefinition} that is associated with a HasWidgets - * or HTMLElement container. See {@link PlaceManager#goTo(PlaceRequest, HasWidgets)} - * and {@link PlaceManager#goTo(PlaceRequest, HTMLElement)} - */ -@JsType -public interface CustomPanelDefinition extends PanelDefinition { - - /** - * Returns the HTMLElement container associated with the custom panel. - */ - @JsIgnore - Optional getHtmlElementContainer(); - - /** - * Returns the HasWidgets container associated with the custom panel. - */ - @JsIgnore - Optional getHasWidgetsContainer(); - - /** - * Returns the elemental2.dom.HTMLElement container associated with the custom panel. - */ - @JsIgnore - Optional getElemental2HtmlElementContainer(); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/NamedPosition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/NamedPosition.java deleted file mode 100644 index bfb7d88e572..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/NamedPosition.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.model; - -import org.jboss.errai.common.client.api.annotations.MapsTo; -import org.jboss.errai.common.client.api.annotations.Portable; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * Represents the position of a child panel by name. For example, within a templated perspective, panels are positioned - * by ErraiUI DataField names. - *

      - * Positions that refer to the same field name compare equal to each other. - *

      - * Instances of this class are immutable. - */ -@Portable -public class NamedPosition implements Position { - - /** - * Represents the root panel of any templated perspective. - */ - public static final NamedPosition ROOT = new NamedPosition(""); - - private final String fieldName; - - /** - * Creates a new position representing the ErraiUI {@code @DataField} with the given name. - * If you are trying to refer to the root of the template itself, use {@link #ROOT}. - * - * @param fieldName the name of the data field. Must be non-null. - */ - public NamedPosition(@MapsTo("fieldName") String fieldName) { - this.fieldName = checkNotNull("fieldName", - fieldName); - } - - /** - * Returns the data field name this Position refers to. - * - * @return a non-null string. For the special {@link #ROOT} position constant, this is the empty string. - */ - @Override - public String getName() { - return fieldName; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((fieldName == null) ? 0 : fieldName.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - NamedPosition other = (NamedPosition) obj; - if (fieldName == null) { - if (other.fieldName != null) { - return false; - } - } else if (!fieldName.equals(other.fieldName)) { - return false; - } - return true; - } - - @Override - public String toString() { - return "NamedPosition{" + - "fieldName='" + fieldName + '\'' + - '}'; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java deleted file mode 100644 index 5b29245fb01..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import java.util.List; -import java.util.Set; - -import jsinterop.annotations.JsIgnore; -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsType; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; - -/** - * Describes a physical region within a Workbench Perspective. Panels have a set physical size that they occupy, which - * is divided up between any panel decorations (a tab bar or dropdown list is common), one or more Parts (generally - * Editors or Screens), one of which can be visible at a time, and also child Panel Definitions, all of which are - * visible simultaneously. - */ -@JsType -public interface PanelDefinition { - - /** - * Special value for {@link #getPanelType()}. When adding a new child panel to a parent panel, if the child panel - * has this type, the parent can create any type of PanelPresenter it likes. Typically, each panel type will have - * some constant default child type that it uses in this scenario. - */ - String PARENT_CHOOSES_TYPE = "PARENT_CHOOSES_TYPE"; - - /** - * Returns the DOM ID that will be given to a panel created from this definition. If null, no ID attribute will be - * set on a panel created from this definition. - */ - public String getElementId(); - - /** - * Specifies the DOM ID that should be given to the live panel's element. Applications are responsible for ensuring - * the ID values are unique among all live panels. - * @param id the DOM ID to give the panel when it is created. If null, no ID will be set on the panel. - */ - public void setElementId(final String id); - - /** - * Specifies content that should be put in this panel's main display area when it is materialized. The content to - * add is specified by a PartDefinition, at the core of which is a {@link PlaceRequest} that identifies a - * WorkbenchActivity (either a screen or an editor). - *

      - * If the given part already belongs to an existing panel, it will be removed from that panel by a call to - * removePart(part). - * @param part The Part to add. Must not be null. The part's place must specify a WorkbenchActivity bean. - */ - public void addPart(final PartDefinition part); - - /** - * Specifies content that should be put in this panel's main display area when it is materialized. - *

      - * This is a convenience method equivalent to - * addPart(new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec))). - * @param partSpec An PlaceRequest ID with optional parameters, encoded as specified in - * {@link DefaultPlaceRequest#parse(CharSequence)}. Must not be null. The place ID must specify a - * WorkbenchActivity bean (either a screen or an editor). - * @return the PartDefinition object that was created and added to this panel definition. - */ - @JsMethod(name = "addPartById") - public PartDefinition addPart(final String partSpec); - - /** - * Removes the given part definition from this panel definition. - * @param part The Part to be removed - * @return true if the part was found and removed; false if it did not belong to this panel in the first place. - */ - public boolean removePart(final PartDefinition part); - - /** - * Get the Parts contained in the Panel - * @return The parts - */ - public Set getParts(); - - /** - * Returns this panel's immediate child panels. - * @return a snapshot of the current child list. The list is not modifiable, and will not change as panels are added - * and removed from this panel. The returned list is never null. - */ - public List getChildren(); - - /** - * Insert a Panel as an immediate child at the given Position. If this - * Panel already has a child at the specified position the existing Panel at - * that position becomes a child of the Panel being added at the same - * Position. - * @param position The Position to add the child - * @param panel The child Panel - */ - public void insertChild(final Position position, - final PanelDefinition panel); - - /** - * Append a Panel at the first empty child position. If this Panel already - * has a child at the specified position the descendants are followed until - * an empty position is found. - * @param position The Position to add the child - * @param panel The child Panel - */ - @JsMethod(name = "appendChildAtPosition") - public void appendChild(final Position position, - final PanelDefinition panel); - - /** - * Append a Panel at the first empty child position. If this Panel already - * has a child at the specified position the descendants are followed until - * an empty position is found. - * @param panel The child Panel - */ - public void appendChild( - final PanelDefinition panel); - - /** - * Return the parent panel, or null if {@link #isRoot()}} returns true. - * @return a parent panel definition or null if at the top of the hierarchy - */ - public PanelDefinition getParent(); - - /** - * Get the Panel's immediate child Panel at the given Position - * @param position The child Panel's Position - * @return The child Panel or null, if a child does not exist at the given - * Position - */ - public PanelDefinition getChild(final Position position); - - /** - * Remove a child from the Panel - * @param position - */ - public void removeChild(final Position position); - - /** - * Is this Panel the root of the Perspective definition - * @return True if the Panel is the root - */ - public boolean isRoot(); - - /** - * Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must - * refer to a Dependent-scoped Errai IOC bean type. - * @return fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but - * may be the special value {@link #PARENT_CHOOSES_TYPE}. - */ - public String getPanelType(); - - /** - * Specifies the WorkbenchPanelPresenter implementation that should be used when adding this panel to the UI. Must - * refer to a Dependent-scoped Errai IOC bean type. - * @param fqcn fully-qualified class name of the WorkbenchPanelPresenter implementation to use. Must not be null, but - * may be the special value {@link #PARENT_CHOOSES_TYPE}. - */ - public void setPanelType(String fqcn); - - /** - * Get the height of the Panel in pixels - * @return The height, or null if not set - */ - @JsIgnore - public Integer getHeight(); - - /** - * Set the height of this panel in pixels using a primitive int to make this method exportable to JS. - * @param width The width to set. - */ - default void setHeight(int height) { - setHeight(Integer.valueOf(height)); - } - - /** - * Get the height of this panel in pixels as a primitive int to make this method exportable to JS. - * @return The height, or -1 if not set. - */ - default int getHeightAsInt() { - final Integer height = getHeight(); - return (height != null) ? height : -1; - } - - /** - * Set the height of this panel in pixels. - * @param height The height to set. If null, the existing height value is retained. - */ - @JsIgnore - public void setHeight(Integer height); - - /** - * Get the width of this panel in pixels. - * @return The width, or null if not set. - */ - @JsIgnore - public Integer getWidth(); - - /** - * Set the width of this panel in pixels using a primitive int to make this method exportable to JS. - * @param width The width to set. - */ - default void setWidth(int width) { - setWidth(Integer.valueOf(width)); - } - - /** - * Get the width of this panel in pixels as a primitive int to make this method exportable to JS. - * @return The width, or -1 if not set. - */ - default int getWidthAsInt() { - final Integer width = getWidth(); - return (width != null) ? width : -1; - } - - /** - * Set the width of this panel in pixels. - * @param width The width to set. If null, the existing width value is retained. - */ - @JsIgnore - public void setWidth(Integer width); - - /** - * Get the minimum height of this panel in pixels. - * @return The minimum height, or null if not set. - */ - @JsIgnore - public Integer getMinHeight(); - - /** - * Set the minimum height of the Panel in pixels - * @param minHeight The minimum height, or null if not set - */ - @JsIgnore - public void setMinHeight(Integer minHeight); - - /** - * Get the minimum width of this panel in pixels as a primitive int to make this method exportable to JS. - * @return The height, or -1 if not set. - */ - default int getMinHeightAsInt() { - final Integer height = getMinHeight(); - return (height != null) ? height : -1; - } - - /** - * Get the minimum width of the Panel in pixels - * @return The minimum width, or null if not set - */ - @JsIgnore - public Integer getMinWidth(); - - /** - * Set the minimum width of the Panel in pixels - * @param minWidth The width, or null if not set - */ - @JsIgnore - public void setMinWidth(Integer minWidth); - - /** - * Get the minimum width of this panel in pixels as a primitive int to make this method exportable to JS. - * @return The width, or -1 if not set. - */ - default int getMinWidthAsInt() { - final Integer width = getMinWidth(); - return (width != null) ? width : -1; - } - - /** - * Get the Position of the Panel relate to it's Parent - *

      - * TODO remove this. parent panels should track the positions of their children; making it a property of the child - * is error-prone when moving panels around in the UI. - * @return The Position of the Panel - */ - public Position getPosition(); - - /** - * Set the Position of the Panel relative to it's parent. - *

      - * TODO remove this. parent panels should track the positions of their children; making it a property of the child - * is error-prone when moving panels around in the UI. - * @param position The Position of the Panel relative to it's parent - */ - public void setPosition(Position position); - - /** - * Has the Panel been expanded to a maximum size - * @return true If maximized - */ - public boolean isMaximized(); - - ContextDefinition getContextDefinition(); - - void setContextDefinition(final ContextDefinition contextDefinition); - - ContextDisplayMode getContextDisplayMode(); - - void setContextDisplayMode(final ContextDisplayMode contextDisplayMode); - - /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. - */ - default String asString() { - return this.toString(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java deleted file mode 100644 index f41a1c166af..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import jsinterop.annotations.JsType; -import org.uberfire.mvp.PlaceRequest; - -/** - * Describes the assignment of a {@link PlaceRequest} to a tab/card/item in a {@link PanelDefinition}. Given this - * information, you can find out (or dictate) which panel within the current perspective will contain the GUI element - * for the given PlaceRequest. However, the {@link PartDefinition} does not contain any information about the GUI - * itself, presumably because PartDefinition objects can be sent to the server. The UI (Widget) information is contained - * with UIPart. The mapping of PartDefinitions to UIParts is maintained by a PanelManager. - */ -@JsType -public interface PartDefinition { - - PlaceRequest getPlace(); - - void setPlace(final PlaceRequest place); - - PanelDefinition getParentPanel(); - - void setParentPanel(final PanelDefinition parentPanel); - - ContextDefinition getContextDefinition(); - - void setContextDefinition(final ContextDefinition contextDefinition); - - ContextDisplayMode getContextDisplayMode(); - - void setContextDisplayMode(final ContextDisplayMode contextDisplayMode); - - /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. - */ - default String asString() { - return this.toString(); - } - - boolean isSelectable(); - - void setSelectable(boolean selectable); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PerspectiveDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PerspectiveDefinition.java deleted file mode 100644 index d40040ab116..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PerspectiveDefinition.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import jsinterop.annotations.JsType; - -/** - * Meta-data defining a Perspective. A Perspective is a set of Panels and Parts arranged within the Workbench. The - * Workbench has exactly one active Perspective at a time. The Perspective contains multiple Panels. Each Panel contains - * multiple Parts, one of which can be visible at a time. Panels can also contain child panels which are all visible at - * the same time are are physically located within the bounds of the parent panel. Each Part is associated with one - * PlaceRequest. - *

      - * Implementations of this interface must be marked with Errai's {@code @Portable} annotation. - */ -@JsType -public interface PerspectiveDefinition { - - /** - * Get the name of the Perspective. - * @return The name of the Perspective. - */ - public String getName(); - - /** - * Set the name of the Perspective. - * @param name The name of the Perspective. - */ - public void setName(final String name); - - /** - * Get the root Panel for this Perspective. The root Panel contains all - * child Panels. A Perspective is based on a single root Panel. - * @return The root Panel. - */ - public PanelDefinition getRoot(); - - ContextDefinition getContextDefinition(); - - void setContextDefinition(final ContextDefinition contextDefinition); - - ContextDisplayMode getContextDisplayMode(); - - void setContextDisplayMode(final ContextDisplayMode contextDisplayMode); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/Position.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/Position.java deleted file mode 100644 index 0b0b96e8003..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/Position.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model; - -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.api.annotations.Portable; - -/** - * Tells a PanelManager implementation where to place a part within a panel. Each PanelManager has its own layout - * system, and implements its own unique set of Position objects (for example, the North-South-East-West panel manager - * uses compass directions, and the Templated panel manager uses element names). - *

      - * All implementations of this interface must be marked as {@link Portable}. - */ -@JsType -public interface Position { - - String getName(); -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/ContextDefinitionImpl.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/ContextDefinitionImpl.java deleted file mode 100644 index 6224783853d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/ContextDefinitionImpl.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.model.impl; - -import org.jboss.errai.common.client.api.annotations.MapsTo; -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.ContextDefinition; - -@Portable -public class ContextDefinitionImpl implements ContextDefinition { - - private PlaceRequest place; - - public ContextDefinitionImpl(@MapsTo("place") final PlaceRequest place) { - this.place = place; - } - - @Override - public PlaceRequest getPlace() { - return place; - } - - @Override - public void setPlace(final PlaceRequest place) { - this.place = place; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/CustomPanelDefinitionImpl.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/CustomPanelDefinitionImpl.java deleted file mode 100644 index 028ca938385..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/CustomPanelDefinitionImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model.impl; - -import java.util.Optional; - -import com.google.gwt.user.client.ui.HasWidgets; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.workbench.model.CustomPanelDefinition; - -public class CustomPanelDefinitionImpl extends PanelDefinitionImpl implements CustomPanelDefinition { - - private HTMLElement htmlElementContainer; - private HasWidgets hasWidgetsContainer; - private elemental2.dom.HTMLElement elemental2HtmlElementContainer; - - public CustomPanelDefinitionImpl(String panelType, - HasWidgets hasWidgetsContainer) { - - super(panelType); - this.hasWidgetsContainer = hasWidgetsContainer; - } - - public CustomPanelDefinitionImpl(String panelType, - HTMLElement htmlElementContainer) { - super(panelType); - this.htmlElementContainer = htmlElementContainer; - } - - public CustomPanelDefinitionImpl(String panelType, - elemental2.dom.HTMLElement htmlElementContainer){ - super(panelType); - this.elemental2HtmlElementContainer = htmlElementContainer; - } - - @Override - public Optional getHtmlElementContainer() { - return Optional.ofNullable(htmlElementContainer); - } - - @Override - public Optional getHasWidgetsContainer() { - return Optional.ofNullable(hasWidgetsContainer); - } - - @Override - public Optional getElemental2HtmlElementContainer() { - return Optional.ofNullable(elemental2HtmlElementContainer); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PanelDefinitionImpl.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PanelDefinitionImpl.java deleted file mode 100644 index ae0a97cf934..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PanelDefinitionImpl.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model.impl; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; - -import jsinterop.annotations.JsIgnore; -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.CompassPosition; -import org.uberfire.workbench.model.ContextDefinition; -import org.uberfire.workbench.model.ContextDisplayMode; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PartDefinition; -import org.uberfire.workbench.model.Position; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; -import static org.uberfire.workbench.model.ContextDisplayMode.SHOW; - -/** - * Default implementation of PanelDefinition - */ -@Portable -@JsType -public class PanelDefinitionImpl implements PanelDefinition { - - private final Set parts = new LinkedHashSet<>(); - //Ideally this should be a Set but the order of insertion is important - private final List children = new ArrayList(); - private Integer height = null; - private Integer width = null; - private Integer minHeight = null; - private Integer minWidth = null; - private String elementId; - private Position position; - private String panelType; - private boolean isRoot; - private ContextDefinition contextDefinition; - private ContextDisplayMode contextDisplayMode = SHOW; - private PanelDefinition parent = null; - - @JsIgnore - public PanelDefinitionImpl() { - this("org.uberfire.client.workbench.panels.impl.MultiTabWorkbenchPanelPresenter"); - } - - @JsIgnore - public PanelDefinitionImpl(final String type) { - this.panelType = type; - } - - @Override - public PanelDefinition getParent() { - return parent; - } - - public void setParent(PanelDefinition parent) { - if (this.parent != null && parent != null) { - throw new IllegalStateException("Can't change parent: this panel still belongs to " + this.parent); - } - this.parent = parent; - } - - @Override - public String getElementId() { - return elementId; - } - - @Override - public void setElementId(String id) { - elementId = id; - } - - @Override - public void addPart(final PartDefinition part) { - if (part.getParentPanel() != null) { - part.getParentPanel().removePart(part); - } - this.parts.add(part); - part.setParentPanel(this); - } - - @Override - public PartDefinition addPart(String partSpec) { - PartDefinition pd = new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec)); - addPart(pd); - return pd; - } - - @Override - public boolean removePart(PartDefinition part) { - if (this.parts.remove(part)) { - part.setParentPanel(null); - return true; - } - return false; - } - - @Override - @JsIgnore - public Set getParts() { - return parts; - } - - @Override - @JsIgnore - public List getChildren() { - return Collections.unmodifiableList(new ArrayList(children)); - } - - @Override - public void insertChild(final Position position, - final PanelDefinition panel) { - if (panel == null) { - return; - } - if (children.contains(panel)) { - return; - } - - // parent wiring - ((PanelDefinitionImpl) panel).setParent(this); - - checkPosition(position); - panel.setPosition(position); - final PanelDefinition existingChild = getChild(position); - if (existingChild == null) { - children.add(panel); - } else { - removeChild(position); - children.add(panel); - panel.insertChild(position, - existingChild); - } - } - - @Override - public void appendChild(final Position position, - final PanelDefinition panel) { - - if (panel == null) { - return; - } - if (children.contains(panel)) { - return; - } - checkPosition(position); - panel.setPosition(position); - final PanelDefinition existingChild = getChild(position); - if (existingChild == null) { - - // parent wiring - ((PanelDefinitionImpl) panel).setParent(this); - - children.add(panel); - } else { - existingChild.appendChild(position, - panel); - } - } - - @Override - public void appendChild(final PanelDefinition panel) { - - if (panel == null) { - return; - } - if (children.contains(panel)) { - return; - } - - // parent wiring - ((PanelDefinitionImpl) panel).setParent(this); - - children.add(panel); - } - - @Override - public PanelDefinition getChild(final Position position) { - for (PanelDefinition child : children) { - if (child.getPosition() == position) { - return child; - } - } - return null; - } - - @Override - public void removeChild(final Position position) { - Iterator itr = children.iterator(); - while (itr.hasNext()) { - final PanelDefinition child = itr.next(); - if (child.getPosition() == position) { - // parent wiring - ((PanelDefinitionImpl) child).setParent(null); - - itr.remove(); - } - } - } - - @Override - public boolean isRoot() { - return isRoot; - } - - public void setRoot(boolean isRoot) { - this.isRoot = isRoot; - } - - @Override - public String getPanelType() { - return panelType; - } - - @Override - public void setPanelType(String fqcn) { - this.panelType = checkNotNull("fqcn", - fqcn); - } - - @Override - @JsIgnore - public Integer getHeight() { - return height; - } - - @Override - @JsIgnore - public void setHeight(Integer height) { - if (height != null) { - this.height = height; - } - } - - @Override - @JsIgnore - public Integer getWidth() { - return width; - } - - @Override - @JsIgnore - public void setWidth(Integer width) { - if (width != null) { - this.width = width; - } - } - - @Override - @JsIgnore - public final Integer getMinHeight() { - return minHeight; - } - - @Override - @JsIgnore - public final void setMinHeight(Integer minHeight) { - this.minHeight = minHeight; - } - - @Override - @JsIgnore - public final Integer getMinWidth() { - return minWidth; - } - - @Override - @JsIgnore - public final void setMinWidth(Integer minWidth) { - this.minWidth = minWidth; - } - - @Override - public final Position getPosition() { - return position; - } - - @Override - public void setPosition(final Position position) { - this.position = position; - } - - @Override - public boolean isMaximized() { - return false; - } - - @Override - public ContextDefinition getContextDefinition() { - return contextDefinition; - } - - @Override - public void setContextDefinition(final ContextDefinition contextDefinition) { - this.contextDefinition = contextDefinition; - } - - @Override - public ContextDisplayMode getContextDisplayMode() { - return contextDisplayMode; - } - - @Override - public void setContextDisplayMode(final ContextDisplayMode contextDisplayMode) { - this.contextDisplayMode = contextDisplayMode; - } - - private void checkPosition(final Position position) { - if (position == CompassPosition.ROOT || position == CompassPosition.SELF || position == CompassPosition.NONE) { - throw new IllegalArgumentException("Position must be NORTH, SOUTH, EAST or WEST"); - } - } - - @Override - public String toString() { - String fullName = getClass().getName(); - String simpleName = fullName.substring(fullName.lastIndexOf('.') + 1); - return simpleName + " [id=" + elementId + ", parts=" + parts + ", children=" + children + ", panelType=" + panelType - + ", contextDefinition=" + contextDefinition + ", contextDisplayMode=" + contextDisplayMode + "]"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PartDefinitionImpl.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PartDefinitionImpl.java deleted file mode 100644 index 9f04bd4967c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PartDefinitionImpl.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model.impl; - -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.ContextDefinition; -import org.uberfire.workbench.model.ContextDisplayMode; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PartDefinition; - -import static org.uberfire.workbench.model.ContextDisplayMode.SHOW; - -/** - * Default implementation of PartDefinition - */ -@Portable -public class PartDefinitionImpl - implements - PartDefinition { - - private PlaceRequest place; - - private PanelDefinition parentPanel; - - private ContextDefinition contextDefinition; - private ContextDisplayMode contextDisplayMode = SHOW; - - private boolean selectable = true; - - public PartDefinitionImpl() { - } - - public PartDefinitionImpl(final PlaceRequest place) { - this.place = place; - } - - /** - * @return the place - */ - @Override - public PlaceRequest getPlace() { - return place; - } - - /** - * @param place the place to set - */ - @Override - public void setPlace(final PlaceRequest place) { - this.place = place; - } - - /** - * @return the parentPanel - */ - @Override - public PanelDefinition getParentPanel() { - return parentPanel; - } - - /** - * @param parentPanel the parentPanel to set - */ - @Override - public void setParentPanel(final PanelDefinition parentPanel) { - if (parentPanel != null && this.parentPanel != null) { - throw new IllegalStateException("Can't set parent: this part already belongs to " + this.parentPanel); - } - this.parentPanel = parentPanel; - } - - @Override - public ContextDefinition getContextDefinition() { - return contextDefinition; - } - - @Override - public void setContextDefinition(final ContextDefinition contextDefinition) { - this.contextDefinition = contextDefinition; - } - - @Override - public ContextDisplayMode getContextDisplayMode() { - return contextDisplayMode; - } - - @Override - public void setContextDisplayMode(final ContextDisplayMode contextDisplayMode) { - this.contextDisplayMode = contextDisplayMode; - } - - @Override - public boolean isSelectable() { - return this.selectable; - } - - @Override - public void setSelectable(final boolean selectable) { - this.selectable = selectable; - } - - @Override - public int hashCode() { - return this.place.hashCode(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null) { - return false; - } - if (!(o instanceof PartDefinitionImpl)) { - return false; - } - - PartDefinitionImpl that = (PartDefinitionImpl) o; - - return place.equals(that.place); - } - - @Override - public String toString() { - return "PartDefinitionImpl [place=" + place + "]"; - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PerspectiveDefinitionImpl.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PerspectiveDefinitionImpl.java deleted file mode 100644 index c64a4f133ff..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/impl/PerspectiveDefinitionImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.workbench.model.impl; - -import org.jboss.errai.common.client.api.annotations.Portable; -import org.uberfire.workbench.model.ContextDefinition; -import org.uberfire.workbench.model.ContextDisplayMode; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PerspectiveDefinition; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; -import static org.uberfire.workbench.model.ContextDisplayMode.SHOW; - -/** - * Default implementation of PerspectiveDefinition - */ -@Portable -public class PerspectiveDefinitionImpl - implements - PerspectiveDefinition { - - private final PanelDefinition root; - private String name; - private ContextDefinition contextDefinition; - private ContextDisplayMode contextDisplayMode = SHOW; - - public PerspectiveDefinitionImpl() { - this("org.uberfire.client.workbench.panels.impl.MultiTabWorkbenchPanelPresenter"); - } - - public PerspectiveDefinitionImpl(final String panelType) { - checkNotNull("type", - panelType); - PanelDefinitionImpl root = new PanelDefinitionImpl(panelType); - root.setRoot(true); - this.root = root; - } - - @Override - public String getName() { - return name; - } - - @Override - public void setName(final String name) { - this.name = name; - } - - @Override - public PanelDefinition getRoot() { - return root; - } - - @Override - public ContextDefinition getContextDefinition() { - return contextDefinition; - } - - @Override - public void setContextDefinition(final ContextDefinition contextDefinition) { - this.contextDefinition = contextDefinition; - } - - @Override - public ContextDisplayMode getContextDisplayMode() { - return contextDisplayMode; - } - - @Override - public void setContextDisplayMode(final ContextDisplayMode contextDisplayMode) { - this.contextDisplayMode = contextDisplayMode; - } - - @Override - public String toString() { - return "PerspectiveDefinitionImpl [name=" + name + ", contextDefinition=" + contextDefinition - + ", contextDisplayMode=" + contextDisplayMode + "]"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/URIUtil.java b/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/URIUtil.java deleted file mode 100644 index 5d107b95ea6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/URIUtil.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.util; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.ScriptInjector; -import com.google.gwt.http.client.URL; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.TextResource; - -/** - * GWT client-side implementation of URIUtil which relies on URI.js. - */ -public final class URIUtil { - - private static final Resources RESOURCES = GWT.create(Resources.class); - - static { - ScriptInjector.fromString(RESOURCES.uriDotJs().getText()).inject(); - } - - public static String encode(String content) { - return URL.encode(content); - } - - public static String decode(String content) { - return URL.decode(content); - } - - public static String encodeQueryString(String content) { - return URL.encodeQueryString(content); - } - - public native static boolean isValid(final String uri) /*-{ - var components = URI.parse(uri); - if (typeof components.errors !== 'undefined' && components.errors.length > 0) { - return false; - } - if (components.reference != "absolute") { - return false; - } - return true; - }-*/; - - interface Resources extends ClientBundle { - - @Source("uri.min.js") - TextResource uriDotJs(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/uri.min.js b/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/uri.min.js deleted file mode 100644 index 6965182a68a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/resources/org/uberfire/jre/org/uberfire/util/uri.min.js +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* - URI.js v2.0.0 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js -*/ -var URI = (function () { - function f() { - for (var a = [], b = 0; b < arguments.length; b++) a[b - 0] = arguments[b]; - if (1 < a.length) { - a[0] = a[0].slice(0, -1); - for (var b = a.length - 1, d = 1; d < b; ++d) a[d] = a[d].slice(1, -1); - a[b] = a[b].slice(1); - return a.join(""); - } - return a[0]; - } - function k(a) { - a = a.charCodeAt(0); - var b; - 16 > a - ? (b = "%0" + a.toString(16).toUpperCase()) - : 128 > a - ? (b = "%" + a.toString(16).toUpperCase()) - : (b = - 2048 > a - ? "%" + ((a >> 6) | 192).toString(16).toUpperCase() + "%" + ((a & 63) | 128).toString(16).toUpperCase() - : "%" + - ((a >> 12) | 224).toString(16).toUpperCase() + - "%" + - (((a >> 6) & 63) | 128).toString(16).toUpperCase() + - "%" + - ((a & 63) | 128).toString(16).toUpperCase()); - return b; - } - function p(a) { - for (var b = "", d = 0, e = a.length, c, f, g; d < e; ) - (c = parseInt(a.substr(d + 1, 2), 16)), - 128 > c - ? ((b += String.fromCharCode(c)), (d += 3)) - : 194 <= c && 224 > c - ? (6 <= e - d - ? ((f = parseInt(a.substr(d + 4, 2), 16)), (b += String.fromCharCode(((c & 31) << 6) | (f & 63)))) - : (b += a.substr(d, 6)), - (d += 6)) - : 224 <= c - ? (9 <= e - d - ? ((f = parseInt(a.substr(d + 4, 2), 16)), - (g = parseInt(a.substr(d + 7, 2), 16)), - (b += String.fromCharCode(((c & 15) << 12) | ((f & 63) << 6) | (g & 63)))) - : (b += a.substr(d, 9)), - (d += 9)) - : ((b += a.substr(d, 3)), (d += 3)); - return b; - } - function q(a) { - return void 0 === a - ? "undefined" - : null === a - ? "null" - : Object.prototype.toString.call(a).split(" ").pop().split("]").shift().toLowerCase(); - } - function m(a) { - return a.toUpperCase(); - } - function t(a, b) { - function d(a) { - var c = p(a); - return c.match(b.m) ? c : a; - } - a.scheme && (a.scheme = String(a.scheme).replace(b.a, d).toLowerCase().replace(b.j, "")); - void 0 !== a.userinfo && (a.userinfo = String(a.userinfo).replace(b.a, d).replace(b.l, k).replace(b.a, m)); - void 0 !== a.host && (a.host = String(a.host).replace(b.a, d).toLowerCase().replace(b.f, k).replace(b.a, m)); - void 0 !== a.path && - (a.path = String(a.path) - .replace(b.a, d) - .replace(a.scheme ? b.g : b.h, k) - .replace(b.a, m)); - void 0 !== a.query && (a.query = String(a.query).replace(b.a, d).replace(b.i, k).replace(b.a, m)); - void 0 !== a.fragment && (a.fragment = String(a.fragment).replace(b.a, d).replace(b.c, k).replace(b.a, m)); - } - function h(a, b) { - void 0 === b && (b = {}); - var d = n, - e, - c = {}; - "suffix" === b.reference && (a = (b.scheme ? b.scheme + ":" : "") + "//" + a); - (e = a.match(z)) - ? (A - ? ((c.scheme = e[1]), - (c.userinfo = e[3]), - (c.host = e[4]), - (c.port = parseInt(e[5], 10)), - (c.path = e[6] || ""), - (c.query = e[7]), - (c.fragment = e[8]), - isNaN(c.port) && (c.port = e[5])) - : ((c.scheme = e[1] || void 0), - (c.userinfo = -1 !== a.indexOf("@") ? e[3] : void 0), - (c.host = -1 !== a.indexOf("//") ? e[4] : void 0), - (c.port = parseInt(e[5], 10)), - (c.path = e[6] || ""), - (c.query = -1 !== a.indexOf("?") ? e[7] : void 0), - (c.fragment = -1 !== a.indexOf("#") ? e[8] : void 0), - isNaN(c.port) && (c.port = a.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? e[4] : void 0)), - (c.reference = - void 0 !== c.scheme || - void 0 !== c.userinfo || - void 0 !== c.host || - void 0 !== c.port || - c.path || - void 0 !== c.query - ? void 0 === c.scheme - ? "relative" - : void 0 === c.fragment - ? "absolute" - : "uri" - : "same-document"), - b.reference && - "suffix" !== b.reference && - b.reference !== c.reference && - (c.error = c.error || "URI is not a " + b.reference + " reference."), - (e = r[(b.scheme || c.scheme || "").toLowerCase()]), - t(c, d), - e && e.parse && e.parse(c, b)) - : (c.error = c.error || "URI can not be parsed."); - return c; - } - function u(a) { - var b = []; - void 0 !== a.userinfo && (b.push(a.userinfo), b.push("@")); - void 0 !== a.host && b.push(a.host); - "number" === typeof a.port && (b.push(":"), b.push(a.port.toString(10))); - return b.length ? b.join("") : void 0; - } - function l(a) { - for (var b = [], d; a.length; ) - a.match(v) - ? (a = a.replace(v, "")) - : a.match(w) - ? (a = a.replace(w, "/")) - : a.match(x) - ? ((a = a.replace(x, "/")), b.pop()) - : "." === a || ".." === a - ? (a = "") - : ((d = a.match(B)[0]), (a = a.slice(d.length)), b.push(d)); - return b.join(""); - } - function g(a, b) { - void 0 === b && (b = {}); - var d = n, - e = [], - c, - f; - (c = r[(b.scheme || a.scheme || "").toLowerCase()]) && c.serialize && c.serialize(a, b); - t(a, d); - "suffix" !== b.reference && a.scheme && (e.push(a.scheme), e.push(":")); - d = u(a); - void 0 !== d && - ("suffix" !== b.reference && e.push("//"), e.push(d), a.path && "/" !== a.path.charAt(0) && e.push("/")); - void 0 !== a.path && - ((f = a.path), - b.absolutePath || (c && c.absolutePath) || (f = l(f)), - void 0 === d && (f = f.replace(/^\/\//, "/%2F")), - e.push(f)); - void 0 !== a.query && (e.push("?"), e.push(a.query)); - void 0 !== a.fragment && (e.push("#"), e.push(a.fragment)); - return e.join(""); - } - function y(a, b, d, e) { - void 0 === d && (d = {}); - var c = {}; - e || ((a = h(g(a, d), d)), (b = h(g(b, d), d))); - d = d || {}; - !d.tolerant && b.scheme - ? ((c.scheme = b.scheme), - (c.userinfo = b.userinfo), - (c.host = b.host), - (c.port = b.port), - (c.path = l(b.path)), - (c.query = b.query)) - : (void 0 !== b.userinfo || void 0 !== b.host || void 0 !== b.port - ? ((c.userinfo = b.userinfo), (c.host = b.host), (c.port = b.port), (c.path = l(b.path)), (c.query = b.query)) - : (b.path - ? ("/" === b.path.charAt(0) - ? (c.path = l(b.path)) - : ((void 0 === a.userinfo && void 0 === a.host && void 0 === a.port) || a.path - ? a.path - ? (c.path = a.path.slice(0, a.path.lastIndexOf("/") + 1) + b.path) - : (c.path = b.path) - : (c.path = "/" + b.path), - (c.path = l(c.path))), - (c.query = b.query)) - : ((c.path = a.path), (c.query = void 0 !== b.query ? b.query : a.query)), - (c.userinfo = a.userinfo), - (c.host = a.host), - (c.port = a.port)), - (c.scheme = a.scheme)); - c.fragment = b.fragment; - return c; - } - var n = (function (a) { - var b = f("[0-9]", "[A-Fa-f]"), - d = f( - "[A-Za-z]", - "[0-9]", - "[\\-\\.\\_\\~]", - a ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]" - ); - return { - s: !1, - j: new RegExp(f("[^]", "[A-Za-z]", "[0-9]", "[\\+\\-\\.]"), "g"), - l: new RegExp(f("[^\\%\\:]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]"), "g"), - f: new RegExp(f("[^\\%]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]"), "g"), - g: new RegExp(f("[^\\%\\/\\:\\@]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]"), "g"), - h: new RegExp(f("[^\\%\\/\\@]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]"), "g"), - i: new RegExp( - f("[^\\%]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", "[\\:\\@\\/\\?]", a ? "[\\uE000-\\uF8FF]" : "[]"), - "g" - ), - c: new RegExp(f("[^\\%]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", "[\\:\\@\\/\\?]"), "g"), - b: new RegExp(f("[^]", d, "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]"), "g"), - m: new RegExp(d, "g"), - o: new RegExp(f("[^\\%]", d, f("[\\:\\/\\?\\#\\[\\]\\@]", "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]")), "g"), - a: new RegExp( - "(?:" + - ("(?:" + - ("%[EFef]" + b + "%" + b + b + "%" + b + b) + - ")|" + - ("(?:" + ("%[89A-Fa-f]" + b + "%" + b + b) + ")") + - "|" + - ("(?:" + ("%" + b + b) + ")")) + - ")", - "g" - ), - }; - })(!1), - z = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?([^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n)*))?/i, - v = /^\.\.?\//, - w = /^\/\.(\/|$)/, - x = /^\/\.\.(\/|$)/, - B = /^\/?(?:.|\n)*?(?=\/|$)/, - A = void 0 === "".match(/(){0}/)[1], - r = {}; - return { - IRI_SUPPORT: !1, - VALIDATE_SUPPORT: !1, - pctEncChar: k, - pctDecChars: p, - SCHEMES: r, - parse: h, - _recomposeAuthority: u, - removeDotSegments: l, - serialize: g, - resolveComponents: y, - resolve: function (a, b, d) { - return g(y(h(a, d), h(b, d), d, !0), d); - }, - normalize: function (a, b) { - "string" === typeof a ? (a = g(h(a, b), b)) : "object" === q(a) && (a = h(g(a, b), b)); - return a; - }, - equal: function (a, b, d) { - "string" === typeof a ? (a = g(h(a, d), d)) : "object" === q(a) && (a = g(a, d)); - "string" === typeof b ? (b = g(h(b, d), d)) : "object" === q(b) && (b = g(b, d)); - return a === b; - }, - escapeComponent: function (a) { - return a && a.toString().replace(n.b, k); - }, - unescapeComponent: function (a) { - return a && a.toString().replace(n.a, p); - }, - }; -})(); -URI.SCHEMES.http = URI.SCHEMES.https = { - domainHost: !0, - parse: function (f) { - f.host || (f.error = f.error || "HTTP URIs must have a host."); - return f; - }, - serialize: function (f) { - if (f.port === ("https" !== String(f.scheme).toLowerCase() ? 80 : 443) || "" === f.port) f.port = void 0; - f.path || (f.path = "/"); - return f; - }, -}; diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/NaughtyClassInDefaultPackage.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/NaughtyClassInDefaultPackage.java deleted file mode 100644 index c28e0d5a707..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/NaughtyClassInDefaultPackage.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import org.uberfire.debug.Debug; - -/** - * This class is used for testing the handling of classes in the default package for various methods in {@link Debug}. - */ -public class NaughtyClassInDefaultPackage { - -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/debug/DebugTest.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/debug/DebugTest.java deleted file mode 100644 index 483ff5ba2e9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/debug/DebugTest.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.debug; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class DebugTest { - - @Test - public void testAbbreviatedName() { - assertEquals("ju.List", - Debug.abbreviatedName(List.class)); - } - - @Test - public void testMemorableNumber() { - assertEquals("badodyre", - Debug.toMemorableString(56385664)); - } - - @Test - public void testMemorableWithNegativeNumber() { - assertEquals("d", - Debug.toMemorableString(-1)); - } - - @Test - public void testMemorableWithZero() { - assertEquals("b", - Debug.toMemorableString(0)); - } - - @Test - public void testObjectId() { - Map m = new HashMap(); - assertEquals(Debug.abbreviatedName(m.getClass()) + "@" + Debug.toMemorableString(System.identityHashCode(m)), - Debug.objectId(m)); - } - - - @Test - public void testShortNameWithInnerClass() { - assertEquals("Map$Entry", - Debug.shortName(Map.Entry.class)); - } - - @Test - public void testShortNameInDefaultPackage() throws Exception { - assertEquals("NaughtyClassInDefaultPackage", - Debug.shortName(Class.forName("NaughtyClassInDefaultPackage"))); - } - - @Test - public void testAbbreviatedNameInDefaultPackage() throws Exception { - assertEquals("NaughtyClassInDefaultPackage", - Debug.abbreviatedName(Class.forName("NaughtyClassInDefaultPackage"))); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/mvp/impl/ConditionalPlaceRequestTest.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/mvp/impl/ConditionalPlaceRequestTest.java deleted file mode 100644 index 073fc060cd0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/mvp/impl/ConditionalPlaceRequestTest.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.mvp.impl; - -import org.junit.Test; -import org.uberfire.mvp.PlaceRequest; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotEquals; -import static org.junit.Assert.assertTrue; - -public class ConditionalPlaceRequestTest { - - @Test - public void conditionalTestTruePredicate() { - DefaultPlaceRequest other = new DefaultPlaceRequest("other"); - ConditionalPlaceRequest dora = (ConditionalPlaceRequest) new ConditionalPlaceRequest("dora").when(p -> true) - .orElse(other); - assertEquals(dora, - dora.resolveConditionalPlaceRequest()); - } - - @Test - public void conditionalTestFalsePredicate() { - DefaultPlaceRequest other = new DefaultPlaceRequest("other"); - ConditionalPlaceRequest dora = (ConditionalPlaceRequest) new ConditionalPlaceRequest("dora").when(p -> false) - .orElse(other); - assertEquals(other, - dora.resolveConditionalPlaceRequest()); - } - - @Test - public void incompleteConditionalShouldReturnDefaultPlaceRequest() { - ConditionalPlaceRequest dora = new ConditionalPlaceRequest("dora"); - assertEquals("dora", - dora.resolveConditionalPlaceRequest().getIdentifier()); - } - - @Test - public void incompleteConditionalWithNullsShouldReturnDefaultPlaceRequest() { - ConditionalPlaceRequest dora = (ConditionalPlaceRequest) new ConditionalPlaceRequest("dora").when(null).orElse(null); - assertEquals("dora", - dora.resolveConditionalPlaceRequest().getIdentifier()); - } - - @Test - public void conditionalTestChainingPredicate() { - DefaultPlaceRequest my = new DefaultPlaceRequest("my"); - ConditionalPlaceRequest bento = (ConditionalPlaceRequest) new ConditionalPlaceRequest("bento").when(p -> false) - .orElse(my); - ConditionalPlaceRequest dora = (ConditionalPlaceRequest) new ConditionalPlaceRequest("dora").when(p -> false) - .orElse(bento); - assertEquals(my, - dora.resolveConditionalPlaceRequest()); - } - - @Test - public void conditionalTestChainingPredicateReturningConditional() { - DefaultPlaceRequest my = new DefaultPlaceRequest("my"); - ConditionalPlaceRequest bento = (ConditionalPlaceRequest) new ConditionalPlaceRequest("bento").when(p -> true) - .orElse(my); - ConditionalPlaceRequest dora = (ConditionalPlaceRequest) new ConditionalPlaceRequest("dora").when(p -> false) - .orElse(bento); - assertEquals("bento", - dora.resolveConditionalPlaceRequest().getIdentifier()); - } - - @Test - public void defaultPlaceRequestEqualsToConditionalPlaceRequest() { - final DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest("my"); - final PlaceRequest conditionalPlaceRequest = new ConditionalPlaceRequest("my").when(p -> true).orElse(new DefaultPlaceRequest("other")); - - equals(defaultPlaceRequest, - conditionalPlaceRequest); - } - - @Test - public void defaultPlaceRequestNotEqualsToConditionalPlaceRequest() { - final DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest("my"); - final PlaceRequest conditionalPlaceRequest = new ConditionalPlaceRequest("my").when(p -> false).orElse(new DefaultPlaceRequest("other")); - - notEquals(defaultPlaceRequest, - conditionalPlaceRequest); - } - - @Test - public void defaultPlaceRequestEqualsToIncompleteConditionalPlaceRequest() { - final DefaultPlaceRequest defaultPlaceRequest = new DefaultPlaceRequest("my"); - final PlaceRequest conditionalPlaceRequest = new ConditionalPlaceRequest("my"); - - equals(defaultPlaceRequest, - conditionalPlaceRequest); - } - - @Test - public void trueEvaluatedConditionalPlaceRequestEqualsToAnotherTrueEvaluatedConditionalPlaceRequest() { - final PlaceRequest conditionalPlaceRequest1 = new ConditionalPlaceRequest("place1").when(p -> true).orElse(new DefaultPlaceRequest("place2")); - final PlaceRequest conditionalPlaceRequest2 = new ConditionalPlaceRequest("place1").when(p -> true).orElse(new DefaultPlaceRequest("place3")); - - equals(conditionalPlaceRequest1, - conditionalPlaceRequest2); - } - - @Test - public void falseEvaluatedConditionalPlaceRequestEqualsToAnotherFalseEvaluatedConditionalPlaceRequest() { - final PlaceRequest conditionalPlaceRequest1 = new ConditionalPlaceRequest("place1").when(p -> false).orElse(new DefaultPlaceRequest("place2")); - final PlaceRequest conditionalPlaceRequest2 = new ConditionalPlaceRequest("place3").when(p -> false).orElse(new DefaultPlaceRequest("place2")); - - equals(conditionalPlaceRequest1, - conditionalPlaceRequest2); - } - - @Test - public void trueEvaluatedConditionalPlaceRequestEqualsToAnotherFalseEvaluatedConditionalPlaceRequest() { - final PlaceRequest conditionalPlaceRequest1 = new ConditionalPlaceRequest("place1").when(p -> true).orElse(new DefaultPlaceRequest("place2")); - final PlaceRequest conditionalPlaceRequest2 = new ConditionalPlaceRequest("place3").when(p -> false).orElse(new DefaultPlaceRequest("place1")); - - equals(conditionalPlaceRequest1, - conditionalPlaceRequest2); - } - - @Test - public void falseEvaluatedConditionalPlaceRequestEqualsToAnotherTrueEvaluatedConditionalPlaceRequest() { - final PlaceRequest conditionalPlaceRequest1 = new ConditionalPlaceRequest("place1").when(p -> false).orElse(new DefaultPlaceRequest("place2")); - final PlaceRequest conditionalPlaceRequest2 = new ConditionalPlaceRequest("place2").when(p -> true).orElse(new DefaultPlaceRequest("place3")); - - equals(conditionalPlaceRequest1, - conditionalPlaceRequest2); - } - - private void equals(final PlaceRequest placeRequest1, - final PlaceRequest placeRequest2) { - assertTrue(placeRequest1.equals(placeRequest2)); - assertTrue(placeRequest2.equals(placeRequest1)); - assertEquals(placeRequest1.hashCode(), - placeRequest2.hashCode()); - } - - private void notEquals(final PlaceRequest placeRequest1, - final PlaceRequest placeRequest2) { - assertFalse(placeRequest1.equals(placeRequest2)); - assertFalse(placeRequest2.equals(placeRequest1)); - assertNotEquals(placeRequest1.hashCode(), - placeRequest2.hashCode()); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/TestWorkbenchModel.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/TestWorkbenchModel.java deleted file mode 100644 index 7a0866f332f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/TestWorkbenchModel.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.model; - -import org.junit.Test; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.impl.PanelDefinitionImpl; -import org.uberfire.workbench.model.impl.PartDefinitionImpl; -import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; - -import static org.junit.Assert.assertTrue; - -/** - * Test panel hierarchy constraints. - */ -public class TestWorkbenchModel { - - @Test - public void testPanelHierarchyInsert() { - PerspectiveDefinition perspective = new PerspectiveDefinitionImpl("what.ever.panel.PresenterClass"); - perspective.setName("perspective"); - - PanelDefinition westPanel = new PanelDefinitionImpl("what.ever.panel.PresenterClass"); - PanelDefinition eastPanel = new PanelDefinitionImpl("what.ever.panel.PresenterClass"); - - PartDefinition part1 = new PartDefinitionImpl(new DefaultPlaceRequest("one")); - PartDefinition part2 = new PartDefinitionImpl(new DefaultPlaceRequest("two")); - - perspective.getRoot().insertChild(CompassPosition.WEST, - westPanel); - perspective.getRoot().insertChild(CompassPosition.EAST, - eastPanel); - - westPanel.addPart(part1); - eastPanel.addPart(part2); - - assertTrue(part1.getParentPanel() == westPanel); - assertTrue(westPanel.getParent() == perspective.getRoot()); // TODO: panel equality? - - assertTrue(part2.getParentPanel() == eastPanel); - assertTrue(eastPanel.getParent() == perspective.getRoot()); - - assertTrue(perspective.getRoot().getParent() == null); - } - - @Test - public void testPanelHierarchyAppend() { - PerspectiveDefinition perspective = new PerspectiveDefinitionImpl("what.ever.panel.PresenterClass"); - perspective.setName("perspective"); - - PanelDefinition westPanel = new PanelDefinitionImpl("what.ever.panel.PresenterClass"); - PanelDefinition eastPanel = new PanelDefinitionImpl("what.ever.panel.PresenterClass"); - - PartDefinition part1 = new PartDefinitionImpl(new DefaultPlaceRequest("one")); - PartDefinition part2 = new PartDefinitionImpl(new DefaultPlaceRequest("two")); - - perspective.getRoot().appendChild(CompassPosition.WEST, - westPanel); - perspective.getRoot().appendChild(CompassPosition.EAST, - eastPanel); - - westPanel.addPart(part1); - eastPanel.addPart(part2); - - assertTrue(part1.getParentPanel() == westPanel); - assertTrue(westPanel.getParent() == perspective.getRoot()); // TODO: panel equality? - - assertTrue(part2.getParentPanel() == eastPanel); - assertTrue(eastPanel.getParent() == perspective.getRoot()); - - assertTrue(perspective.getRoot().getParent() == null); - } - - /** - * Parent traversal {@link PanelDefinition#getParent()} does yield IllegalStateException when the panel is not - * part of a hierarchy. There might be two reasons for this: Either the implicit parent/child wiring is broken - * or the explicit perspective setup is not yet completed. - */ - @Test(expected = IllegalStateException.class) - public void testDetachedPanels() { - PanelDefinition westPanel = new PanelDefinitionImpl("what.ever.panel.PresenterClass"); - PartDefinition part1 = new PartDefinitionImpl(new DefaultPlaceRequest("one")); - - westPanel.addPart(part1); - - assertTrue(part1.getParentPanel() == westPanel); - westPanel.getParent(); // does blow up - } -} - diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PanelDefinitionImplTest.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PanelDefinitionImplTest.java deleted file mode 100644 index 5864580a0cf..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PanelDefinitionImplTest.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.model.impl; - -import org.junit.Before; -import org.junit.Test; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.PartDefinition; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.mock; - -public class PanelDefinitionImplTest { - - private PanelDefinitionImpl panelDefinition; - private PanelDefinitionImpl otherPanel; - private PartDefinition part; - private PlaceRequest placeRequest; - private PanelDefinitionImpl parent; - - @Before - public void setUp() throws Exception { - panelDefinition = new PanelDefinitionImpl(); - otherPanel = new PanelDefinitionImpl(); - parent = new PanelDefinitionImpl(); - placeRequest = mock(PlaceRequest.class); - part = new PartDefinitionImpl(placeRequest); - } - - @Test(expected = IllegalStateException.class) - public void settingTwoDifferentParentsShouldThrowException() throws Exception { - panelDefinition.setParent(otherPanel); - panelDefinition.setParent(parent); - } - - @Test - public void addPartTest() throws Exception { - assertFalse(panelDefinition.getParts().contains(part)); - panelDefinition.addPart(part); - assertTrue(panelDefinition.getParts().contains(part)); - } - - @Test - public void addPartToADifferentPanelChangePanel() throws Exception { - assertFalse(panelDefinition.getParts().contains(part)); - panelDefinition.addPart(part); - assertTrue(panelDefinition.getParts().contains(part)); - otherPanel.addPart(part); - assertTrue(otherPanel.getParts().contains(part)); - assertEquals(otherPanel, - part.getParentPanel()); - assertFalse(panelDefinition.getParts().contains(part)); - } - - @Test - public void addPartTwiceShouldWork() throws Exception { - assertFalse(panelDefinition.getParts().contains(part)); - panelDefinition.addPart(part); - panelDefinition.addPart(part); - assertTrue(panelDefinition.getParts().contains(part)); - } - - @Test - public void partShouldNotBePresentAfterRemoval() throws Exception { - panelDefinition.addPart(part); - assertNotNull(part.getParentPanel()); - assertTrue(panelDefinition.getParts().contains(part)); - panelDefinition.removePart(part); - assertNull(part.getParentPanel()); - assertFalse(panelDefinition.getParts().contains(part)); - } - - @Test - public void removeNonexistentPartShouldDoNothingAndReturnFalse() throws Exception { - boolean result = panelDefinition.removePart(part); - assertEquals(false, - result); - } - - @Test - public void widthShouldNotRevertOnceSet() throws Exception { - assertNull(panelDefinition.getWidth()); - panelDefinition.setWidth(1234); - panelDefinition.setWidth(null); - assertEquals((Integer) 1234, - panelDefinition.getWidth()); - } - - @Test - public void heightShouldNotRevertOnceSet() throws Exception { - assertNull(panelDefinition.getHeight()); - panelDefinition.setHeight(1234); - panelDefinition.setHeight(null); - assertEquals((Integer) 1234, - panelDefinition.getHeight()); - } - - @Test - public void appendChildShouldAddPanelToChildren() { - panelDefinition.appendChild(otherPanel); - assertTrue(panelDefinition.getChildren().contains(otherPanel)); - assertEquals(panelDefinition, - otherPanel.getParent()); - } - - @Test - public void appendChildToPanelTwiceShouldWork() { - panelDefinition.appendChild(otherPanel); - assertTrue(panelDefinition.getChildren().contains(otherPanel)); - panelDefinition.appendChild(otherPanel); - assertTrue(panelDefinition.getChildren().contains(otherPanel)); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PartDefinitionImplTest.java b/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PartDefinitionImplTest.java deleted file mode 100644 index 39d52b514a2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-api/src/test/java/org/uberfire/workbench/model/impl/PartDefinitionImplTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.workbench.model.impl; - -import java.util.HashSet; - -import org.junit.Before; -import org.junit.Test; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PartDefinition; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -public class PartDefinitionImplTest { - - private PartDefinitionImpl part; - private PanelDefinition parent; - private PanelDefinition anotherParent; - - @Before - public void setUp() throws Exception { - PlaceRequest placeRequest = mock(PlaceRequest.class); - part = new PartDefinitionImpl(placeRequest); - parent = new PanelDefinitionImpl(); - anotherParent = new PanelDefinitionImpl(); - } - - @Test(expected = IllegalStateException.class) - public void defineParentPanelWithOldParent() throws Exception { - PanelDefinitionImpl parentMock = createParentMock(); - - part.setParentPanel(parentMock); - part.setParentPanel(anotherParent); - } - - @Test(expected = IllegalStateException.class) - public void defineParentPanelWithOldParentWithoutPart() throws Exception { - parent = createParentMock(); - part.setParentPanel(parent); - when(parent.getParts()).thenReturn(new HashSet()); - PanelDefinitionImpl anotherParent = createParentMock(); - part.setParentPanel(anotherParent); - } - - private PanelDefinitionImpl createParentMock() { - PanelDefinitionImpl parentMock = mock(PanelDefinitionImpl.class); - HashSet mockSet = new HashSet(); - mockSet.add(part); - when(parentMock.getParts()).thenReturn(mockSet); - return parentMock; - } - - @Test - public void defineParentPanel() throws Exception { - PanelDefinitionImpl parentMock = createParentMock(); - part.setParentPanel(parentMock); - assertEquals(parentMock, - part.getParentPanel()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-all/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-client-all/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index f842e65d7a0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-all/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-client-api/pom.xml b/packages/dashbuilder/appformer/uberfire-client-api/pom.xml deleted file mode 100644 index 7f69af29640..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/pom.xml +++ /dev/null @@ -1,151 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-parent - ${revision} - ../pom.xml - - - uberfire-client-api - jar - - UberFire Client API - UberFire Client API - - - - - org.uberfire - uberfire-api - - - - jakarta.inject - jakarta.inject-api - provided - - - - org.jboss.errai - errai-common - - - - org.jboss.errai - errai-bus - - - - org.jboss.errai - errai-ioc - - - - org.kie.soup - kie-soup-commons - - - - com.google.elemental2 - elemental2-dom - - - - com.google.elemental2 - elemental2-promise - - - - com.google.jsinterop - jsinterop-annotations - - - - com.google.gwt - gwt-user - provided - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-bluebird - process-resources - - unpack - - - - - org.webjars.bower - bluebird - ${version.org.webjars.bower.bluebird} - jar - true - ${project.build.directory}/bluebird - - - false - true - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-bluebird-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/bluebird - - - ${project.build.directory}/bluebird/META-INF/resources/webjars/bluebird/${version.org.webjars.bower.bluebird}/js/browser - - bluebird.min.js - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/Perspective.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/Perspective.java deleted file mode 100644 index 9cc42262d27..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/Perspective.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this provide a PerspectiveDefinition. The method should have zero arguments and return a - * {@code org.uberfire.client.workbench.model.PerspectiveDefinition}. - *

      - * This annotation should only be used in classes annotated with {@link WorkbenchPerspective}, and it cannot be used in - * a class that has fields annotated with {@link WorkbenchPanel}. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface Perspective { - -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchContext.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchContext.java deleted file mode 100644 index 7389fa29d56..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchContext.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface WorkbenchContext { - - String identifier(); -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java deleted file mode 100644 index b2de1c62e0f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Specifies an UberFire workbench panel within a templated perspective. - *

      - *

      Prerequisites

      - * This annotation can only be used within a class annotated with {@link WorkbenchPerspective}, and it must target a - * field that implements the GWT HasWidgets interface. Further, the class this annotation is used in must not have a - * method annotated with {@link Perspective}. See {@link WorkbenchPerspective} for details. - */ -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.FIELD}) -public @interface WorkbenchPanel { - - /** - * The Presenter type of the panel. Must be a Dependent-scoped Errai IOC bean which implements - * WorkbenchPanelPresenter. The default is SimpleWorkbenchPanelPresenter. - */ - Class panelType() default Void.class; - - /** - * Specifies the PlaceRequests that should be used to populate this panel with parts when the containing perspective - * is first launched. For panel types that only support a single part (such as StaticWorkbenchPanelPresenter), only - * one item should be used here. - *

      - * To specify a PlaceRequest with parameters, use standard URL query syntax: - *

      - *

      -     *   {@code @WorkbenchPanel(parts = "MyPlaceID?param1=val1&param2=val2")}
      -     * 
      - *

      - * Special characters can be escaped using URL encoding: for '%' use '%25'; for '&' use '%26'; for '=' use '%3d'; - * for '?' use '%3f'. - */ - String[] parts(); - - /** - * Makes this panel the first panel in the generated PerspectiveDefinition object. Some panel presenters may treat - * their first child panel specially (for example, by forwarding addPanel requests to it). If no panel within a - * perspective is explicitly marked as the default, a randomly selected panel will be first. It is an error to - * define more than one default panel in a perspective. - */ - boolean isDefault() default false; -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitle.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitle.java deleted file mode 100644 index ff502724dce..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitle.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this provide a {@code java.lang.String} title for the - * WorkbenchPart. The method should have zero arguments and return a - * {@code java.lang.String}. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface WorkbenchPartTitle { - -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitleDecoration.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitleDecoration.java deleted file mode 100644 index bafdeccc057..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartTitleDecoration.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this provide a {@code java.lang.String} title for the - * WorkbenchPart. The method should have zero arguments and return a - * {@code com.google.gwt.user.client.ui.IsWidget}. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface WorkbenchPartTitleDecoration { - -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartView.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartView.java deleted file mode 100644 index ae332df4bdf..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPartView.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Methods annotated with this provide the view for the WorkbenchPart. The - * method should have zero arguments and return a - * {@code com.google.gwt.user.client.ui.IsWidget} or preferably a - * {@code org.jboss.errai.common.client.api.IsElement}. - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) -public @interface WorkbenchPartView { - -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java deleted file mode 100644 index 35f0b7d75ea..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.PerspectiveDefinition; - -/** - * Indicates that the target class defines a Perspective in the workbench. - *

      - * There are two options for defining the arrangement of panels and parts within the perspective: either - * programmatically build a {@link PerspectiveDefinition} object, or declare panel structure and content using Errai UI - * templates. Note that you cannot mix the two approaches. - *

      - *

      Programmatic Perspective Definition

      - * To define the perspective layout programmatically, create a zero-argument method annotated with {@code @Perspective} - * that returns a {@link PerspectiveDefinition}. - *

      - *

      Templated Perspective Definition

      - * To declare perspective layout using templates, make the class an Errai UI templated component, and then add the - * {@link WorkbenchPanel} annotation to one or more of its {@code @DataField} widgets. This designates them as panel - * containers and allows you to specify which parts should be added to them when the perspective launches. - *

      - *

      Perspective Lifecycle

      - * WorkbenchPerspectives receive the standard set of lifecycle calls for a Workbench component: - *
        - *
      • {@code @OnStartup}
      • - *
      • {@code @OnOpen}
      • - *
      • {@code @OnClose}
      • - *
      • {@code @OnShutdown}
      • - *
      - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface WorkbenchPerspective { - - /** - * The place ID to associate with this perspective. - * @see PlaceRequest - */ - String identifier(); - - /** - * Indicates that this perspective should be opened by default when the - * workbench first starts. Exactly one perspective in the whole application - * should be marked as default. - */ - boolean isDefault() default false; - - /** - * If true (the default), every time this perspective is displayed, it - * should start fresh with the {@link PerspectiveDefinition} returned by the - * method annotated with {@code @Perspective}. If false, the framework will - * store the structure of the perspective (panel arrangements and part - * placement as modified by the user opening and closing tabs, dragging - * parts around, and resizing split panels) on the server individually for - * each user, and use that stored definition in preference to the one - * returned by the {@code @Perspective} method. - */ - boolean isTransient() default true; - - /** - * Indicates that this perspective can be discovered and loaded at runtime. - * This is useful when building plugins or extensions where the perspective - * is part of an external script loaded at runtime, as opposed to being - * statically compiled into the main application. - */ - boolean isDynamic() default false; -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java deleted file mode 100644 index eaed9b5e4d4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Classes annotated with this are considered Workbench popups. - *

      - * At its simplest form the Class should extend - * {@code com.google.gwt.user.client.ui.PopupPanel} and provide a method - * annotated with {@code @OnOpen}. - *

      - *

      - * Developers wishing to separate view from logic (perhaps by implementing the - * MVP pattern) can further provide a zero-argument method annotated with - * {@code @WorkbenchPartView} with return type - * {@code com.google.gwt.user.client.ui.PopupPanel}. - *

      - *

      - * In this latter case the {@code @WorkbenchPopup} need not extend - * {@code com.google.gwt.user.client.ui.PopupPanel}. - *

      - *

      - * WorkbechPopups can receive the following life-cycle calls: - *

        - *
      • {@code @OnOpen}
      • - *

        - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface WorkbenchPopup { - - String identifier(); - - WorkbenchPopupSize size() default WorkbenchPopupSize.MEDIUM; - - enum WorkbenchPopupSize { - SMALL, - MEDIUM, - LARGE - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchScreen.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchScreen.java deleted file mode 100644 index 6e7794fe49d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchScreen.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * Classes annotated with this are considered WorkbenchParts that display some form of non-editable (but possibly still - * interactive) content. If the content is associated with a VFS path, or otherwise represents some sort of document - * that can be edited and saved, developers should consider using {@code @WorkbenchEditor}. - *

        - * All classes annotated with {@code @WorkbenchScreen} must have a declared or inherited method annotated with - * {@code @WorkbenchPartTitle}. - *

        - * There are two options for providing the screen's view: - *

          - *
        1. the class implements {@code com.google.gwt.user.client.ui.IsWidget} (often by extending {@code com.google.gwt.user.client.ui.Composite}) - *
        2. the class declares or inherits a zero-argument method annotated with {@code @WorkbenchPartView} that returns the - * {@code com.google.gwt.user.client.ui.IsWidget} or preferably - * {@code org.jboss.errai.common.client.api.IsElement} that handles the view. In this case the class need not - * implement {@code com.google.gwt.user.client.ui.IsWidget}. - *
        - *

        - * Developers wishing to separate view from logic via the MVP pattern will choose the second option. - *

        - * WorkbechScreens can receive the following life-cycle calls: - *

          - *
        • {@code @OnStartup}
        • - *
        • {@code @OnOpen}
        • - *
        • {@code @OnFocus}
        • - *
        • {@code @OnLostFocus}
        • - *
        • {@code @OnMayClose}
        • - *
        • {@code @OnClose}
        • - *
        • {@code @OnShutdown}
        • - *
        - */ -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface WorkbenchScreen { - - /** - * Identifier that should be unique within application. - */ - String identifier(); - - /** - * By default, a Workbench Screen will show up in the current active perspective. If this parameter is specified, - * this screen will only be shown on the given perspective. An attempt to navigate to this screen when - * a different perspective is active will first result in a switch to the owning perspective, then the screen will - * be shown in that perspective. - */ - Class owningPerspective() default void.class; - - /** - * Defines the preferred height. Preferred means that this Height will be used only if this screen - * is the trigger to create a new panel, if panel already exists this information is ignored. - */ - int preferredHeight() default -1; - - /** - * Defines the preferred width. Preferred means that this Width will be used only if this screen - * is the trigger to create a new panel, if panel already exists this information is ignored. - */ - int preferredWidth() default -1; - - /** - * Indicates that this screen can be discovered and loaded at runtime. - * This is useful when building plugins or extensions where the screen - * is part of an external script loaded at runtime, as opposed to being - * statically compiled into the main application. - */ - boolean isDynamic() default false; -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchSplashScreen.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchSplashScreen.java deleted file mode 100644 index e96c22d934d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchSplashScreen.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.annotations; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -@Inherited -@Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.TYPE}) -public @interface WorkbenchSplashScreen { - - String identifier(); - - boolean isEnabled() default true; -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberElement.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberElement.java deleted file mode 100644 index a90d68ae0a4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberElement.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.mvp; - -import org.jboss.errai.common.client.api.IsElement; - -/** - * Interface to inject a Presenter into a View for MVP-based Element - * implementations. Due to limitations with CDI it is not possible to {@code @Inject} - * the correct instance of a Presenter into a View. - *

        - * Developers wishing to implement MVP-based Elements are encouraged to have - * their View implement this interface if they require access to the appropriate - * Presenter. - * @param The Presenter type - * @deprecated Use {@link UberElemental} and elemental2 instead. - */ -@Deprecated -public interface UberElement extends IsElement, HasPresenter { -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberView.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberView.java deleted file mode 100644 index 73a24976c35..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/mvp/UberView.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.mvp; - -import com.google.gwt.user.client.ui.IsWidget; - -/** - * Interface to inject a Presenter into a View for MVP-based Widget - * implementations. Due to limitations with CDI it is not possible to {@code @Inject} - * the correct instance of a Presenter into a View. - *

        - * Developers wishing to implement MVP-based Widgets are encouraged to have - * their View implement this interface if they require access to the appropriate - * Presenter. - * @param The Presenter type - */ -public interface UberView extends IsWidget, HasPresenter { -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillBootstrapper.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillBootstrapper.java deleted file mode 100644 index a1019a51245..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillBootstrapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.promise; - -import com.google.gwt.core.client.ScriptInjector; - -class PromisePolyfillBootstrapper { - - static void ensurePromiseApiIsAvailable() { - if (!isPromiseApiAvailable()) { - ScriptInjector.fromString(PromisePolyfillClientBundle.INSTANCE.promisePolyfill().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - } - } - - /** - * Checks to see if Promise is already present. - * @return true is Promise is loaded, false otherwise. - */ - private static native boolean isPromiseApiAvailable() /*-{ - return (typeof $wnd['Promise'] !== 'undefined'); - }-*/; -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillClientBundle.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillClientBundle.java deleted file mode 100644 index 5c2fb64d3b4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/PromisePolyfillClientBundle.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.promise; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.TextResource; - -public interface PromisePolyfillClientBundle extends ClientBundle { - - PromisePolyfillClientBundle INSTANCE = GWT.create(PromisePolyfillClientBundle.class); - - @Source("org/uberfire/client/views/static/bluebird/bluebird.min.js") - TextResource promisePolyfill(); -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/Promises.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/Promises.java deleted file mode 100644 index 674129b88aa..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/promise/Promises.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (C) 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.promise; - -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.function.BiFunction; -import java.util.function.BinaryOperator; -import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.Supplier; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import elemental2.promise.Promise; -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; - -import static org.uberfire.client.promise.PromisePolyfillBootstrapper.ensurePromiseApiIsAvailable; - -@Dependent -public class Promises { - - @PostConstruct - public void init() { - ensurePromiseApiIsAvailable(); - } - - // Reducers - - /** - * Returns a resolved Promise when every Promise in the list is resolved. - * If any Promise is rejected, the resulting Promise will be rejected. - */ - @SafeVarargs - public final Promise all(final Promise... promises) { - return Arrays.stream(promises).reduce(resolve(), (p1, p2) -> p1.then(ignore -> p2)); - } - - /** - * Maps the objects to Promises using the provided function then behaves just like {@link org.uberfire.client.promise.Promises#all}. - */ - public Promise all(final List objects, final Function> f) { - return objects.stream().map(f).reduce(resolve(), (p1, p2) -> p1.then(ignore -> p2)); - } - - /** - * Reduces a list of promises using the accumulator passed. - */ - public final Promise reduce(final Promise identity, - final Collection> promises, - final BinaryOperator> accumulator) { - return promises.stream().reduce(identity, accumulator); - } - - /** - * Maps the objects to Promises using the provided function but only execute the Promises when the - * previous Promise is resolved. If a rejection occurs in the middle of the chain, the remaining - * Promises are not executed and the resulting Promise is rejected. - */ - public Promise reduceLazily(final List objects, - final Function> f) { - return objects.stream() - .>> - map(o -> () -> f.apply(o)) - .>> - reduce(this::resolve, - (p1, p2) -> () -> p1.get().then(ignore -> p2.get()) - ) - .get(); - } - - /** - * Behaves just like {@link org.uberfire.client.promise.Promises#reduceLazily} but exposes a reference to the Promise chain as a - * parameter to the mapping function. - */ - public Promise reduceLazilyChaining(final List objects, - final BiFunction>, T, Promise> f) { - - return objects.stream() - .>, Supplier>>> - map(o -> next -> () -> f.apply(next, o)) - .>, Supplier>>> - reduce(next -> this::resolve, - (p1, p2) -> uberNext -> () -> { - final Supplier> next = p2.apply(uberNext); - final Supplier> chain = () -> next.get().then(ignore -> uberNext.get()); - return p1.apply(chain).get().then(ignore -> next.get()); - } - ) - .apply(this::resolve).get(); - } - - // Callers - - /** - * Promisifies a {@link Caller} remote call. If an exception is thrown inside the call function, the - * resulting Promise is rejected with a {@link org.uberfire.client.promise.Promises.Error} instance. - */ - public Promise promisify(final Caller caller, - final Function call) { - - return create((resolve, reject) -> call.apply(caller.call( - (RemoteCallback) resolve::onInvoke, - defaultRpcErrorCallback(reject)))); - } - - /** - * Promisifies a {@link Caller} remote call. If an exception is thrown inside the call function, the - * resulting Promise is rejected with a {@link org.uberfire.client.promise.Promises.Error} instance. - */ - public Promise promisify(final Caller caller, - final Consumer call) { - - return create((resolve, reject) -> call.accept(caller.call( - (RemoteCallback) resolve::onInvoke, - defaultRpcErrorCallback(reject)))); - } - - private ErrorCallback defaultRpcErrorCallback(final Promise.PromiseExecutorCallbackFn.RejectCallbackFn reject) { - return (final M o, final Throwable throwable) -> { - reject.onInvoke(new Promises.Error<>(o, throwable)); - return false; - }; - } - - /** - * To be used inside {@link Promise#catch_} blocks. Decides whether to process a RuntimeException that - * caused a prior Promise rejection or to process an expected object rejected by a prior Promise. To proceed - * with default error handlers, reject the untreated exception inside the catchBlock function. - */ - @SuppressWarnings("unchecked") - public Promise catchOrExecute(final Object o, - final Function> catchBlock, - final Function> expectedRejectionHandler) { - - if (o instanceof JavaScriptObject) { - // A RuntimeException occurred inside a promise and was transformed in a JavaScriptObject - return resolve() - .then(i -> catchBlock.apply(new RuntimeException("Client-side exception inside Promise: " + o.toString()))) - .catch_(this::handleCatchBlockExceptions); - } - - if (o instanceof RuntimeException) { - return resolve() - .then(i -> catchBlock.apply((RuntimeException) o)) - .catch_(this::handleCatchBlockExceptions); - } - - if (o instanceof Promises.Error) { - return resolve() - .then(i -> catchBlock.apply((RuntimeException) ((Error) o).getThrowable())) - .catch_(this::handleCatchBlockExceptions); - } - - return expectedRejectionHandler.apply((V) o); - } - - private Promise handleCatchBlockExceptions(final Object rejectedObject) { - - if (rejectedObject instanceof Throwable) { - GWT.getUncaughtExceptionHandler().onUncaughtException((Throwable) rejectedObject); - return resolve(); - } - - return reject(rejectedObject); - } - - public Promise resolve() { - return resolve(null); - } - - public Promise resolve(final T object) { - return create((resolve, reject) -> resolve.onInvoke(object)); - } - - public Promise reject(final Object object) { - return create((resolve, reject) -> reject.onInvoke(object)); - } - - public Promise create(final Promise.PromiseExecutorCallbackFn executor) { - return new Promise<>(executor); - } - - public static class Error { - - private final T o; - - private final Throwable throwable; - - private Error(final T o, final Throwable throwable) { - this.o = o; - this.throwable = throwable; - } - - private T getObject() { - return o; - } - - private Throwable getThrowable() { - return throwable; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaAttribute.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaAttribute.java deleted file mode 100644 index b44b209f040..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaAttribute.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -/** - * Represents any attribute of OUIA specification (https://ouia.readthedocs.io/en/latest/README.html#language) - */ -public interface OuiaAttribute { - - /** - * @return name of the attribute - */ - String getName(); - - /** - * @return value of the attribute - */ - String getValue(); -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponent.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponent.java deleted file mode 100644 index 73961efcb61..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponent.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -import java.util.function.Consumer; - -/** - * This represents OUIA compliant components (https://ouia.readthedocs.io/en/latest/README.html#ouia-component) - * OUIA compliant elements are leveraged by advanced UI testing tools - */ -public interface OuiaComponent { - - /** - * Initializes OUIA attributes of given element - */ - default void initOuiaComponentAttributes() { - ouiaAttributeRenderer().accept(ouiaComponentType()); - ouiaAttributeRenderer().accept(ouiaComponentId()); - } - - /** - * Returns 'data-ouia-component-type' attribute for given element - * @return 'data-ouia-component-type' attribute value - */ - OuiaComponentTypeAttribute ouiaComponentType(); - - /** - * Returns 'data-ouia-component-id' attribute for given element - * @return 'data-ouia-component-id' attribute value - */ - OuiaComponentIdAttribute ouiaComponentId(); - - /** - * Renderer of any OUIA attribute. Invoking of this renderer should display given attribute in produced html. - * @return OUIA attribute renderer - */ - Consumer ouiaAttributeRenderer(); -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttribute.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttribute.java deleted file mode 100644 index 38dc279091f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttribute.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -import java.util.Objects; - -/** - * Implementation of 'data-ouia-component-id' attribute - * https://ouia.readthedocs.io/en/latest/README.html#ouia-component - */ -public class OuiaComponentIdAttribute implements OuiaAttribute { - - public static final String COMPONENT_ID = "data-ouia-component-id"; - - private String value; - - public OuiaComponentIdAttribute(final String value) { - this.value = value; - } - - @Override - public String getName() { - return COMPONENT_ID; - } - - @Override - public String getValue() { - return value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof OuiaComponentIdAttribute)) { - return false; - } - OuiaComponentIdAttribute that = (OuiaComponentIdAttribute) o; - return Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - - return Objects.hash(value); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttribute.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttribute.java deleted file mode 100644 index 5ec928513f9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttribute.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -import java.util.Objects; - -/** - * Implementation of 'data-ouia-component-type' attribute - * https://ouia.readthedocs.io/en/latest/README.html#ouia-component - */ -public class OuiaComponentTypeAttribute implements OuiaAttribute { - - public static final String COMPONENT_TYPE = "data-ouia-component-type"; - - private String value; - - public OuiaComponentTypeAttribute(final String value) { - this.value = value; - } - - @Override - public String getName() { - return COMPONENT_TYPE; - } - - @Override - public String getValue() { - return value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof OuiaComponentTypeAttribute)) { - return false; - } - OuiaComponentTypeAttribute that = (OuiaComponentTypeAttribute) o; - return Objects.equals(value, that.value); - } - - @Override - public int hashCode() { - - return Objects.hash(value); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index f842e65d7a0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/UberfireClientAPI.gwt.xml b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/UberfireClientAPI.gwt.xml deleted file mode 100644 index 7617af04e6b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/UberfireClientAPI.gwt.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants.properties deleted file mode 100644 index 9d07a1072c4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants.properties +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -anyResourceTypeDescription=Others -dotResourceTypeDescription=Dot file diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_de.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_de.properties deleted file mode 100644 index c1b78cfc4fc..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_de.properties +++ /dev/null @@ -1,4 +0,0 @@ -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author nmirasch -anyResourceTypeDescription=Andere -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author nmirasch -dotResourceTypeDescription=Dot-Datei diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_es.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_es.properties deleted file mode 100644 index c05f1393418..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_es.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -anyResourceTypeDescription=Otros -dotResourceTypeDescription=Archivo dot - diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_fr.properties deleted file mode 100644 index 973fb779f89..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_fr.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -anyResourceTypeDescription=Autres -dotResourceTypeDescription=Fichier Dot - diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_ja.properties deleted file mode 100644 index 745ec3b48b6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_ja.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -anyResourceTypeDescription=その他 -dotResourceTypeDescription=ドットファイル - diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_pt_BR.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_pt_BR.properties deleted file mode 100644 index aed8aa92978..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_pt_BR.properties +++ /dev/null @@ -1,4 +0,0 @@ -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author ldelima@redhat.com -anyResourceTypeDescription=Outros -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author ldelima@redhat.com -dotResourceTypeDescription=Arquivo dot diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_zh_CN.properties b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_zh_CN.properties deleted file mode 100644 index 3d5c92fd147..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/i18n/UberfireConstants_zh_CN.properties +++ /dev/null @@ -1,4 +0,0 @@ -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author xi.huang -anyResourceTypeDescription=其他 -# translation auto-copied from project UberFire, version 0.3.0, document org.uberfire/uberfire-client-api/org/uberfire/client/resources/i18n/UberfireConstants, author xi.huang -dotResourceTypeDescription=Dot 文件 diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/images/BPM_FileIcons_genericfile.png b/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/images/BPM_FileIcons_genericfile.png deleted file mode 100644 index ab2f74190d1..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-client-api/src/main/resources/org/uberfire/client/resources/images/BPM_FileIcons_genericfile.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttributeTest.java b/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttributeTest.java deleted file mode 100644 index a72d94d6a32..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentIdAttributeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -public class OuiaComponentIdAttributeTest { - - @Test - public void testGetName() { - assertEquals(OuiaComponentIdAttribute.COMPONENT_ID, new OuiaComponentIdAttribute("xyz").getName()); - } - - @Test - public void testGetValue() { - assertEquals("xyz", new OuiaComponentIdAttribute("xyz").getValue()); - } - - @Test - public void testEquality() { - assertEquals(new OuiaComponentIdAttribute("a"), new OuiaComponentIdAttribute("a")); - assertNotEquals(new OuiaComponentIdAttribute("a"), new OuiaComponentIdAttribute("b")); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttributeTest.java b/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttributeTest.java deleted file mode 100644 index ce5e16cc704..00000000000 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/test/java/org/uberfire/client/workbench/ouia/OuiaComponentTypeAttributeTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2020 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.workbench.ouia; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; - -public class OuiaComponentTypeAttributeTest { - - @Test - public void testGetName() { - assertEquals(OuiaComponentTypeAttribute.COMPONENT_TYPE, new OuiaComponentTypeAttribute("xyz").getName()); - } - - @Test - public void testGetValue() { - assertEquals("xyz", new OuiaComponentTypeAttribute("xyz").getValue()); - } - - @Test - public void testEquality() { - assertEquals(new OuiaComponentTypeAttribute("a"), new OuiaComponentTypeAttribute("a")); - assertNotEquals(new OuiaComponentTypeAttribute("a"), new OuiaComponentTypeAttribute("b")); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/pom.xml b/packages/dashbuilder/appformer/uberfire-commons/pom.xml deleted file mode 100644 index 6b27270b685..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-parent - ${revision} - ../pom.xml - - - uberfire-commons - jar - - Uberfire Commons - Collection of reusable (not depending on any other UberFire module) components for Uberfire. - - - - jakarta.annotation - jakarta.annotation-api - - - org.kie.soup - kie-soup-commons - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - org.slf4j - slf4j-api - - - org.jboss.errai - errai-marshalling - - - - diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Pair.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Pair.java deleted file mode 100644 index 7856cf4291d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Pair.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.data; - -/** - * This is a simple class to store a pair of objects. - * @param - * @param - */ -public class Pair { - - private final PairEqualsMode equalsMode; - /** - * First item. - */ - private final K1 k1; - /** - * Second item. - */ - private final K2 k2; - - /** - * Creates a new pair using the two keys provided. - * @param k1 - * @param k2 - */ - public Pair( - final K1 k1, - final K2 k2) { - this.k1 = k1; - this.k2 = k2; - this.equalsMode = PairEqualsMode.BOTH; - } - - /** - * Creates a new pair using the two keys provided. - * @param k1 - * @param k2 - */ - public Pair( - final K1 k1, - final K2 k2, - final PairEqualsMode equalsMode) { - this.k1 = k1; - this.k2 = k2; - this.equalsMode = equalsMode; - } - - /** - * static factory method - * @param - * @param - * @param k1 - * @param k2 - * @return - */ - public static Pair newPair(final K1 k1, - final K2 k2) { - return new Pair(k1, - k2, - PairEqualsMode.BOTH); - } - - /** - * static factory method - * @param - * @param - * @param k1 - * @param k2 - * @return - */ - public static Pair newPair(final K1 k1, - final K2 k2, - final PairEqualsMode equalsMode) { - return new Pair<>(k1, k2, equalsMode); - } - - @Override - public boolean equals(final Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - final Pair pair = (Pair) o; - - if (PairEqualsMode.BOTH.equals(equalsMode) || PairEqualsMode.K1.equals(equalsMode)) { - if (k1 != null ? !k1.equals(pair.k1) : pair.k1 != null) { - return false; - } - } - if (PairEqualsMode.BOTH.equals(equalsMode) || PairEqualsMode.K2.equals(equalsMode)) { - if (k2 != null ? !k2.equals(pair.k2) : pair.k2 != null) { - return false; - } - } - - return true; - } - - /** - * @return the first key - */ - public K1 getK1() { - return this.k1; - } - - /** - * @return the second key - */ - public K2 getK2() { - return this.k2; - } - - @Override - public int hashCode() { - int result = 0; - if (PairEqualsMode.BOTH.equals(equalsMode) || PairEqualsMode.K1.equals(equalsMode)) { - result = k1 != null ? k1.hashCode() : 0; - } - if (PairEqualsMode.BOTH.equals(equalsMode) || PairEqualsMode.K2.equals(equalsMode)) { - result = 31 * result + (k2 != null ? k2.hashCode() : 0); - } - return result; - } - - @Override - public String toString() { - return getClass().getName() + "{" + - "k1=" + k1 + - ", k2=" + k2 + - '}'; - } - - public enum PairEqualsMode { - BOTH, - K1, - K2 - } -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Triple.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Triple.java deleted file mode 100644 index 4101eba8081..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/data/Triple.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.data; - -public class Triple { - - /** - * First item. - */ - private final K1 k1; - - /** - * Second item. - */ - private final K2 k2; - - /** - * Third item. - */ - private final K3 k3; - - /** - * Creates a new triple using the keys provided. - * @param k1 - * @param k2 - */ - public Triple( - final K1 k1, - final K2 k2, - final K3 k3) { - this.k1 = k1; - this.k2 = k2; - this.k3 = k3; - } - - /** - * static factory method - * @param - * @param - * @param k1 - * @param k2 - * @return - */ - public static Triple newTriple(final K1 k1, - final K2 k2, - final K3 k3) { - return new Triple<>(k1, k2, k3); - } - - /** - * @return the first key - */ - public K1 getK1() { - return this.k1; - } - - /** - * @return the second key - */ - public K2 getK2() { - return this.k2; - } - - /** - * @return the third key - */ - public K3 getK3() { - return this.k3; - } - - @SuppressWarnings("unchecked") - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Triple)) { - return false; - } - - Triple triple = (Triple) o; - - if (k1 != null ? !k1.equals(triple.k1) : triple.k1 != null) { - return false; - } - if (k2 != null ? !k2.equals(triple.k2) : triple.k2 != null) { - return false; - } - if (k3 != null ? !k3.equals(triple.k3) : triple.k3 != null) { - return false; - } - - return true; - } - - @Override - public int hashCode() { - int result = k1 != null ? k1.hashCode() : 0; - result = 31 * result + (k2 != null ? k2.hashCode() : 0); - result = 31 * result + (k3 != null ? k3.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return getClass().getName() + "{" + - "k1=" + k1 + - ", k2=" + k2 + - ", k3=" + k3 + - '}'; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/Disposable.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/Disposable.java deleted file mode 100644 index 0700ec7aaec..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/Disposable.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.lifecycle; - -/** - * The Disposable interface is used for life-cycle management of resources. - */ -public interface Disposable { - - void dispose(); -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposable.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposable.java deleted file mode 100644 index 9443f0463ef..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposable.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.lifecycle; - -/** - * The PriorityDisposable interface is used for life-cycle management - * of resources that requires priority to be disposed. - *

        - * Important Note: Due an issue related to multiple Application Server - * support, all types that implement this interface needs to register itself on - * PriorityDisposableRegistry (preferable on constructor). - * @see Disposable - * @see PriorityDisposableRegistry - */ -public interface PriorityDisposable extends Disposable { - - int priority(); -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistry.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistry.java deleted file mode 100644 index d937ff34ce7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistry.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.lifecycle; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -public final class PriorityDisposableRegistry { - - private static Set disposables = new HashSet<>(); - private static Map registry = new HashMap<>(); - - private PriorityDisposableRegistry() { - } - - public static void register(final PriorityDisposable priorityDisposable) { - disposables.add(priorityDisposable); - } - - public static void register(final String refName, - final Object disposable) { - registry.put(refName, - disposable); - } - - public static void clear() { - disposables.clear(); - registry.clear(); - } - - public static Collection getDisposables() { - return disposables; - } - - static Map getRegistry() { - return registry; - } - - public static void unregister(final String refName) { - registry.remove(refName); - } - - public static Object get(final String refName) { - return registry.get(refName); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/AsyncCallback.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/AsyncCallback.java deleted file mode 100644 index 4433bf77060..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/AsyncCallback.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.message; - -import java.util.Map; - -public interface AsyncCallback { - - void onTimeOut(); - - void onReply(final MessageType type, - final Map content); -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/MessageHandler.java b/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/MessageHandler.java deleted file mode 100644 index 741325136f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/java/org/uberfire/commons/message/MessageHandler.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.message; - -import java.util.Map; - -import org.uberfire.commons.data.Pair; - -public interface MessageHandler { - - Pair> handleMessage(final MessageType type, - final Map content); -} diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index f842e65d7a0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/beans.xml b/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/beans.xml deleted file mode 100644 index 8d3ae2a10a8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/org/uberfire/commons/UberfireCommons.gwt.xml b/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/org/uberfire/commons/UberfireCommons.gwt.xml deleted file mode 100644 index f31642a49de..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/main/resources/org/uberfire/commons/UberfireCommons.gwt.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-commons/src/test/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistryTest.java b/packages/dashbuilder/appformer/uberfire-commons/src/test/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistryTest.java deleted file mode 100644 index 0ff45241e9e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-commons/src/test/java/org/uberfire/commons/lifecycle/PriorityDisposableRegistryTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.commons.lifecycle; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; - -public class PriorityDisposableRegistryTest { - - @Test - public void testGeneralDisposableState() { - final PriorityDisposable mocked1 = mock(PriorityDisposable.class); - final PriorityDisposable mocked2 = mock(PriorityDisposable.class); - - PriorityDisposableRegistry.clear(); - assertEquals(0, - PriorityDisposableRegistry.getDisposables().size()); - PriorityDisposableRegistry.register(mocked1); - assertEquals(1, - PriorityDisposableRegistry.getDisposables().size()); - PriorityDisposableRegistry.register(mocked1); - assertEquals(1, - PriorityDisposableRegistry.getDisposables().size()); - PriorityDisposableRegistry.register(mocked2); - assertEquals(2, - PriorityDisposableRegistry.getDisposables().size()); - PriorityDisposableRegistry.clear(); - assertEquals(0, - PriorityDisposableRegistry.getDisposables().size()); - } - - @Test - public void testGeneralRegistryState() { - final PriorityDisposable mocked1 = mock(PriorityDisposable.class); - final PriorityDisposable mocked2 = mock(PriorityDisposable.class); - - PriorityDisposableRegistry.clear(); - assertEquals(0, - PriorityDisposableRegistry.getRegistry().size()); - PriorityDisposableRegistry.register("refName", - mocked1); - assertEquals(1, - PriorityDisposableRegistry.getRegistry().size()); - PriorityDisposableRegistry.register("refName", - mocked1); - assertEquals(1, - PriorityDisposableRegistry.getRegistry().size()); - PriorityDisposableRegistry.register("refName1", - mocked2); - assertEquals(2, - PriorityDisposableRegistry.getRegistry().size()); - PriorityDisposableRegistry.unregister("refName"); - assertEquals(1, - PriorityDisposableRegistry.getRegistry().size()); - PriorityDisposableRegistry.clear(); - assertEquals(0, - PriorityDisposableRegistry.getRegistry().size()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/pom.xml deleted file mode 100644 index 2452408e371..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - 4.0.0 - - - org.uberfire - uberfire-parent - ${revision} - ../pom.xml - - - uberfire-extensions - pom - - Extensions to UberFire - - - uberfire-widgets - uberfire-runtime-plugins - uberfire-layout-editor - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/pom.xml deleted file mode 100644 index d07798f83b9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-extensions - ${revision} - ../pom.xml - - - uberfire-layout-editor - pom - - Uberfire Layout Editor - - - uberfire-layout-editor-api - uberfire-layout-editor-client - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/LayoutEditorEntryPoint.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/LayoutEditorEntryPoint.java deleted file mode 100644 index e653157ef70..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/LayoutEditorEntryPoint.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.layout.editor.client; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.uberfire.ext.layout.editor.client.resources.WebAppResource; - -@EntryPoint -public class LayoutEditorEntryPoint { - - @PostConstruct - public void init() { - WebAppResource.INSTANCE.css().ensureInjected(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ColumnSizeBuilder.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ColumnSizeBuilder.java deleted file mode 100644 index dfd572a5f88..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ColumnSizeBuilder.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.layout.editor.client.infra; - -import org.gwtbootstrap3.client.ui.constants.ColumnSize; - -public class ColumnSizeBuilder { - - private ColumnSizeBuilder() { - // noop - } - - public static String buildColumnSize(final int value) { - switch (value) { - case 1: - return buildSize(ColumnSize.MD_1); - case 2: - return buildSize(ColumnSize.MD_2); - case 3: - return buildSize(ColumnSize.MD_3); - case 4: - return buildSize(ColumnSize.MD_4); - case 5: - return buildSize(ColumnSize.MD_5); - case 6: - return buildSize(ColumnSize.MD_6); - case 7: - return buildSize(ColumnSize.MD_7); - case 8: - return buildSize(ColumnSize.MD_8); - case 9: - return buildSize(ColumnSize.MD_9); - case 10: - return buildSize(ColumnSize.MD_10); - case 11: - return buildSize(ColumnSize.MD_11); - case 12: - return buildSize(ColumnSize.MD_12); - default: - return buildSize(ColumnSize.MD_12); - } - } - - private static String buildSize(ColumnSize mdSize) { - String size = mdSize.getCssName() + " " + ColumnSize.XS_12.getCssName(); - if (mdSize == ColumnSize.MD_4) { - size += " " + ColumnSize.SM_6.getCssName(); - } else if (mdSize == ColumnSize.MD_5) { - size += " " + ColumnSize.SM_6.getCssName(); - } else if (mdSize == ColumnSize.MD_6) { - size += " " + ColumnSize.SM_6.getCssName(); - } else { - size += " " + ColumnSize.SM_12.getCssName(); - } - return size; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ConfigurationContext.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ConfigurationContext.java deleted file mode 100644 index 7cbedaa039a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/infra/ConfigurationContext.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.layout.editor.client.infra; - -import java.util.Map; -import java.util.function.Supplier; - -import org.uberfire.ext.layout.editor.api.editor.LayoutComponent; -import org.uberfire.ext.layout.editor.api.editor.LayoutTemplate; -import org.uberfire.mvp.Command; - -/** - * This class provides the context required during a layout component configuration - */ -public class ConfigurationContext { - - private LayoutComponent component; - private Command configurationFinish; - private Command configurationCanceled; - private Supplier currentLayoutTemplateSupplier; - - public ConfigurationContext(LayoutComponent component, - Command configurationFinish, - Command configurationCanceled, - Supplier currentLayoutTemplateSupplier) { - this.component = component; - this.configurationFinish = configurationFinish; - this.configurationCanceled = configurationCanceled; - this.currentLayoutTemplateSupplier = currentLayoutTemplateSupplier; - } - - public void setComponentProperty(String key, - String property) { - component.addProperty(key, - property); - } - - public void setComponentSettings(Object settings) { - component.setSettings(settings); - } - - public void removeComponentProperty(String key) { - component.getProperties().remove(key); - } - - public String getComponentProperty(String key) { - return component.getProperties().get(key); - } - - public Map getComponentProperties() { - return component.getProperties(); - } - - public void resetComponentProperties() { - component.getProperties().clear(); - } - - public void configurationFinished() { - configurationFinish.execute(); - } - - public void configurationCancelled() { - configurationCanceled.execute(); - } - - public LayoutTemplate getCurrentLayoutTemplate() { - return currentLayoutTemplateSupplier.get(); - } - - public Command getConfigurationCanceled() { - return configurationCanceled; - } - - public void setConfigurationCanceled(final Command configurationCanceled) { - this.configurationCanceled = configurationCanceled; - } - - public Command getConfigurationFinish() { - return configurationFinish; - } - - public void setConfigurationFinish(final Command configurationFinish) { - this.configurationFinish = configurationFinish; - } - - public LayoutComponent getLayoutComponent() { - return this.component; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/LayoutEditorCss.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/LayoutEditorCss.java deleted file mode 100644 index 8f403615051..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/LayoutEditorCss.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.layout.editor.client.resources; - -import com.google.gwt.resources.client.CssResource; - -public interface LayoutEditorCss extends CssResource { - - @ClassName("dropBorder") - String dropBorder(); - - @ClassName("dropInactive") - String dropInactive(); - - @ClassName("rowContainer") - String rowContainer(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/WebAppResource.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/WebAppResource.java deleted file mode 100644 index 41cd61b770f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/java/org/uberfire/ext/layout/editor/client/resources/WebAppResource.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.layout.editor.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; - -public interface WebAppResource - extends - ClientBundle { - - WebAppResource INSTANCE = GWT.create(WebAppResource.class); - - @Source("css/layout-editor.css") - LayoutEditorCss css(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/resources/org/uberfire/ext/layout/editor/client/resources/css/layout-editor.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/resources/org/uberfire/ext/layout/editor/client/resources/css/layout-editor.css deleted file mode 100644 index ed500717558..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/main/resources/org/uberfire/ext/layout/editor/client/resources/css/layout-editor.css +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.dropBorder { - border: 1px solid dodgerblue; - margin: 10px 10px 15px 10px; - padding: 10px; - height: 50px; -} - -.dropInactive { - border: 1px solid lightgray; - margin: 10px 10px 15px 10px; - padding: 10px; - height: 50px; -} - -.rowContainer { - border: 1px solid lightgray; - margin: 10px; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/test/java/org/uberfire/ext/layout/editor/client/infra/LayoutEditorCssHelperTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/test/java/org/uberfire/ext/layout/editor/client/infra/LayoutEditorCssHelperTest.java deleted file mode 100644 index 880e16c3db2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-layout-editor/uberfire-layout-editor-client/src/test/java/org/uberfire/ext/layout/editor/client/infra/LayoutEditorCssHelperTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.layout.editor.client.infra; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.uberfire.ext.layout.editor.api.css.CssAllowedValue; -import org.uberfire.ext.layout.editor.api.css.CssFontSize; -import org.uberfire.ext.layout.editor.api.css.CssProperty; -import org.uberfire.ext.layout.editor.api.css.CssValue; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class LayoutEditorCssHelperTest { - - private LayoutEditorCssHelper cssHelper; - - @Before - public void setup() { - cssHelper = spy(new LayoutEditorCssHelper()); - } - - @Test - public void testReadFromMap() { - Map properties = new HashMap<>(); - properties.put(CssProperty.MARGIN_TOP.getName(), "100px"); - properties.put("prop1", "v1"); - List cssValueList = cssHelper.readCssValues(properties); - - assertEquals(1, cssValueList.size()); - assertEquals("margin-top", cssValueList.get(0).getProperty()); - assertEquals("100px", cssValueList.get(0).getValue()); - } - - @Test - public void testParseAllowedValue() { - when(cssHelper.formatCssAllowedValue(CssProperty.FONT_SIZE, CssFontSize.XX_LARGE)).thenReturn("Extra Large"); - CssAllowedValue cssAllowedValue = cssHelper.parseCssAllowedValue(CssProperty.FONT_SIZE, "Extra Large"); - assertEquals("xx-large", cssAllowedValue.getName()); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/pom.xml deleted file mode 100644 index ff2aec2a58a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/pom.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-extensions - ${revision} - ../pom.xml - - - uberfire-runtime-plugins - pom - - Uberfire Runtime Plugins - - - uberfire-runtime-plugins-client - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/pom.xml deleted file mode 100644 index 6a2b4204a0c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/pom.xml +++ /dev/null @@ -1,192 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-runtime-plugins - ${revision} - - - uberfire-runtime-plugins-client - jar - - Uberfire Runtime PlugIns Client - Uberfire Runtime PlugIns Client - - - - - org.webjars.npm - marked - ${version.org.webjars.npm.marked} - provided - - - - - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - - org.uberfire - uberfire-testing-utils - test - - - - org.uberfire - uberfire-layout-editor-client - - - - org.gwtbootstrap3 - gwtbootstrap3 - - - org.jboss.errai - errai-bus - - - org.jboss.errai - errai-common - - - org.jboss.errai - errai-ioc - - - org.jboss.errai - errai-ui - - - org.uberfire - uberfire-api - - - org.uberfire - uberfire-layout-editor-api - - - org.uberfire - uberfire-client-api - - - org.uberfire - uberfire-workbench-client - - - - - - org.uberfire - uberfire-client-all - - - - org.uberfire - uberfire-widgets-commons - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - com.google.elemental2 - elemental2-promise - - - - - com.google.gwt - gwt-user - provided - - - - org.webjars.npm - marked - provided - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-marked - process-resources - - unpack - - - - - org.webjars.npm - marked - ${version.org.webjars.npm.marked} - jar - true - ${project.build.directory}/marked - - - false - true - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-marked-resources-js - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/ext/plugin/client/resources/js - - - ${project.build.directory}/marked/META-INF/resources/webjars/marked/${version.org.webjars.npm.marked}/ - - marked.min.js - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/RuntimePluginsEntryPoint.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/RuntimePluginsEntryPoint.java deleted file mode 100644 index eb5f33c5c85..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/RuntimePluginsEntryPoint.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.bus.client.util.BusToolsCli; -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.jboss.errai.ui.shared.api.annotations.Bundle; -import org.uberfire.ext.plugin.client.resources.WebAppResource; - -@EntryPoint -@Bundle("resources/i18n/Constants.properties") -public class RuntimePluginsEntryPoint { - - @PostConstruct - public void init() { - if (!BusToolsCli.isRemoteCommunicationEnabled()) { - return; - } - WebAppResource.INSTANCE.CSS().ensureInjected(); - } - -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/cdi/SingletonBeanDefinition.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/cdi/SingletonBeanDefinition.java deleted file mode 100644 index e0c33f354ac..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/cdi/SingletonBeanDefinition.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.cdi; - -import java.lang.annotation.Annotation; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - -import javax.inject.Singleton; - -import org.jboss.errai.ioc.client.QualifierUtil; -import org.jboss.errai.ioc.client.container.SyncBeanDef; - -public class SingletonBeanDefinition implements SyncBeanDef { - - private final B instance; - private final Class type; - private final Set qualifiers; - private final String name; - private final boolean activated; - private final Set> assignableTypes = new HashSet<>(); - - public SingletonBeanDefinition(final B instance, - final Class type, - final Set qualifiers, - final String name, - final boolean activated, - final Class... otherAssignableTypes) { - this.instance = instance; - this.type = type; - this.qualifiers = qualifiers; - this.name = name; - this.activated = activated; - assignableTypes.add(type); - assignableTypes.addAll(Arrays.asList(otherAssignableTypes)); - } - - @Override - public Class getType() { - return type; - } - - @Override - public Class getBeanClass() { - return instance.getClass(); - } - - @Override - public Class getScope() { - return Singleton.class; - } - - @Override - public T getInstance() { - return instance; - } - - @Override - public T newInstance() { - throw new UnsupportedOperationException(); - } - - @Override - public Set getQualifiers() { - return qualifiers == null ? Collections.emptySet() : qualifiers; - } - - @Override - public boolean matches(final Set annotations) { - return QualifierUtil.matches(annotations, getQualifiers()); - } - - @Override - public String getName() { - return name; - } - - @Override - public boolean isActivated() { - return activated; - } - - @Override - public boolean isAssignableTo(final Class type) { - return assignableTypes.contains(type); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorActivity.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorActivity.java deleted file mode 100644 index ef8f712de9e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorActivity.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.perspective.editor.generator; - -import org.uberfire.client.mvp.PerspectiveActivity; -import org.uberfire.client.workbench.panels.impl.LayoutPanelPresenter; -import org.uberfire.ext.layout.editor.api.editor.LayoutTemplate; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.mvp.impl.DefaultPlaceRequest; -import org.uberfire.workbench.model.ActivityResourceType; -import org.uberfire.workbench.model.PanelDefinition; -import org.uberfire.workbench.model.PartDefinition; -import org.uberfire.workbench.model.PerspectiveDefinition; -import org.uberfire.workbench.model.impl.PartDefinitionImpl; -import org.uberfire.workbench.model.impl.PerspectiveDefinitionImpl; - -public class PerspectiveEditorActivity implements PerspectiveActivity { - - private LayoutTemplate editor; - private PerspectiveEditorScreenActivity screen; - private PlaceRequest place; - - public PerspectiveEditorActivity(final LayoutTemplate editor, - PerspectiveEditorScreenActivity screen) { - this.editor = editor; - this.screen = screen; - } - - public void update(final LayoutTemplate editor, - PerspectiveEditorScreenActivity screen) { - this.editor = editor; - this.screen = screen; - } - - public PerspectiveEditorScreenActivity getScreen() { - return screen; - } - - @Override - public PlaceRequest getPlace() { - return place; - } - - @Override - public void onStartup(final PlaceRequest place) { - this.place = place; - } - - @Override - public void onOpen() { - - } - - @Override - public void onClose() { - } - - @Override - public void onShutdown() { - } - - @Override - public PerspectiveDefinition getDefaultPerspectiveLayout() { - return buildPerspective(); - } - - public PerspectiveDefinition buildPerspective() { - final PerspectiveDefinition perspectiveDefinition = new PerspectiveDefinitionImpl(getDefaultPanelType()); - perspectiveDefinition.setName(editor.getName()); - - final PanelDefinition root = perspectiveDefinition.getRoot(); - - final PlaceRequest placeRequest = new DefaultPlaceRequest(screen.getIdentifier()); - final PartDefinition partDefinition = new PartDefinitionImpl(placeRequest); - root.addPart(partDefinition); - - return perspectiveDefinition; - } - - protected String getDefaultPanelType() { - return LayoutPanelPresenter.class.getName(); - } - - @Override - public String getIdentifier() { - return editor.getName(); - } - - @Override - public boolean isDefault() { - return false; - } - - @Override - public boolean isTransient() { - return false; - } - - @Override - public ActivityResourceType getResourceType() { - return ActivityResourceType.PERSPECTIVE; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorScreenActivity.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorScreenActivity.java deleted file mode 100644 index 2a1357da4fa..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/perspective/editor/generator/PerspectiveEditorScreenActivity.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.perspective.editor.generator; - -import com.google.gwt.user.client.ui.IsWidget; -import org.jboss.errai.common.client.ui.ElementWrapperWidget; -import org.uberfire.client.mvp.WorkbenchScreenActivity; -import org.uberfire.ext.layout.editor.api.editor.LayoutInstance; -import org.uberfire.ext.layout.editor.api.editor.LayoutTemplate; -import org.uberfire.ext.layout.editor.client.generator.LayoutGenerator; -import org.uberfire.mvp.PlaceRequest; -import org.uberfire.workbench.model.ActivityResourceType; -import org.uberfire.workbench.model.NamedPosition; -import org.uberfire.workbench.model.Position; - -public class PerspectiveEditorScreenActivity implements WorkbenchScreenActivity { - - private final LayoutGenerator layoutGenerator; - private LayoutTemplate layoutTemplate; - private PlaceRequest place; - private String identifier; - - public PerspectiveEditorScreenActivity(LayoutTemplate layoutTemplate, - final LayoutGenerator layoutGenerator) { - this.layoutTemplate = layoutTemplate; - this.layoutGenerator = layoutGenerator; - this.identifier = buildScreenId(layoutTemplate.getName()); - } - - public static String buildScreenId(String perspectiveId) { - // AF-905: [Layout Editor] Errors while creating a page with the name of an existing screen - // Make sure the generated id. doesn't clash with any existing screen - return perspectiveId + " [Screen]"; - } - - public LayoutTemplate getLayoutTemplate() { - return layoutTemplate; - } - - public void setLayoutTemplate(LayoutTemplate layoutTemplate) { - this.layoutTemplate = layoutTemplate; - } - - @Override - public void onStartup(PlaceRequest place) { - this.place = place; - } - - @Override - public PlaceRequest getPlace() { - return place; - } - - @Override - public String getIdentifier() { - return identifier; - } - - @Override - public boolean onMayClose() { - return true; - } - - @Override - public void onClose() { - } - - @Override - public void onShutdown() { - } - - @Override - public Position getDefaultPosition() { - return new NamedPosition("mainContainer"); - } - - @Override - public PlaceRequest getOwningPlace() { - return null; - } - - @Override - public void onFocus() { - } - - @Override - public void onLostFocus() { - } - - @Override - public String getTitle() { - return ""; - } - - @Override - public IsWidget getTitleDecoration() { - return null; - } - - @Override - public IsWidget getWidget() { - LayoutInstance layoutInstance = layoutGenerator.build(layoutTemplate); - layoutInstance.getElement().classList.add("uf-perspective-component", "uf-le-overflow"); - return ElementWrapperWidget.getWidget(layoutInstance.getElement()); - } - - - @Override - public void onOpen() { - // no op - } - - @Override - public String contextId() { - return getIdentifier(); - } - - @Override - public ActivityResourceType getResourceType() { - return ActivityResourceType.SCREEN; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/PluginCss.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/PluginCss.java deleted file mode 100644 index 5ba55446088..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/PluginCss.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources; - -import com.google.gwt.resources.client.CssResource; - -public interface PluginCss extends CssResource { - - String content(); - - @ClassName("editor-wrapping") - String editorWrapping(); - - String window(); - - String column(); - - String bottom(); - - String left(); - - String right(); - - @ClassName("handler-vertical") - String handlerVertical(); - - @ClassName("handler-horizontal") - String handlerHorizontal(); - - String top(); - - String buttonAddParameter(); - - @ClassName("window-label") - String windowLabel(); - - @ClassName("bottom-inverted") - String bottomInverted(); - - @ClassName("top-inverted") - String topInverted(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/css/plugin.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/css/plugin.css deleted file mode 100644 index 07389bee22a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/css/plugin.css +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.content { - position: absolute; - height: auto; - bottom: 0; - top: 0; - left: 0; - right: 0; - margin: 14px 15px; - min-height: 300px; -} - -.column { - display: block; - height: 100%; - width: 50%; -} - -.buttonAddParameter { - float: right; - margin-top: 5px; - margin-right: 20px; -} - -.window { - width: 100%; - border: 1px solid #c0c0c0; - box-shadow: inset 0 1px 2px #e4e4e4; -} - -.top { - height: 25%; - position: absolute; - top: -6px; -} - -.bottom { - height: 75%; - position: absolute; - bottom: -6px; -} - -.top-inverted { - height: 75%; - position: absolute; - top: -6px; -} - -.bottom-inverted { - height: 25%; - position: absolute; - bottom: -6px; -} - -.right { - position: absolute; - right: -5px; -} - -.left { - position: absolute; - left: -5px; -} - -@url handleVertical handleVertical; - -.handler-vertical { - width: 8px; - height: 100%; - padding: 5px 0; - cursor: col-resize; - position: absolute; - top: -5px; - left: 0; - background: handleVertical 3px 50% no-repeat; -} - -@url handleHorizontal handleHorizontal; - -.handler-horizontal { - width: 100%; - height: 8px; - padding: 0 1px; - cursor: row-resize; - position: absolute; - top: 0; - left: 0; - background: handleHorizontal 50% 3px no-repeat; -} - -.window-label { - border: solid 1px #f1f1f1; - background: #fff; - display: inline-block; - height: 22px; - padding: 0 6px; - line-height: 22px; - position: absolute; - top: 7px; - right: 6px; - text-align: center; - font-size: 12px; - color: #777; - border-radius: 1px; - z-index: 30; -} - -.editor-wrapping { - width: 100%; - height: 100%; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.java deleted file mode 100644 index a5c51c3f7e1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources.i18n; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.i18n.client.Messages; - -public interface CommonConstants - extends - Messages { - - public static final CommonConstants INSTANCE = GWT.create(CommonConstants.class); - - String SavePerspective(); - - String PerspectiveName(); - - String PerspectiveNameHolder(); - - String TagName(); - - String AddTag(); - - String TagLabel(); - - String TagNameHolder(); - - String InvalidPerspectiveName(); - - String InvalidTagName(); - - String InvalidParameterName(); - - String InvalidActivityID(); - - String InvalidMenuLabel(); - - String EmptyTagName(); - - String EmptyParameterName(); - - String EmptyActivityID(); - - String EmptyMenuLabel(); - - String DuplicatedMenuLabel(); - - String DuplicateParameterName(); - - String LoadPerspective(); - - String EditHtml(); - - String EditComponent(); - - String Add(); - - String AddNewParameter(); - - String ParamKey(); - - String ParamKeyPlaceHolder(); - - String ParamValue(); - - String ParamValuePlaceHolder(); - - String InvalidGridConfiguration(); - - String MenusNoMenuItems(); - - String MenusMoveUpHint(); - - String MenusMoveDownHint(); - - String MenusActivityID(); - - String MenusLabel(); - - String MenusDeleteHint(); - - String MenusDelete(); - - String DragAndDrop(); - - String NewPerspective(); - - String NewPerspectivePopUpTitle(); - - String NewPerspectiveLayoutPopUpTitle(); - - String NewScreen(); - - String NewScreenPopUpTitle(); - - String NewEditor(); - - String NewEditorPopUpTitle(); - - String NewSplashScreen(); - - String NewSplashScreenPopUpTitle(); - - String NewDynamicMenu(); - - String NewDynamicMenuPopUpTitle(); - - String HTMLComponent(); - - String HTMLplaceHolder(); - - String ScreenComponent(); - - String TargetDivComponent(); - - String TargetDivPlaceHolder(); - - String TargetDivConfiguration(); - - String ScreenConfiguration(); - - String PlaceName(); - - String EmptyTitleText(); - - String EmptySubTitleText(); - - String PluginsExplorer(); - - String PerspectivePlugin(); - - String ScreenPlugin(); - - String EditorPlugin(); - - String SplashScreenPlugin(); - - String DynamicMenu(); - - String PerspectiveEditor(); - - String ScreenPluginEditor(); - - String EditorPluginEditor(); - - String SplashScreenPluginEditor(); - - String DynamicMenuEditor(); - - String MenuItem(); - - String ActivityId(); - - String MenuLabel(); - - String Ok(); - - String Cancel(); - - String Name(); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/Constants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/Constants.java deleted file mode 100644 index 8ad1be3ea2b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/Constants.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources.i18n; - -import org.jboss.errai.ui.shared.api.annotations.TranslationKey; - -public class Constants { - - @TranslationKey(defaultValue = "") - public static final String EditHTMLView_Title = "EditHTMLView.Title"; - - @TranslationKey(defaultValue = "") - public static final String EditHTMLView_Ok = "EditHTMLView.Ok"; - - @TranslationKey(defaultValue = "") - public static final String EditHTMLView_Cancel = "EditHTMLView.Cancel"; - - @TranslationKey(defaultValue = "") - public static final String EditHTMLView_HtmlPlaceHolder = "EditHTMLView.HtmlPlaceHolder"; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.java deleted file mode 100644 index 5cde6306ace..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources.i18n; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.i18n.client.Messages; - -public interface PerspectiveEditorPaletteConstants extends Messages, PerspectiveEditorPaletteI18n { - - PerspectiveEditorPaletteConstants INSTANCE = GWT.create(PerspectiveEditorPaletteConstants.class); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18n.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18n.java deleted file mode 100644 index 260157e028e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18n.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources.i18n; - -/** - * Perspective Editor's component palette i18n literals - */ -public interface PerspectiveEditorPaletteI18n { - - String coreComponentGroupName(); - - String navComponentGroupName(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18nImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18nImpl.java deleted file mode 100644 index aeeb6f3f443..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteI18nImpl.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.plugin.client.resources.i18n; - -import javax.enterprise.context.ApplicationScoped; - -@ApplicationScoped -public class PerspectiveEditorPaletteI18nImpl implements PerspectiveEditorPaletteI18n { - - @Override - public String coreComponentGroupName() { - return PerspectiveEditorPaletteConstants.INSTANCE.coreComponentGroupName(); - } - - @Override - public String navComponentGroupName() { - return PerspectiveEditorPaletteConstants.INSTANCE.navComponentGroupName(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-h.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-h.png deleted file mode 100644 index d743e52e482..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-h.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-v.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-v.png deleted file mode 100644 index 0e1a9598eee..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/java/org/uberfire/ext/plugin/client/resources/images/handle-v.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.properties deleted file mode 100644 index c30711ba0a3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants.properties +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -SavePerspective=Save Page -PerspectiveName=Page Name -PerspectiveNameHolder=pagename -TagName=Tag Name -TagNameHolder=tag name -AddTag= Add Tag -TagLabel=Tags -InvalidPerspectiveName=Invalid Page Name -InvalidTagName=Invalid Tag Name -InvalidParameterName=Invalid Parameter Name -InvalidActivityID=Invalid Activity ID -InvalidMenuLabel=Invalid Menu Label -EmptyTagName=Invalid Tag Name -EmptyParameterName=Invalid Parameter Name -EmptyActivityID=An Activity ID is mandatory and cannot be empty. -EmptyMenuLabel=A Label is mandatory and cannot be empty. -DuplicatedMenuLabel=A Menu Item with this Label already exists. -DuplicateParameterName=Duplicate Parameter Name -LoadPerspective=Load Page -EditHtml=Edit HTML Component -EditComponent=Edit Component -Add=Add -AddNewParameter=Add New Parameter -ParamKey=Key -ParamKeyPlaceHolder=param key -ParamValue=Value -ParamValuePlaceHolder=param value -InvalidGridConfiguration=A Row is built on 12-column grids. Grid columns are created by specifying the number of 12 available columns you wish to span. -MenusNoMenuItems=No menu items. -MenusMoveUpHint=Move up -MenusMoveDownHint=Move down -MenusActivityID=Activity ID -MenusLabel=Label -MenusDeleteHint=Delete row. -MenusDelete=Delete -DragAndDrop=Drag and drop -ClickToDisplay=Click to show/hide plugins -NewPerspective=New Page -NewPerspectivePopUpTitle=New Page ... -NewPerspectiveLayoutPopUpTitle=New Page Layout ... -NewScreen=New Screen -NewScreenPopUpTitle=New Screen Plugin... -NewEditor=New Editor -NewEditorPopUpTitle=New Editor Plugin... -NewSplashScreen=New SplashScreen -NewSplashScreenPopUpTitle=New Splash Plugin... -NewDynamicMenu=New DynamicMenu -NewDynamicMenuPopUpTitle=New Dynamic Menu... -HTMLComponent=HTML -HTMLplaceHolder=Add your HTML here... -ScreenComponent=Screen -ScreenConfiguration=Screen Configuration -TargetDivComponent=Target Div -TargetDivPlaceHolder=Div ID: -TargetDivConfiguration=Target Div Configuration -PlaceName=Place Name -EmptyTitleText=Create a new Page -EmptySubTitleText=Drag a Component here to start building a new page. -PluginsExplorer=Plugins Explorer -PerspectivePlugin=Page plugin -ScreenPlugin=Screen plugin -EditorPlugin=Editor plugin -SplashScreenPlugin=SplashScreen plugin -DynamicMenu=Dynamic Menu -PerspectiveEditor=Page Editor -ScreenPluginEditor=Screen Plugin Editor -EditorPluginEditor=Editor Plugin Editor -SplashScreenPluginEditor=SplashScreen Plugin Editor -DynamicMenuEditor=Dynamic Menu Editor -MenuItem=Menu Item -ActivityId=Activity Id -MenuLabel=Menu Label -Ok=Ok -Cancel=Cancel -Name=Name diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_de.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_de.properties deleted file mode 100644 index 8d21f8b52c9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_de.properties +++ /dev/null @@ -1,58 +0,0 @@ -TagName=Tagname -TagNameHolder=Tagname -AddTag=Tag hinzufüen -TagLabel=Tags -InvalidTagName=Ungültiger Tagname -InvalidParameterName=Ungültiger Parametername -InvalidActivityID=Ungültige Aktivitäts-ID -InvalidMenuLabel=Ungültige Menübezeichnung -EmptyTagName=Ungültiger Tagname -EmptyParameterName=Ungültiger Parametername -EmptyActivityID=Eine Aktivitäts-ID ist obligatorisch und kann nicht leer gelassen werden. -EmptyMenuLabel=Eine Bezeichnung ist obligatorisch und kann nicht leer gelassen werden. -DuplicatedMenuLabel=Ein Menüelement mit dieser Bezeichnung existiert bereits. -DuplicateParameterName=Parameternamen duplizieren -EditHtml=HTML Komponente bearbeiten -EditComponent=Komponente bearbeiten -Add=Hinzufügen -AddNewParameter=Neuen Parameter hinzufügen -ParamKey=Schlüssel -ParamKeyPlaceHolder=param Schlüssel -ParamValue=Wert -ParamValuePlaceHolder=param Wert -InvalidGridConfiguration=Eine Reihe wird auf 12-Spalten Grids aufgebaut. Grid-Spalten werden erstellt, indem die Anzahl von 12 verfügbaren Spalten angegeben wird, die Sie umfassen möchten. -MenusNoMenuItems=Keine Menüelemente. -MenusMoveUpHint=Nach oben verschieben -MenusMoveDownHint=Nach unten verschieben -MenusActivityID=Aktivitäts-ID -MenusLabel=Bezeichnung -MenusDeleteHint=Reihe löschen -MenusDelete=Löschen -DragAndDrop=Ziehen und ablegen -ClickToDisplay=Zum Einblenden/Ausblenden der Plugins hier klicken -NewScreen=Neuer Bildschirm -NewScreenPopUpTitle=Neues Bildschirm-Plugin... -NewEditor=Neuer Editor -NewEditorPopUpTitle=Neues Editor-Plugin... -NewSplashScreen=Neuer Begrüßungsblidschirm -NewSplashScreenPopUpTitle=Neues Begrüßungsblidschirm-Plugin... -NewDynamicMenu=Neues dynamisches Menü -NewDynamicMenuPopUpTitle=Neues dynamisches Menü... -HTMLplaceHolder=Geben Sie Ihre HTML hier ein... -ScreenConfiguration=Bildschirm-Konfiguration -PlaceName=Name des Speicherorts -PluginsExplorer=Plugins-Explorer -ScreenPlugin=Bildschirm-Plugin -EditorPlugin=Editor-Plugin -SplashScreenPlugin=Begrüßungsbildschirm-Plugin -DynamicMenu=Dynamisches Menü -ScreenPluginEditor=Bildschirm-Plugin-Editor -EditorPluginEditor=Editor-Plugin-Editor -SplashScreenPluginEditor=Begrüßungsbildschirm-Plugin-Editor -DynamicMenuEditor=Dynamisches-Menü-Editor -MenuItem=Menüelement -ActivityId=Aktivitäts-ID -MenuLabel=Menübezeichnung -Ok=OK -Cancel=Abbrechen -Name=Name diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_es.properties deleted file mode 100644 index b7db5385744..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_es.properties +++ /dev/null @@ -1,92 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -SavePerspective=Guardar página -PerspectiveName=Nombre de página -PerspectiveNameHolder=nombre de página -TagName=Nombre de etiqueta -TagNameHolder=nombre de etiqueta -AddTag= Agregar etiqueta -TagLabel=Etiquetas -InvalidPerspectiveName=Nombre de página no válido -InvalidTagName=Nombre de etiqueta no válido -InvalidParameterName=Nombre de parámetro no válido -InvalidActivityID=ID de actividad no válida -InvalidMenuLabel=Etiqueta de menú no válida -EmptyTagName=Nombre de etiqueta no válido -EmptyParameterName=Nombre de parámetro no válido -EmptyActivityID=ID de actividad es un campo obligatorio y no puede estar vacío. -EmptyMenuLabel=Etiqueta es un campo obligatorio y no puede estar vacío. -DuplicatedMenuLabel=Ya existe un ítem de menú con esta etiqueta. -DuplicateParameterName=Duplicar el nombre del parámetro -LoadPerspective=Cargar página -EditHtml=Editar componente HTML -EditComponent=Editar componente -Add=Agregar -AddNewParameter=Agregar nuevo parámetro -ParamKey=Clave -ParamKeyPlaceHolder=clave de parámetro -ParamValue=Valor -ParamValuePlaceHolder=valor de parámetro -InvalidGridConfiguration=Una fila se construye sobre una cuadrícula de 12 columnas. Las columnas de la cuadrícula se crean especificando la cantidad de las 12 columnas disponibles que desea abarcar. -MenusNoMenuItems=No hay ítems de menú. -MenusMoveUpHint=Mover hacia arriba -MenusMoveDownHint=Mover hacia abajo -MenusActivityID=ID de actividad -MenusLabel=Etiqueta -MenusDeleteHint=Eliminar fila. -MenusDelete=Eliminar -DragAndDrop=Arrastrar y soltar -ClickToDisplay=Hacer clic para mostrar/ocultar complementos -NewPerspective=Nueva página -NewPerspectivePopUpTitle=Nueva página… -NewPerspectiveLayoutPopUpTitle=Nueva disposición de página… -NewScreen=Nueva pantalla -NewScreenPopUpTitle=Nuevo complemento de pantalla… -NewEditor=Nuevo editor -NewEditorPopUpTitle=Nuevo complemento de editor… -NewSplashScreen=Nueva pantalla de presentación -NewSplashScreenPopUpTitle=Nuevo complemento de presentación -NewDynamicMenu=Nuevo menú dinámico -NewDynamicMenuPopUpTitle=Nuevo menú dinámico… -HTMLComponent=HTML -HTMLplaceHolder=Agregue su HTML aquí… -ScreenComponent=Pantalla -ScreenConfiguration=Configuración de pantalla -TargetDivComponent=Div. objetivo -TargetDivPlaceHolder=ID de div.: -TargetDivConfiguration=Configuración de div. objetivo -PlaceName=Nombre de lugar -EmptyTitleText=Crear una nueva página -EmptySubTitleText=Arrastrar un componente aquí para empezar a construir una nueva página. -PluginsExplorer=Explorador de complementos -PerspectivePlugin=Complemento de página -ScreenPlugin=Complemento de pantalla -EditorPlugin=Complemento de editor -SplashScreenPlugin=Complemento de pantalla de presentación -DynamicMenu=Menú dinámico -PerspectiveEditor=Editor de página -ScreenPluginEditor=Editor de complemento de pantalla -EditorPluginEditor=Editor de complemento de editor -SplashScreenPluginEditor=Editor de complemento de pantalla de presentación -DynamicMenuEditor=Editor de menús dinámicos -MenuItem=Ítem de menú -ActivityId=ID de actividad -MenuLabel=Etiqueta de menú -Ok=Aceptar -Cancel=Cancelar -Name=Nombre - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_fr.properties deleted file mode 100644 index b40af52d63b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_fr.properties +++ /dev/null @@ -1,92 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -SavePerspective=Enregistrer la page -PerspectiveName=Nom de la page -PerspectiveNameHolder=pagename -TagName=Nom de la balise -TagNameHolder=nom balise -AddTag= Ajouter une balise -TagLabel=Balises -InvalidPerspectiveName=Nom de page non valide -InvalidTagName=Nom d’étiquette non valide -InvalidParameterName=Nom de paramètre non valide -InvalidActivityID=ID d’activité non valide -InvalidMenuLabel=Étiquette de menu non valide -EmptyTagName=Nom d’étiquette non valide -EmptyParameterName=Nom de paramètre non valide -EmptyActivityID=L’ID d’activité est obligatoire et ne peut pas être vide. -EmptyMenuLabel=L’étiquette est obligatoire et ne peut pas être vide. -DuplicatedMenuLabel=Il existe déjà un élément de menu avec cette étiquette. -DuplicateParameterName=Nom de paramètre en double -LoadPerspective=Charger la page -EditHtml=Modifier le composant HTML -EditComponent=Modifier le composant -Add=Ajouter -AddNewParameter=Ajouter un nouveau paramètre -ParamKey=Clé -ParamKeyPlaceHolder=clé paramètre -ParamValue=Valeur -ParamValuePlaceHolder=valeur paramètre -InvalidGridConfiguration=Une ligne est construite sur des grilles de 12 colonnes. Pour créer les colonnes de la grille, indiquez le nombre de 12 colonnes disponibles que vous souhaitez couvrir. -MenusNoMenuItems=Aucun élément de menu. -MenusMoveUpHint=Déplacer vers le haut -MenusMoveDownHint=Déplacer vers le bas -MenusActivityID=ID d’activité -MenusLabel=Étiquette -MenusDeleteHint=Supprimez la ligne. -MenusDelete=Supprimer -DragAndDrop=Glisser-déposer -ClickToDisplay=Cliquez pour afficher/masquer les plug-ins -NewPerspective=Nouvelle page -NewPerspectivePopUpTitle=Nouvelle page… -NewPerspectiveLayoutPopUpTitle=Nouvelle mise en page… -NewScreen=Nouvel écran -NewScreenPopUpTitle=Nouveau plug-in d’écran… -NewEditor=Nouvel éditeur -NewEditorPopUpTitle=Nouveau plug-in d’éditeur… -NewSplashScreen=Nouvel écran de démarrage -NewSplashScreenPopUpTitle=Nouveau plug-in d’écran de démarrage… -NewDynamicMenu=Nouveau menu dynamique -NewDynamicMenuPopUpTitle=Nouveau menu dynamique… -HTMLComponent=HTML -HTMLplaceHolder=Ajoutez votre contenu HTML ici… -ScreenComponent=Écran -ScreenConfiguration=Configuration de l’écran -TargetDivComponent=Div cible -TargetDivPlaceHolder=ID div : -TargetDivConfiguration=Configuration de div cible -PlaceName=Nom du lieu -EmptyTitleText=Créer une page -EmptySubTitleText=Faites glisser un composant ici pour commencer à compiler une nouvelle page. -PluginsExplorer=Explorateur de plug-ins -PerspectivePlugin=Plug-in de page -ScreenPlugin=Plug-in d’écran -EditorPlugin=Plug-in d’éditeur -SplashScreenPlugin=Plug-in d’écran de démarrage -DynamicMenu=Menu dynamique -PerspectiveEditor=Éditeur de page -ScreenPluginEditor=Éditeur de plug-in d''écran -EditorPluginEditor=Éditeur de plug-in d’éditeur -SplashScreenPluginEditor=Éditeur de plug-in d’écran de démarrage -DynamicMenuEditor=Éditeur de menu dynamique -MenuItem=Élément de menu -ActivityId=ID d’activité -MenuLabel=Étiquette de menu -Ok=OK -Cancel=Annuler -Name=Nom - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_ja.properties deleted file mode 100644 index d9105bd7768..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_ja.properties +++ /dev/null @@ -1,92 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -SavePerspective=ページの保存 -PerspectiveName=ページ名 -PerspectiveNameHolder=ページ名 -TagName=タグ名 -TagNameHolder=タグ名 -AddTag= タグの追加 -TagLabel=タグ -InvalidPerspectiveName=無効なページ名 -InvalidTagName=無効なタグ名 -InvalidParameterName=無効なパラメーター名 -InvalidActivityID=無効なアクティビティー名 -InvalidMenuLabel=無効なメニューラベル -EmptyTagName=無効なタグ名 -EmptyParameterName=無効なパラメーター名 -EmptyActivityID=アクティビティー ID は必須項目のため空白にはできません。 -EmptyMenuLabel=ラベルは必須項目のため空白にはできません。 -DuplicatedMenuLabel=このラベルの付いたメニューアイテムはすでに存在します。 -DuplicateParameterName=重複したパラメーター名 -LoadPerspective=ページのロード -EditHtml=HTML コンポーネントの編集 -EditComponent=コンポーネントの編集 -Add=追加 -AddNewParameter=新規パラメーターの追加 -ParamKey=キー -ParamKeyPlaceHolder=パラメーターキー -ParamValue=値 -ParamValuePlaceHolder=パラメーター値 -InvalidGridConfiguration=行が 12 個あるグリッド上に行が構築されます。グリッド行は、使用できる 12 個の行の番号を指定して作成されます。 -MenusNoMenuItems=メニュー項目がありません。 -MenusMoveUpHint=上に移動 -MenusMoveDownHint=下に移動 -MenusActivityID=アクティビティー ID -MenusLabel=ラベル -MenusDeleteHint=行を削除。 -MenusDelete=削除 -DragAndDrop=ドラグアンドドロップ要素 -ClickToDisplay=クリックしてプラグインを表示/非表示 -NewPerspective=新規ページ -NewPerspectivePopUpTitle=新規ページ ... -NewPerspectiveLayoutPopUpTitle=新規ページのレイアウト... -NewScreen=新規スクリーン -NewScreenPopUpTitle=新規スクリーンのプラグイン -NewEditor=新規エディター -NewEditorPopUpTitle=新規エディターのプラグイン -NewSplashScreen=新規スプラッシュ画面 -NewSplashScreenPopUpTitle=新規スプラッシュのプラグイン -NewDynamicMenu=新規 Dynamic メニュー -NewDynamicMenuPopUpTitle=新規 Dynamic メニュー -HTMLComponent=HTML -HTMLplaceHolder=ここに HTML を追加してください -ScreenComponent=スクリーン -ScreenConfiguration=スクリーン設定 -TargetDivComponent=ターゲット Div -TargetDivPlaceHolder=Div ID -TargetDivConfiguration=ターゲット Div 設定 -PlaceName=場所の名前 -EmptyTitleText=新規ページの作成 -EmptySubTitleText=ここにコンポーネントをドラッグして新規ページを構築 -PluginsExplorer=プラグインエクスプローラー -PerspectivePlugin=ページのプラグイン -ScreenPlugin=スクリーンプラグイン -EditorPlugin=エディタープラグイン -SplashScreenPlugin=スプラッシュ画面プラグイン -DynamicMenu=ダイナミックメニュー -PerspectiveEditor=ページエディター -ScreenPluginEditor=スクリーンプラグインエディター -EditorPluginEditor=エディタープラグインエディター -SplashScreenPluginEditor=スプラッシュ画面プラグインエディター -DynamicMenuEditor=ダイナミックメニューエディター -MenuItem=メニュー項目 -ActivityId=アクティビティー ID -MenuLabel=メニューラベル -Ok=OK -Cancel=キャンセル -Name=Name - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_pt_BR.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_pt_BR.properties deleted file mode 100644 index f3cc87054ff..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_pt_BR.properties +++ /dev/null @@ -1,58 +0,0 @@ -TagName=Nome da Tag -TagNameHolder=nome da tag -AddTag=Adicionar Tag -TagLabel=Tags -InvalidTagName=Nome da Tag Inválido -InvalidParameterName=Nome do Parâmetro Inválido -InvalidActivityID=ID de Atividade Inválida -InvalidMenuLabel=Rótulo do Menu Inválido -EmptyTagName=Nome da Tag Inválido -EmptyParameterName=Nome do Parâmetro Inválido -EmptyActivityID=A ID de Atividade é mandatória e não pode estar vazia. -EmptyMenuLabel=O Rótulo é mandatório e não pode estar vazio. -DuplicatedMenuLabel=Um Item de Menu com este rótulo já existe. -DuplicateParameterName=Nome de Parâmetro Duplicado -EditHtml=Editar o Componente HTML -EditComponent=Editar o Componente -Add=Adicionar -AddNewParameter=Adicionar Novo Parâmetro -ParamKey=Chave -ParamKeyPlaceHolder=chave de parâmetro -ParamValue=Valor -ParamValuePlaceHolder=valor do parâmetro -InvalidGridConfiguration=Uma linha é construída em grades de 12 colunas. As colunas de grade são criadas especificando o número de 12 colunas disponíveis que você deseja abarcar. -MenusNoMenuItems=Nenhum item de menu. -MenusMoveUpHint=Mover para cima -MenusMoveDownHint=Mover para baixo -MenusActivityID=ID de Atividade -MenusLabel=Rótulo -MenusDeleteHint=Excluir linha. -MenusDelete=Excluir -DragAndDrop=Arrastar e soltar -ClickToDisplay=Clique para mostrar/ esconder os plugins -NewScreen=Nova Tela -NewScreenPopUpTitle=Novo Plugin da Tela... -NewEditor=Novo Editor -NewEditorPopUpTitle=Novo Plugin do Editor... -NewSplashScreen=Nova Tela Inicial -NewSplashScreenPopUpTitle=Novo Plugin da Tela Inicial... -NewDynamicMenu=Novo Menu Dinâmico -NewDynamicMenuPopUpTitle=Novo Menu Dinâmico... -HTMLplaceHolder=Adicione seu HTML aqui... -ScreenConfiguration=Configuração de Tela -PlaceName=Nome do Local -PluginsExplorer=Explorer de Plugins -ScreenPlugin=Plugin de tela -EditorPlugin=Plugin do Editor -SplashScreenPlugin=Plugin de SplashScreen -DynamicMenu=Menu dinâmico -ScreenPluginEditor=Editor do plugin de tela -EditorPluginEditor=Editor do plugin de editor -SplashScreenPluginEditor=Editor do plugin de SplashScreen -DynamicMenuEditor=Editor do menu dinâmico -MenuItem=Item de menu -ActivityId=ID de Atividade -MenuLabel=Rótulo do Menu -Ok=Ok -Cancel=Cancelar -Name=Nome diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_zh_CN.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_zh_CN.properties deleted file mode 100644 index 6b820308950..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/CommonConstants_zh_CN.properties +++ /dev/null @@ -1,58 +0,0 @@ -TagName=标签名称 -TagNameHolder=标签名称 -AddTag=添加标签 -TagLabel=标签 -InvalidTagName=无效的标签名称 -InvalidParameterName=无效的参数名称 -InvalidActivityID=无效的活动 ID -InvalidMenuLabel=无效的菜单标签 -EmptyTagName=无效标签名称 -EmptyParameterName=无效参数名称 -EmptyActivityID=活动 ID 为必填项,不能为空。 -EmptyMenuLabel=标签为必填项,不能为空。 -DuplicatedMenuLabel=使用这个标签的菜单项已存在。 -DuplicateParameterName=重复的参数名称 -EditHtml=编辑 HTML 组件 -EditComponent=编辑透视 -Add=添加 -AddNewParameter=添加新的参数 -ParamKey=键 -ParamKeyPlaceHolder=参数键 -ParamValue=值 -ParamValuePlaceHolder=参数值 -InvalidGridConfiguration=一行由 12 列的网格组成。通过指定要跨越 12 个可用列的数量来创建网格列。 -MenusNoMenuItems=无菜单项 -MenusMoveUpHint=上移 -MenusMoveDownHint=下移 -MenusActivityID=Activity ID -MenusLabel=标签 -MenusDeleteHint=删除行 -MenusDelete=删除 -DragAndDrop=拖放 -ClickToDisplay=点击显示/隐藏插件 -NewScreen=新页面 -NewScreenPopUpTitle=新页面插件...... -NewEditor=新编辑器 -NewEditorPopUpTitle=新编辑器插件...... -NewSplashScreen=新 SplashScreen -NewSplashScreenPopUpTitle=新 Splash 插件...... -NewDynamicMenu=新动态菜单 -NewDynamicMenuPopUpTitle=新动态菜单...... -HTMLplaceHolder=在这里添加 HTML...... -ScreenConfiguration=页面配置 -PlaceName=地点名称 -PluginsExplorer=插件浏览器 -ScreenPlugin=页面插件 -EditorPlugin=编辑器插件 -SplashScreenPlugin=SplashScreen 插件 -DynamicMenu=动态菜单 -ScreenPluginEditor=页面插件编辑器 -EditorPluginEditor=编辑器插件编辑器 -SplashScreenPluginEditor=SplashScreen 插件编辑器 -DynamicMenuEditor=动态菜单编辑器 -MenuItem=菜单项目 -ActivityId=活动 ID -MenuLabel=菜单标签 -Ok=确定 -Cancel=取消 -Name=名称 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants.properties deleted file mode 100644 index 093fa4330e7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -EditHTMLView.Title=Edit HTML Component -EditHTMLView.Ok=Ok -EditHTMLView.Cancel=Cancel -EditHTMLView.HtmlPlaceHolder=Add your HTML here... \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_de.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_de.properties deleted file mode 100644 index 424c572cafb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_de.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -EditHTMLView.Title=HTML-Komponente bearbeiten -EditHTMLView.Ok=Ok -EditHTMLView.Cancel=Abbrechen -EditHTMLView.HtmlPlaceHolder=HTML hier einfügen... \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_es.properties deleted file mode 100644 index a8ce74acc9b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_es.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -EditHTMLView.Title=Editar componente HTML -EditHTMLView.Ok=Aceptar -EditHTMLView.Cancel=Cancelar -EditHTMLView.HtmlPlaceHolder=Agregue su HTML aquí… \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_fr.properties deleted file mode 100644 index b08b5348c54..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_fr.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -EditHTMLView.Title=Modifier le composant HTML -EditHTMLView.Ok=OK -EditHTMLView.Cancel=Annuler -EditHTMLView.HtmlPlaceHolder=Ajoutez votre contenu HTML ici… \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_ja.properties deleted file mode 100644 index 534b9d460c3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/Constants_ja.properties +++ /dev/null @@ -1,20 +0,0 @@ -# -# Copyright 2016 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -EditHTMLView.Title=HTML コンポーネントの編集 -EditHTMLView.Ok=OK -EditHTMLView.Cancel=キャンセル -EditHTMLView.HtmlPlaceHolder=ここに HTML を追加してください \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.properties deleted file mode 100644 index b9f7d66f28e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants.properties +++ /dev/null @@ -1,2 +0,0 @@ -coreComponentGroupName=Core -navComponentGroupName=Navigation \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_es.properties deleted file mode 100644 index 6239b6ef5d5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_es.properties +++ /dev/null @@ -1,2 +0,0 @@ -coreComponentGroupName=Core -navComponentGroupName=Navegación \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_fr.properties deleted file mode 100644 index e5a703d7a8c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_fr.properties +++ /dev/null @@ -1,2 +0,0 @@ -coreComponentGroupName=Noyau -navComponentGroupName=Navigation \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_ja.properties deleted file mode 100644 index 4df574f79b0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/main/resources/org/uberfire/ext/plugin/client/resources/i18n/PerspectiveEditorPaletteConstants_ja.properties +++ /dev/null @@ -1,2 +0,0 @@ -coreComponentGroupName=コア -navComponentGroupName=ナビゲーション \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/test/resources/org/uberfire/ext/plugin/client/perspective/editor/layout/editor/fullLayoutPage.txt b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/test/resources/org/uberfire/ext/plugin/client/perspective/editor/layout/editor/fullLayoutPage.txt deleted file mode 100644 index 96e33004896..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/test/resources/org/uberfire/ext/plugin/client/perspective/editor/layout/editor/fullLayoutPage.txt +++ /dev/null @@ -1,84 +0,0 @@ -{ - "version": 2, - "name": "A", - "style": "PAGE", - "layoutProperties": { - "LAYOUT_TAGS": "a|" - }, - "rows": [ - { - "height": "8", - "layoutColumns": [ - { - "span": "8", - "height": "12", - "rows": [], - "layoutComponents": [ - { - "dragTypeName": "org.uberfire.ext.plugin.client.perspective.editor.layout.editor.TargetDivDragComponent", - "properties": { - "ID_PARAMETER": "dora_div_id" - } - } - ] - }, - { - "span": "4", - "height": "12", - "rows": [ - { - "height": "12", - "layoutColumns": [ - { - "span": "12", - "height": "6", - "rows": [], - "layoutComponents": [ - { - "dragTypeName": "org.uberfire.ext.plugin.client.perspective.editor.layout.editor.TargetDivDragComponent", - "properties": { - "ID_PARAMETER": "bento_div_id" - } - } - ] - }, - { - "span": "12", - "height": "6", - "rows": [], - "layoutComponents": [ - { - "dragTypeName": "org.uberfire.ext.plugin.client.perspective.editor.layout.editor.ScreenLayoutDragComponent", - "properties": { - "Place Name": "AnotherScreen" - } - } - ] - } - ] - } - ], - "layoutComponents": [] - } - ] - }, - { - "height": "4", - "layoutColumns": [ - { - "span": "12", - "height": "12", - "rows": [], - "layoutComponents": [ - { - "dragTypeName": "org.uberfire.ext.plugin.client.perspective.editor.layout.editor.TargetDivDragComponent", - "properties": { - "ID_PARAMETER": "another_div_id" - } - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/pom.xml deleted file mode 100644 index 976b565743d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-extensions - ${revision} - ../pom.xml - - - uberfire-widgets - pom - - Uberfire Widgets - - - uberfire-widgets-commons - uberfire-widgets-core - uberfire-widgets-table - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/pom.xml deleted file mode 100644 index 2ac078d0b93..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/pom.xml +++ /dev/null @@ -1,161 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-widgets - ${revision} - - - uberfire-widgets-commons - jar - - Uberfire Widgets Commons - Uberfire Widgets Commons - - - - - org.uberfire - uberfire-api - - - - org.uberfire - uberfire-client-api - - - - org.uberfire - uberfire-commons - - - - org.kie.soup - kie-soup-commons - - - - org.uberfire - uberfire-workbench-client - - - - org.uberfire - uberfire-widgets-table - - - - org.gwtbootstrap3 - gwtbootstrap3 - - - - org.gwtbootstrap3 - gwtbootstrap3-extras - - - - com.google.guava - guava - - - - com.google.elemental2 - elemental2-dom - - - - org.jboss.errai - errai-ui - - - - org.uberfire - uberfire-workbench-client-views-patternfly - - - - - org.jboss.errai - errai-ioc - - - - - org.jboss.errai - errai-bus - - - org.jboss.errai - errai-common - - - jakarta.inject - jakarta.inject-api - provided - - - - - com.google.gwt - gwt-user - provided - - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - commons-logging - commons-logging - - - - - - org.uberfire - uberfire-testing-utils - test - - - - - - - - - - src/main/java - - - - src/main/resources - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/CommonsEntryPoint.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/CommonsEntryPoint.java deleted file mode 100644 index f31abe1236a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/CommonsEntryPoint.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.uberfire.client.views.pfly.sys.PatternFlyBootstrapper; -import org.uberfire.ext.widgets.common.client.resources.CommonResources; - -/** - * Bootstrap widgets-commons - */ -@EntryPoint -public class CommonsEntryPoint { - - @PostConstruct - public void startApp() { - //Ensure CSS has been loaded - CommonResources.INSTANCE.CSS().ensureInjected(); - PatternFlyBootstrapper.ensurejQueryIsAvailable(); - PatternFlyBootstrapper.ensureBootstrapSelectIsAvailable(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeInAnimation.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeInAnimation.java deleted file mode 100644 index 11f95c5f961..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeInAnimation.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.animations; - -import com.google.gwt.user.client.ui.Widget; - -/** - * A linear animation to fade a Widget from 0.0 to 1.0 opacity - */ -public class LinearFadeInAnimation extends SequencedAnimation { - - private Widget widget; - - public LinearFadeInAnimation(final Widget widget) { - this.widget = widget; - } - - @Override - public void onUpdate(double progress) { - this.widget.getElement().getStyle().setOpacity(progress); - } - - @Override - public double interpolate(double progress) { - return progress; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeOutAnimation.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeOutAnimation.java deleted file mode 100644 index 1f622564aec..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/LinearFadeOutAnimation.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.animations; - -import com.google.gwt.user.client.ui.Widget; - -/** - * A linear animation to fade a Widget from 1.0 to 0.0 opacity - */ -public class LinearFadeOutAnimation extends SequencedAnimation { - - private Widget widget; - - public LinearFadeOutAnimation(final Widget widget) { - this.widget = widget; - } - - @Override - public void onUpdate(double progress) { - this.widget.getElement().getStyle().setOpacity(1.0 - progress); - } - - @Override - public double interpolate(double progress) { - return progress; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Pause.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Pause.java deleted file mode 100644 index 4eb09368bf9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Pause.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.animations; - -/** - * A pause (in between animations). Does nothing. - */ -public class Pause extends SequencedAnimation { - - @Override - public void onUpdate(double progress) { - //Do nothing. This animation simply acts as a delay - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/SequencedAnimation.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/SequencedAnimation.java deleted file mode 100644 index d602ec0c34c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/SequencedAnimation.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.animations; - -import com.google.gwt.animation.client.Animation; - -/** - * An animation that can be sequenced to run in a list of animations. In reality - * we only GWT's Animation's protected methods to be public so we can chain the - * completion of one Animation to another. - */ -public abstract class SequencedAnimation extends Animation { - - @Override - public double interpolate(double progress) { - return super.interpolate(progress); - } - - @Override - public void onCancel() { - super.onCancel(); - } - - @Override - public void onStart() { - super.onStart(); - } - - @Override - public void onComplete() { - super.onComplete(); - } - - @Override - public abstract void onUpdate(double progress); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Sequencer.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Sequencer.java deleted file mode 100644 index f97af05ca3c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/animations/Sequencer.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.animations; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gwt.animation.client.Animation; - -/** - * Run a list of animations in order. - */ -public class Sequencer { - - private int currentAnimationIndex = 0; - //The list of animations - private List animations = new ArrayList(); - - /** - * Add an animation to the list of animations to be sequenced. - * @param animation - * @param duration - */ - public void add(final SequencedAnimation animation, - final int duration) { - animations.add(new AnimationConfiguration(new WrappedAnimation(animation), - duration)); - } - - /** - * Run all animations. - */ - public void run() { - runNextAnimation(); - } - - /** - * Reset the sequence to the begining. - */ - public void reset() { - currentAnimationIndex = 0; - } - - private void runNextAnimation() { - if (currentAnimationIndex < animations.size()) { - final AnimationConfiguration config = animations.get(currentAnimationIndex++); - final WrappedAnimation animation = config.animation; - final int duration = config.duration; - animation.run(duration); - } else { - reset(); - } - } - - //Simple holder for sequenced animation details - private class AnimationConfiguration { - - final WrappedAnimation animation; - - final int duration; - - AnimationConfiguration(final WrappedAnimation animation, - final int duration) { - this.animation = animation; - this.duration = duration; - } - } - - //A wrapper for sequenced animations allowing us to hook into the onComplete method to launch the next animation - private class WrappedAnimation extends Animation { - - private final SequencedAnimation animation; - - WrappedAnimation(final SequencedAnimation animation) { - this.animation = animation; - } - - @Override - public void onComplete() { - //Pass through to the wrapped animation - animation.onComplete(); - runNextAnimation(); - } - - @Override - protected void onUpdate(double progress) { - //Pass through to the wrapped animation - animation.onUpdate(progress); - } - - @Override - public void cancel() { - //Pass through to the wrapped animation - animation.cancel(); - } - - @Override - protected double interpolate(double progress) { - //Pass through to the wrapped animation - return animation.interpolate(progress); - } - - @Override - protected void onCancel() { - //Pass through to the wrapped animation - animation.onCancel(); - } - - @Override - protected void onStart() { - //Pass through to the wrapped animation - animation.onStart(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.java deleted file mode 100644 index 1120884e543..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.ModalBody; -import org.uberfire.ext.widgets.common.client.common.popups.BaseModal; -import org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterForceSaveReOpenCancelButtons; -import org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterReOpenIgnoreButtons; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; -import org.uberfire.mvp.Command; - -public abstract class AbstractConcurrentChangePopup extends BaseModal { - - @UiField - protected HTML message; - private AbstractConcurrentChangePopupWidgetBinder uiBinder = GWT.create(AbstractConcurrentChangePopupWidgetBinder.class); - - protected AbstractConcurrentChangePopup(final String content, - final Command onIgnore, - final Command onAction, - final String buttonText) { - setTitle(CommonConstants.INSTANCE.Error()); - - add(new ModalBody() {{ - add(uiBinder.createAndBindUi(AbstractConcurrentChangePopup.this)); - }}); - add(new ModalFooterReOpenIgnoreButtons(this, - onAction, - onIgnore, - buttonText)); - - message.setHTML(SafeHtmlUtils.fromTrustedString(content)); - } - - protected AbstractConcurrentChangePopup(final String content, - final Command onIgnore, - final Command onReOpen) { - this(content, - onIgnore, - onReOpen, - CommonConstants.INSTANCE.ReOpen()); - } - - protected AbstractConcurrentChangePopup(final String content, - final Command onForceSave, - final Command onIgnore, - final Command onReOpen) { - setTitle(CommonConstants.INSTANCE.Error()); - - add(new ModalBody() {{ - add(uiBinder.createAndBindUi(AbstractConcurrentChangePopup.this)); - }}); - add(new ModalFooterForceSaveReOpenCancelButtons(this, - onForceSave, - onReOpen, - onIgnore)); - - message.setHTML(SafeHtmlUtils.fromTrustedString(content)); - } - - interface AbstractConcurrentChangePopupWidgetBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.ui.xml deleted file mode 100644 index 0dc7d7ed88c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractConcurrentChangePopup.ui.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractLazyStackPanelHeader.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractLazyStackPanelHeader.java deleted file mode 100644 index ce7eb2892f9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractLazyStackPanelHeader.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.logical.shared.HasCloseHandlers; -import com.google.gwt.event.logical.shared.HasOpenHandlers; -import com.google.gwt.event.logical.shared.OpenEvent; -import com.google.gwt.event.logical.shared.OpenHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.SimplePanel; - -public abstract class AbstractLazyStackPanelHeader extends SimplePanel - implements - HasCloseHandlers, - HasOpenHandlers { - - protected boolean expanded = false; - - public HandlerRegistration addOpenHandler(OpenHandler handler) { - return addHandler(handler, - OpenEvent.getType()); - } - - public HandlerRegistration addCloseHandler(CloseHandler handler) { - return addHandler(handler, - CloseEvent.getType()); - } - - public abstract void expand(); - - public abstract void collapse(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractRestrictedEntryTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractRestrictedEntryTextBox.java deleted file mode 100644 index 09ddfc405e3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/AbstractRestrictedEntryTextBox.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.event.dom.client.BlurEvent; -import com.google.gwt.event.dom.client.BlurHandler; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.event.dom.client.KeyPressEvent; -import com.google.gwt.event.dom.client.KeyPressHandler; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import org.gwtbootstrap3.client.ui.TextBox; - -/** - * A TextBox to handle restricted entry - */ -public abstract class AbstractRestrictedEntryTextBox extends TextBox { - - protected final boolean allowEmptyValue; - - public AbstractRestrictedEntryTextBox() { - this(false); - } - - public AbstractRestrictedEntryTextBox(final boolean allowEmptyValue) { - this.allowEmptyValue = allowEmptyValue; - setup(); - } - - protected void setup() { - final TextBox me = this; - - //Validate value as it is entered - this.addKeyPressHandler(new KeyPressHandler() { - - public void onKeyPress(KeyPressEvent event) { - - // Permit navigation - int keyCode = event.getNativeEvent().getKeyCode(); - if (event.isControlKeyDown() - || keyCode == KeyCodes.KEY_BACKSPACE - || keyCode == KeyCodes.KEY_DELETE - || keyCode == KeyCodes.KEY_LEFT - || keyCode == KeyCodes.KEY_RIGHT - || keyCode == KeyCodes.KEY_TAB - || keyCode == KeyCodes.KEY_HOME - || keyCode == KeyCodes.KEY_END - ) { - return; - } - - // Get new value and validate - int charCode = event.getCharCode(); - String oldValue = me.getValue(); - String newValue = oldValue.substring(0, - me.getCursorPos()); - newValue = newValue - + ((char) charCode); - newValue = newValue - + oldValue.substring(me.getCursorPos() + me.getSelectionLength()); - if (!isValidValue(newValue, - false)) { - event.preventDefault(); - } - } - }); - - //Add validation when looses focus (for when values are pasted in by users') - this.addBlurHandler(new BlurHandler() { - - @Override - public void onBlur(BlurEvent event) { - final String value = me.getText(); - if (!isValidValue(value, - true)) { - final String validValue = makeValidValue(value); - me.setText(validValue); - ValueChangeEvent.fire(AbstractRestrictedEntryTextBox.this, - validValue); - } - } - }); - } - - @Override - public void setText(final String text) { - if (!isValidValue(text, - false)) { - final String validValue = makeValidValue(text); - super.setText(validValue); - ValueChangeEvent.fire(AbstractRestrictedEntryTextBox.this, - validValue); - } else { - super.setText(text); - } - } - - @Override - public void setValue(final String value) { - if (!isValidValue(value, - false)) { - final String validValue = makeValidValue(value); - super.setValue(validValue); - ValueChangeEvent.fire(AbstractRestrictedEntryTextBox.this, - validValue); - } else { - super.setValue(value); - } - } - - @Override - public void setValue(final String value, - final boolean fireEvents) { - if (!isValidValue(value, - false)) { - final String validValue = makeValidValue(value); - super.setValue(validValue, - fireEvents); - ValueChangeEvent.fire(AbstractRestrictedEntryTextBox.this, - validValue); - } else { - super.setValue(value, - fireEvents); - } - } - - /** - * Validate value of TextBox - * @param value - * @param isOnFocusLost Focus has been lost from the TextBox - * @return True if valid - */ - public abstract boolean isValidValue(final String value, - final boolean isOnFocusLost); - - /** - * If validation fails (e.g. as a result of a user pasting a value) when the - * TextBox looses focus this method is called to transform the current value - * into one which is valid. This default implementation returns an empty - * String, however numerical TextBoxes could check the value is numerical - * and scale to that suitable for the type. - * @param value Current value - * @return A valid value - */ - protected String makeValidValue(String value) { - return ""; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyIndicatorView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyIndicatorView.java deleted file mode 100644 index 98d2c2cf3c1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyIndicatorView.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; - -@Dependent -public class BusyIndicatorView implements HasBusyIndicator { - - @Override - public void showBusyIndicator(final String message) { - BusyPopup.showMessage(message); - } - - /** - * This method is invoked by the container when this bean is destroyed, - * so that loading popups are guaranteed to close when an enclosing - * bean is destroyed. - */ - @Override - @PreDestroy - public void hideBusyIndicator() { - BusyPopup.close(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.java deleted file mode 100644 index 2b7f1424794..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.Timer; -import com.google.gwt.user.client.ui.DecoratedPopupPanel; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.html.Span; -import org.uberfire.ext.widgets.common.client.animations.LinearFadeInAnimation; -import org.uberfire.ext.widgets.common.client.animations.LinearFadeOutAnimation; - -/** - * A simple pop-up to show messages while "long running" activities take place - */ -public class BusyPopup extends DecoratedPopupPanel { - - private static LoadingViewBinder uiBinder = GWT.create(LoadingViewBinder.class); - private static final BusyPopup INSTANCE = new BusyPopup(); - - private static Timer deferredShowTimer = new Timer() { - @Override - public void run() { - fadeInAnimation.run(250); - } - }; - - private static MessageState state = MessageState.DORMANT; - private static final LinearFadeInAnimation fadeInAnimation = new LinearFadeInAnimation(INSTANCE) { - - @Override - public void onStart() { - state = MessageState.SHOWING; - INSTANCE.center(); - super.onStart(); - } - - @Override - public void onComplete() { - state = MessageState.VISIBLE; - super.onComplete(); - } - }; - private static final LinearFadeOutAnimation fadeOutAnimation = new LinearFadeOutAnimation(INSTANCE) { - - @Override - public void onStart() { - state = MessageState.HIDING; - super.onStart(); - } - - @Override - public void onComplete() { - state = MessageState.DORMANT; - INSTANCE.hide(); - super.onComplete(); - } - }; - @UiField - Span message; - - private BusyPopup() { - setWidget(uiBinder.createAndBindUi(this)); - - //Make sure it appears on top of other popups - getElement().getStyle().setZIndex(Integer.MAX_VALUE); - setGlassEnabled(true); - } - - public static void showMessage(final String message) { - switch (state) { - case DORMANT: - INSTANCE.message.setText(message); - deferredShowTimer.schedule(250); - state = MessageState.PENDING; - break; - case PENDING: - case SHOWING: - case VISIBLE: - INSTANCE.message.setText(message); - break; - case HIDING: - fadeOutAnimation.cancel(); - INSTANCE.message.setText(message); - fadeInAnimation.onComplete(); - } - } - - public static void close() { - switch (state) { - case DORMANT: - break; - case PENDING: - deferredShowTimer.cancel(); - state = MessageState.DORMANT; - break; - case SHOWING: - fadeInAnimation.cancel(); - fadeOutAnimation.run(250); - break; - case VISIBLE: - fadeOutAnimation.run(250); - break; - case HIDING: - break; - } - } - - private enum MessageState { - DORMANT, - PENDING, - SHOWING, - VISIBLE, - HIDING - } - - interface LoadingViewBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.ui.xml deleted file mode 100644 index 080166c56b1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/BusyPopup.ui.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ClickableLabel.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ClickableLabel.java deleted file mode 100644 index b0221a1e76a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ClickableLabel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.client.ui.HTML; - -public class ClickableLabel extends HTML { - - public ClickableLabel(String text, - ClickHandler event, - boolean enabled) { - super(doText(text, - enabled)); - if (enabled) { - this.addClickHandler(event); - } - } - - public ClickableLabel(String text, - ClickHandler event) { - this(text, - event, - true); - } - - private static String doText(String text, - boolean enabled) { - if (enabled) { - return "

        " + text + "
        "; - } else { - return "
        " + text + "
        "; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePicker.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePicker.java deleted file mode 100644 index b693835c99c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePicker.java +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.util.Date; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Element; -import com.google.gwt.editor.client.IsEditor; -import com.google.gwt.editor.client.LeafValueEditor; -import com.google.gwt.event.dom.client.BlurHandler; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import com.google.gwt.event.logical.shared.ValueChangeHandler; -import com.google.gwt.i18n.client.DateTimeFormat; -import com.google.gwt.i18n.client.LocaleInfo; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Focusable; -import com.google.gwt.user.client.ui.HasEnabled; -import com.google.gwt.user.client.ui.HasName; -import com.google.gwt.user.client.ui.HasValue; -import com.google.gwt.user.client.ui.HasVisibility; -import com.google.gwt.user.client.ui.RootPanel; -import com.google.gwt.user.client.ui.Widget; -import com.google.web.bindery.event.shared.HandlerRegistration; -import org.gwtbootstrap3.client.shared.event.HideEvent; -import org.gwtbootstrap3.client.shared.event.HideHandler; -import org.gwtbootstrap3.client.shared.event.ShowHandler; -import org.gwtbootstrap3.client.ui.base.HasId; -import org.gwtbootstrap3.client.ui.base.HasPlaceholder; -import org.gwtbootstrap3.client.ui.base.HasResponsiveness; -import org.gwtbootstrap3.client.ui.constants.DeviceSize; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.DatePickerDayOfWeek; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.DatePickerLanguage; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.DatePickerMinView; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.DatePickerPosition; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasAutoClose; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasDateTimePickerHandlers; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasDaysOfWeekDisabled; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasEndDate; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasForceParse; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasHighlightToday; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasKeyboardNavigation; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasLanguage; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasMinView; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasPosition; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasShowTodayButton; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasStartDate; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasStartView; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasViewSelect; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasWeekStart; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.events.ChangeDateHandler; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.events.ChangeMonthHandler; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.events.ChangeYearHandler; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.events.ClearDateHandler; - -/** - * A DatePicker wrapping BS3's DatePicker component adding additional functionality - * required by KIE Workbench.; such as prevention of empty values and support for - * setting the date format with GWT's DateTimeFormat patterns. - */ -public class DatePicker extends Composite - implements HasEnabled, - Focusable, - HasId, - HasResponsiveness, - HasVisibility, - HasPlaceholder, - HasAutoClose, - HasDaysOfWeekDisabled, - HasEndDate, - HasForceParse, - HasHighlightToday, - HasKeyboardNavigation, - HasMinView, - HasShowTodayButton, - HasStartDate, - HasStartView, - HasViewSelect, - HasWeekStart, - HasDateTimePickerHandlers, - HasLanguage, - HasName, - HasValue, - HasPosition, - IsEditor> { - - private final boolean allowEmptyValues; - private final org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker datePicker; - //Default GWT date format - private String gwtDateFormat = "dd-MMM-yyyy"; - private DateTimeFormat gwtDateTimeFormat = DateTimeFormat.getFormat(gwtDateFormat); - private String localeName; - - public DatePicker() { - this(true); - } - - /** - * Basic constuctor of uberfire datePicker without setting the datepicker container and without setting the hide - * handler to manage the interaction with org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker popup - * @param datePicker - */ - public DatePicker(org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker datePicker) { - this.datePicker = datePicker; - this.allowEmptyValues = true; - } - - public DatePicker(final boolean allowEmptyValues) { - datePicker = GWT.create(org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker.class); - this.allowEmptyValues = allowEmptyValues; - datePicker.setContainer(RootPanel.get()); - - datePicker.setAutoClose(true); - setLocaleName(); - setFormat(gwtDateFormat); - - //When the popup Date Picker component is hidden assert empty values - datePicker.addHideHandler(new HideHandler() { - @Override - public void onHide(HideEvent hideEvent) { - final Date value = getDataPickerDate(); - if (!allowEmptyValues && value == null) { - doSetValue(new Date(), - true); - } else { - doSetValue(value, - true); - } - } - }); - - initWidget(datePicker); - } - - protected Date getDataPickerDate() { - DateTimeFormat dtf = DateTimeFormat.getFormat("dd/M/yyyy"); - String dateStr = parseDate(datePicker.getTextBox().getElement(), - DatePickerFormatUtilities.convertToBS3DateFormat("dd/M/yyyy")); - if(dateStr == null || dateStr.isEmpty()){ - return null; - } else { - return dtf.parse(dateStr); - } - } - - public void setContainer(final Widget container) { - datePicker.setContainer(container); - } - - @Override - public void setAutoClose(final boolean autoClose) { - datePicker.setAutoClose(autoClose); - } - - @Override - public void onShow(final Event e) { - datePicker.onShow(e); - } - - @Override - public HandlerRegistration addShowHandler(final ShowHandler showHandler) { - return datePicker.addShowHandler(showHandler); - } - - @Override - public void onHide(final Event e) { - datePicker.onHide(e); - } - - @Override - public HandlerRegistration addHideHandler(final HideHandler hideHandler) { - return datePicker.addHideHandler(hideHandler); - } - - @Override - public void onChangeDate(final Event e) { - datePicker.onChangeDate(e); - } - - @Override - public HandlerRegistration addChangeDateHandler(final ChangeDateHandler changeDateHandler) { - return datePicker.addChangeDateHandler(changeDateHandler); - } - - @Override - public void onChangeYear(final Event e) { - datePicker.onChangeYear(e); - } - - @Override - public HandlerRegistration addChangeYearHandler(final ChangeYearHandler changeYearHandler) { - return datePicker.addChangeYearHandler(changeYearHandler); - } - - @Override - public void onChangeMonth(final Event e) { - datePicker.onChangeMonth(e); - } - - @Override - public HandlerRegistration addChangeMonthHandler(final ChangeMonthHandler changeMonthHandler) { - return datePicker.addChangeMonthHandler(changeMonthHandler); - } - - @Override - public void onClearDate(final Event e) { - datePicker.onClearDate(e); - } - - @Override - public HandlerRegistration addClearDateHandler(final ClearDateHandler outOfRangeHandler) { - return datePicker.addClearDateHandler(outOfRangeHandler); - } - - @Override - public void setDaysOfWeekDisabled(final DatePickerDayOfWeek... daysOfWeekDisabled) { - datePicker.setDaysOfWeekDisabled(daysOfWeekDisabled); - } - - @Override - public boolean isEnabled() { - return datePicker.isEnabled(); - } - - @Override - public void setEnabled(final boolean enabled) { - datePicker.setEnabled(enabled); - } - - @Override - public void setEndDate(final Date endDate) { - datePicker.setEndDate(endDate); - } - - @Override - public void setEndDate(final String endDate) { - datePicker.setEndDate(endDate); - } - - @Override - public void clearEndDate() { - datePicker.clearEndDate(); - } - - @Override - public void setForceParse(final boolean forceParse) { - datePicker.setForceParse(forceParse); - } - - /** - * Set the format of the Date shown in the TextBox component. - * This is converted to BS3's Date Format that the underlying jQuery-based BS3 DatePicker - * uses to convert values in the TextBox to selections in the popup date picker element. - * @param gwtDateFormat - */ - public void setFormat(final String gwtDateFormat) { - this.gwtDateFormat = gwtDateFormat; - this.gwtDateTimeFormat = DateTimeFormat.getFormat(this.gwtDateFormat); - if (getLocaleName().equals("")) { - datePicker.setLanguage(DatePickerLanguage.EN); - } else { - datePicker.setLanguage(DatePickerLanguage.valueOf(getLocaleName().toUpperCase())); - } - datePicker.setFormat(DatePickerFormatUtilities.convertToBS3DateFormat(gwtDateFormat)); - } - - public String getLocaleName() { - if (localeName != null && !localeName.isEmpty() && !localeName.equalsIgnoreCase("default")) { - return localeName; - } - return ""; - } - - public void setLocaleName(String localeName) { - if (localeName != null) { - this.localeName = localeName; - } else { - this.localeName = ""; - } - } - - public void setLocaleName() { - localeName = LocaleInfo.getCurrentLocale().getLocaleName(); - } - - @Override - public void setHighlightToday(final boolean highlightToday) { - datePicker.setHighlightToday(highlightToday); - } - - @Override - public String getId() { - return datePicker.getId(); - } - - @Override - public void setId(final String id) { - datePicker.setId(id); - } - - @Override - public void setHasKeyboardNavigation(final boolean hasKeyboardNavigation) { - datePicker.setHasKeyboardNavigation(hasKeyboardNavigation); - } - - @Override - public DatePickerLanguage getLanguage() { - return datePicker.getLanguage(); - } - - @Override - public void setLanguage(final DatePickerLanguage language) { - datePicker.setLanguage(language); - } - - @Override - public void setMinView(final DatePickerMinView datePickerMinView) { - datePicker.setMinView(datePickerMinView); - } - - @Override - public String getName() { - return datePicker.getName(); - } - - @Override - public void setName(final String name) { - datePicker.setName(name); - } - - @Override - public String getPlaceholder() { - return datePicker.getPlaceholder(); - } - - @Override - public void setPlaceholder(final String placeholder) { - datePicker.setPlaceholder(placeholder); - } - - @Override - public DatePickerPosition getPosition() { - return datePicker.getPosition(); - } - - @Override - public void setPosition(final DatePickerPosition position) { - datePicker.setPosition(position); - } - - @Override - public void setVisibleOn(final DeviceSize deviceSize) { - datePicker.setVisibleOn(deviceSize); - } - - @Override - public void setHiddenOn(final DeviceSize deviceSize) { - datePicker.setHiddenOn(deviceSize); - } - - @Override - public void setShowTodayButton(final boolean showTodayButton) { - datePicker.setShowTodayButton(showTodayButton); - } - - @Override - public void setStartDate(final Date startDate) { - datePicker.setStartDate(startDate); - } - - @Override - public void setStartDate(final String startDate) { - datePicker.setStartDate(startDate); - } - - @Override - public void clearStartDate() { - datePicker.clearStartDate(); - } - - @Override - public void setStartView(final DatePickerMinView datePickerMinView) { - datePicker.setStartView(datePickerMinView); - } - - @Override - //We don't delegate this to the wrapped DatePicker as that has some issues with the mismatch between GWT's DateFormat and BS3's DateFormat - public Date getValue() { - try { - return gwtDateTimeFormat != null && datePicker.getTextBox().getValue() != null ? gwtDateTimeFormat.parse(datePicker.getTextBox().getValue()) : null; - } catch (final Exception e) { - return null; - } - } - - @Override - //We don't delegate this to the wrapped DatePicker as that has some issues with the mismatch between GWT's DateFormat and BS3's DateFormat - public void setValue(final Date value) { - if (!allowEmptyValues && value == null) { - doSetValue(new Date(), - true); - } else { - doSetValue(value, - false); - } - } - - @Override - //We don't delegate this to the wrapped DatePicker as that has some issues with the mismatch between GWT's DateFormat and BS3's DateFormat - public void setValue(final Date value, - final boolean fireEvents) { - if (!allowEmptyValues && value == null) { - doSetValue(new Date(), - true); - } else { - doSetValue(value, - fireEvents); - } - } - - //This is essentially an override of the wrapped DatePicker's setValue() method however - //we need to override it to use the "improved" GWT DateFormat<->BS3's DateFormat handling. - private void doSetValue(final Date value, - final boolean fireEvents) { - datePicker.getTextBox().setValue(value != null ? gwtDateTimeFormat.format(value) : null); - update(datePicker.getTextBox().getElement()); - - if (fireEvents) { - ValueChangeEvent.fire(datePicker, - value); - } - } - - //Unfortunately the wrapped DatePicker hides the "update" method so we have to repeat it here - private native void update(Element e) /*-{ - $wnd.jQuery(e).datepicker('update'); - }-*/; - - private final native String parseDate(Element e, - String format) /*-{ - var dateStr = $wnd.jQuery(e).datepicker('getFormattedDate', format); - return dateStr - }-*/; - - @Override - public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(final ValueChangeHandler handler) { - return datePicker.addValueChangeHandler(handler); - } - - @Override - public void setViewSelect(final DatePickerMinView datePickerMinView) { - datePicker.setViewSelect(datePickerMinView); - } - - @Override - public void setWeekStart(final DatePickerDayOfWeek weekStart) { - datePicker.setWeekStart(weekStart); - } - - @Override - public LeafValueEditor asEditor() { - return datePicker; - } - - @Override - public int getTabIndex() { - return datePicker.getTextBox().getTabIndex(); - } - - @Override - public void setTabIndex(final int index) { - datePicker.getTextBox().setTabIndex(index); - } - - @Override - public void setAccessKey(final char key) { - datePicker.getTextBox().setAccessKey(key); - } - - @Override - public void setFocus(final boolean focused) { - datePicker.getTextBox().setFocus(focused); - } - - public HandlerRegistration addBlurHandler(final BlurHandler handler) { - return datePicker.getTextBox().addBlurHandler(handler); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePickerFormatUtilities.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePickerFormatUtilities.java deleted file mode 100644 index e500a5e5a6c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DatePickerFormatUtilities.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gwt.i18n.client.DateTimeFormat; - -/** - * Utilties to handle conversion between GWT's DateFormat to BS3's DateFormat - */ -public class DatePickerFormatUtilities { - - private static final String DEFAULT = "dd-M-yyyy"; - private static List mappings = new ArrayList() {{ - add(new Mapping("yyyy", - "yyyy")); - add(new Mapping("yy", - "yy")); - add(new Mapping("MMMM", - "MM")); - add(new Mapping("MMM", - "M")); - add(new Mapping("MM", - "mm")); - add(new Mapping("M", - "m")); - add(new Mapping("dd", - "dd")); - add(new Mapping("d", - "d")); - add(new Mapping("HH", - "hh")); - add(new Mapping("H", - "h")); - add(new Mapping("hh", - "HH")); - add(new Mapping("h", - "H")); - add(new Mapping("mm", - "ii")); - add(new Mapping("m", - "i")); - add(new Mapping("ss", - "ss")); - add(new Mapping("s", - "s")); - add(new Mapping("G", - null)); - add(new Mapping("L", - null)); - add(new Mapping("S", - null)); - add(new Mapping("E", - null)); - add(new Mapping("c", - null)); - add(new Mapping("a", - "p")); - add(new Mapping("k", - null)); - add(new Mapping("K", - null)); - add(new Mapping("z", - null)); - add(new Mapping("Z", - null)); - add(new Mapping("v", - null)); - }}; - - /** - * BS3's DateFormat constants: - * @see org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.HasFormat - *

        - * The date format, combination of p, P, h, hh, i, ii, s, ss, d, dd, m, mm, M, MM, yy, yyyy. - * p meridian in lower case ('am' or 'pm') - according to locale file - * P meridian in upper case ('AM' or 'PM') - according to locale file - * s seconds without leading zeros - * ss seconds, 2 digits with leading zeros - * i minutes without leading zeros - * ii minutes, 2 digits with leading zeros - * h hour without leading zeros - 24-hour format - * hh hour, 2 digits with leading zeros - 24-hour format - * H hour without leading zeros - 12-hour format - * HH hour, 2 digits with leading zeros - 12-hour format - * d day of the month without leading zeros - * dd day of the month, 2 digits with leading zeros - * m numeric representation of month without leading zeros - * mm numeric representation of the month, 2 digits with leading zeros - * M short textual representation of a month, three letters - * MM full textual representation of a month, such as January or March - * yy two digit representation of a year - * yyyy full numeric representation of a year, 4 digits - *

        - * GWT's DateFormat constants: - * @see com.google.gwt.i18n.client.DateTimeFormat - *

        - * G era designator Text AD - * y year Number 1996 - * L standalone month in year Text or Number July (or) 07 - * M month in year Text or Number July (or) 07 - * d day in month Number 10 - * h hour in am/pm (1-12) Number 12 - * H hour in day (0-23) Number 0 - * m minute in hour Number 30 - * s second in minute Number 55 - * S fractional second Number 978 - * E day of week Text Tuesday - * c standalone day of week Text Tuesday - * a am/pm marker Text PM - * k hour in day (1-24) Number 24 - * K hour in am/pm (0-11) Number 0 - * z time zone Text Pacific Standard Time(see comment) - * Z time zone (RFC 822) Text -0800(See comment) - * v time zone id Text America/Los_Angeles(See comment) - * ' escape for text Delimiter 'Date=' - * '' single quote Literal 'o''clock' - **/ - public static String convertToBS3DateFormat(final String gwtDateFormat) { - if (!isValidGWTDateFormat(gwtDateFormat)) { - return DEFAULT; - } - - final StringBuilder src = new StringBuilder(gwtDateFormat); - final StringBuilder tgt = new StringBuilder(); - int idx = 0; - while (idx < gwtDateFormat.length()) { - boolean mapped = false; - for (Mapping mapping : mappings) { - if (src.indexOf(mapping.src) == 0) { - if (mapping.tgt != null) { - tgt.append(mapping.tgt); - } - src.delete(0, - mapping.src.length()); - idx = idx + mapping.src.length() - 1; - mapped = true; - break; - } - } - if (!mapped) { - tgt.append(src.charAt(0)); - src.deleteCharAt(0); - } - idx++; - } - return tgt.toString(); - } - - private static boolean isValidGWTDateFormat(final String gwtDateFormat) { - try { - DateTimeFormat.getFormat(gwtDateFormat); - } catch (IllegalArgumentException iae) { - return false; - } - return true; - } - - private static class Mapping { - - private final String src; - private final String tgt; - - Mapping(final String src, - final String tgt) { - this.src = src; - this.tgt = tgt; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DecoratedDisclosurePanel.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DecoratedDisclosurePanel.java deleted file mode 100644 index 5ee3736e5ed..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DecoratedDisclosurePanel.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.util.Iterator; - -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.logical.shared.HasCloseHandlers; -import com.google.gwt.event.logical.shared.HasOpenHandlers; -import com.google.gwt.event.logical.shared.OpenEvent; -import com.google.gwt.event.logical.shared.OpenHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.DisclosurePanel; -import com.google.gwt.user.client.ui.HasWidgets; -import com.google.gwt.user.client.ui.Widget; - -/** - * Disclosure panel with rounded corners in header. - *

        - * Using this class we don't need to set the header and event handlers for the header everywhere we use DisclosurePanels. - */ -public class DecoratedDisclosurePanel extends Composite - implements - HasWidgets, - HasOpenHandlers, - HasCloseHandlers { - - private final DisclosurePanel widget = new DisclosurePanel(); - - private LazyStackPanelHeader header; - - public DecoratedDisclosurePanel(String headerText, - ImageResource headerIcon) { - widget.setAnimationEnabled(true); - widget.setHeader(createHeader(headerText, - headerIcon)); - initWidget(widget); - } - - public DecoratedDisclosurePanel(String headerText) { - widget.setAnimationEnabled(true); - widget.setHeader(createHeader(headerText)); - initWidget(widget); - } - - private LazyStackPanelHeader createHeader(String headerText) { - header = new LazyStackPanelHeader(headerText); - setupEventHandlers(); - return header; - } - - private LazyStackPanelHeader createHeader(String headerText, - ImageResource headerIcon) { - header = new LazyStackPanelHeader(headerText, - headerIcon); - setupEventHandlers(); - return header; - } - - private void setupEventHandlers() { - widget.addOpenHandler(new OpenHandler() { - public void onOpen(OpenEvent event) { - header.expand(); - } - }); - widget.addCloseHandler(new CloseHandler() { - public void onClose(CloseEvent event) { - header.collapse(); - } - }); - } - - public void add(Widget w) { - widget.add(w); - } - - public void setContent(Widget content) { - widget.setContent(content); - } - - public HandlerRegistration addOpenHandler(OpenHandler openHandler) { - return widget.addOpenHandler(openHandler); - } - - public HandlerRegistration addCloseHandler(CloseHandler handler) { - return widget.addCloseHandler(handler); - } - - public void clear() { - widget.clear(); - } - - public Iterator iterator() { - return widget.iterator(); - } - - public boolean remove(Widget w) { - return widget.remove(w); - } - - public boolean isOpen() { - return widget.isOpen(); - } - - public void setOpen(boolean b) { - widget.setOpen(b); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableComposite.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableComposite.java deleted file mode 100644 index 65141270cc1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableComposite.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.ui.Composite; - -public abstract class DirtyableComposite extends Composite - implements - DirtyableWidget { - - protected boolean dirtyflag = false; - - public DirtyableComposite() { - } - - public static native int getHeight() /*-{ - var yScroll; - - if ($wnd.innerHeight && $wnd.scrollMaxY) { - yScroll = $wnd.innerHeight + $wnd.scrollMaxY; - } else if ($doc.body.scrollHeight > $doc.body.offsetHeight) { // all but Explorer Mac - yScroll = $doc.body.scrollHeight; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - yScroll = $doc.body.offsetHeight; - } - - var windowHeight; - if (self.innerHeight) { // all except Explorer - windowHeight = self.innerHeight; - } else if ($doc.documentElement && $doc.documentElement.clientHeight) { // Explorer 6 Strict Mode - windowHeight = $doc.documentElement.clientHeight; - } else if ($doc.body) { // other Explorers - windowHeight = $doc.body.clientHeight; - } - - // for small pages with total height less then height of the viewport - if (yScroll < windowHeight) { - pageHeight = windowHeight; - } else { - pageHeight = yScroll; - } - return pageHeight; - }-*/; - - public static native int getWidth() /*-{ - var xScroll; - - if ($wnd.innerHeight && $wnd.scrollMaxY) { - xScroll = $doc.body.scrollWidth; - } else if ($doc.body.scrollHeight > $doc.body.offsetHeight) { // all but Explorer Mac - xScroll = $doc.body.scrollWidth; - } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari - xScroll = $doc.body.offsetWidth; - } - - var windowHeight; - if (self.innerHeight) { // all except Explorer - windowWidth = self.innerWidth; - } else if ($doc.documentElement && $doc.documentElement.clientHeight) { // Explorer 6 Strict Mode - windowWidth = $doc.documentElement.clientWidth; - } else if ($doc.body) { // other Explorers - windowWidth = $doc.body.clientWidth; - } - - // for small pages with total width less then width of the viewport - if (xScroll < windowWidth) { - pageWidth = windowWidth; - } else { - pageWidth = xScroll; - } - return pageWidth; - }-*/; - - public void onBrowserEvent(Event event) { - super.onBrowserEvent(event); - } - - /* - * (non-Javadoc) - * @see org.drools.guvnor.client.common.isDirtable#isDirty() - */ - public boolean isDirty() { - return this.dirtyflag; - } - - /* - * (non-Javadoc) - * @see org.drools.guvnor.client.common.isDirtable#resetDirty() - */ - public void resetDirty() { - this.dirtyflag = false; - } - - /* - * (non-Javadoc) - * @see org.drools.guvnor.client.common.isDirtable#makeDirty() - */ - public void makeDirty() { - this.dirtyflag = true; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableWidget.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableWidget.java deleted file mode 100644 index c292898fef7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DirtyableWidget.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -public interface DirtyableWidget - extends - IDirtyable { - - public abstract boolean isDirty(); - - public abstract void resetDirty(); - - public abstract void makeDirty(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DropDownValueChanged.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DropDownValueChanged.java deleted file mode 100644 index 7a11aee0dc9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/DropDownValueChanged.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -/** - * Well this should be pretty obvious. - */ -public interface DropDownValueChanged { - - public void valueChanged(String newText, - String newValue); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/EditorWidget.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/EditorWidget.java deleted file mode 100644 index f5cf7194ba4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/EditorWidget.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.user.client.ui.IsWidget; - -public interface EditorWidget - extends - IsWidget { - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/FormStyleItem.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/FormStyleItem.ui.xml deleted file mode 100644 index e540bbbfff5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/FormStyleItem.ui.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HasBusyIndicator.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HasBusyIndicator.java deleted file mode 100644 index 55a23d5fc86..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HasBusyIndicator.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -/** - * Implementations support a "Busy" indicator - */ -public interface HasBusyIndicator { - - void showBusyIndicator(final String message); - - void hideBusyIndicator(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.java deleted file mode 100644 index 217a32daeb2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Image; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.Widget; - -public class HeaderHTML extends Composite { - - private static HeaderHTMLBinder uiBinder = GWT.create(HeaderHTMLBinder.class); - @UiField - Label textLabel; - @UiField - Image image; - - public HeaderHTML() { - initWidget(uiBinder.createAndBindUi(this)); - } - - public void setText(String text) { - textLabel.setText(text); - } - - public void setImageResource(ImageResource imageResource) { - image.setResource(imageResource); - } - - interface HeaderHTMLBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.ui.xml deleted file mode 100644 index 6693113454f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/HeaderHTML.ui.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LazyStackPanelHeader.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LazyStackPanelHeader.java deleted file mode 100644 index 63bec9d84e1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LazyStackPanelHeader.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.logical.shared.OpenEvent; -import com.google.gwt.event.logical.shared.OpenHandler; -import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.Image; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.Widget; -import org.uberfire.ext.widgets.common.client.resources.CommonImages; - -public class LazyStackPanelHeader extends AbstractLazyStackPanelHeader { - - private static LazyStackPanelHeaderBinder uiBinder = GWT.create(LazyStackPanelHeaderBinder.class); - @UiField - Image icon; - @UiField - HorizontalPanel container; - private ClickHandler expandClickHandler = new ClickHandler() { - - public void onClick(ClickEvent event) { - onTitleClicked(); - } - }; - - public LazyStackPanelHeader(final String headerText, - final ImageResource headerIcon) { - this(headerText, - new Image(headerIcon)); - } - - public LazyStackPanelHeader(final String headerText, - final Image headerIcon) { - this(); - final Image titleIcon = headerIcon; - container.add(titleIcon); - final Label titleLabel = new Label(headerText); - titleLabel.setStyleName("guvnor-cursor"); - titleLabel.addClickHandler(expandClickHandler); - container.add(titleLabel); - } - - public LazyStackPanelHeader(String headerText) { - this(); - final Label titleLabel = new Label(headerText); - titleLabel.setStyleName("guvnor-cursor"); - titleLabel.addClickHandler(expandClickHandler); - container.add(titleLabel); - } - - public LazyStackPanelHeader() { - - add(uiBinder.createAndBindUi(this)); - - icon.addClickHandler(expandClickHandler); - - setIconImage(); - - addOpenHandler(new OpenHandler() { - public void onOpen(OpenEvent event) { - expanded = true; - setIconImage(); - } - }); - - addCloseHandler(new CloseHandler() { - public void onClose(CloseEvent event) { - expanded = false; - setIconImage(); - } - }); - } - - public void expand() { - if (!expanded) { - onTitleClicked(); - } - } - - public void collapse() { - if (expanded) { - onTitleClicked(); - } - } - - private void setIconImage() { - if (expanded) { - icon.setResource(CommonImages.INSTANCE.collapse()); - } else { - icon.setResource(CommonImages.INSTANCE.expand()); - } - } - - private void onTitleClicked() { - if (expanded) { - CloseEvent.fire(this, - this); - } else { - OpenEvent.fire(this, - this); - } - } - - interface LazyStackPanelHeaderBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LoadContentCommand.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LoadContentCommand.java deleted file mode 100644 index 7e5c1168ad2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/LoadContentCommand.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.user.client.ui.Widget; - -public interface LoadContentCommand { - - Widget load(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigDecimalTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigDecimalTextBox.java deleted file mode 100644 index 44a51cbb77c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigDecimalTextBox.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.math.BigDecimal; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric BigDecimal values - */ -public class NumericBigDecimalTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?[0-9]*\\.?[0-9]*([eE][-+]?[0-9]*)?$)"); - - public NumericBigDecimalTextBox() { - super(false); - } - - public NumericBigDecimalTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - @SuppressWarnings("unused") - BigDecimal check = new BigDecimal(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0.0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigIntegerTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigIntegerTextBox.java deleted file mode 100644 index e53a596bdf8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericBigIntegerTextBox.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.math.BigInteger; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric BigInteger values - */ -public class NumericBigIntegerTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?\\d*$)"); - - public NumericBigIntegerTextBox() { - super(false); - } - - public NumericBigIntegerTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - @SuppressWarnings("unused") - BigInteger check = new BigInteger(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericByteTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericByteTextBox.java deleted file mode 100644 index 898bad02458..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericByteTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric Byte values - */ -public class NumericByteTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?\\d*$)"); - - public NumericByteTextBox() { - super(false); - } - - public NumericByteTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Byte.parseByte(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericDoubleTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericDoubleTextBox.java deleted file mode 100644 index 5d8b4b682e8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericDoubleTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric Double values - */ -public class NumericDoubleTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?[0-9]*\\.?[0-9]*$)"); - - public NumericDoubleTextBox() { - super(false); - } - - public NumericDoubleTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Double.parseDouble(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0.0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericFloatTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericFloatTextBox.java deleted file mode 100644 index 9df3e1c0bcb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericFloatTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle float values - */ -public class NumericFloatTextBox extends AbstractRestrictedEntryTextBox { - - // A valid Float - private static final RegExp VALID = RegExp.compile("(^[-]?[0-9]*\\.?[0-9]*$)"); - - public NumericFloatTextBox() { - super(false); - } - - public NumericFloatTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Float.parseFloat(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0.0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBox.java deleted file mode 100644 index 1d16cc2d700..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle integer values - */ -public class NumericIntegerTextBox extends AbstractRestrictedEntryTextBox { - - // A valid integer - private static final RegExp VALID = RegExp.compile("(^[-]?\\d*$)"); - - public NumericIntegerTextBox() { - super(false); - } - - public NumericIntegerTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(final String value, - final boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Integer.parseInt(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericLongTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericLongTextBox.java deleted file mode 100644 index 9b20cbf3950..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericLongTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric Long values - */ -public class NumericLongTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?\\d*$)"); - - public NumericLongTextBox() { - super(false); - } - - public NumericLongTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Long.parseLong(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericShortTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericShortTextBox.java deleted file mode 100644 index 3a4e70239c1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericShortTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric Short values - */ -public class NumericShortTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?\\d*$)"); - - public NumericShortTextBox() { - super(false); - } - - public NumericShortTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - Short.parseShort(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } - - @Override - protected String makeValidValue(String value) { - return "0"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericTextBox.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericTextBox.java deleted file mode 100644 index c4c9ce916b1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/NumericTextBox.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common; - -import java.math.BigDecimal; - -import com.google.gwt.regexp.shared.RegExp; - -/** - * A TextBox to handle numeric values. This is only for *LEGACY* support when - * all numerical data-types were handled as BigDecimals. Please refer to the - * sibling classes NumericXXXTextBox - */ -public class NumericTextBox extends AbstractRestrictedEntryTextBox { - - // A valid number - private static final RegExp VALID = RegExp.compile("(^[-]?[0-9]*\\.?[0-9]*([eE][-+]?[0-9]*)?$)"); - - public NumericTextBox() { - super(false); - } - - public NumericTextBox(final boolean allowEmptyValue) { - super(allowEmptyValue); - } - - @Override - public boolean isValidValue(String value, - boolean isOnFocusLost) { - boolean isValid = VALID.test(value); - if (!isValid) { - return isValid; - } - if (!isOnFocusLost && "-".equals(value)) { - return true; - } - try { - @SuppressWarnings("unused") - BigDecimal check = new BigDecimal(value); - } catch (NumberFormatException nfe) { - isValid = ("".equals(value) && allowEmptyValue); - } - return isValid; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ValueChanged.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ValueChanged.java deleted file mode 100644 index 9286c6c52f7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/ValueChanged.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -/** - * Use ValueChangeHandler instead. - */ -@Deprecated -public interface ValueChanged { - - void valueChanged(String newValue); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java deleted file mode 100644 index 594b79cf0c2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.event.dom.client.KeyDownEvent; -import com.google.gwt.event.dom.client.KeyDownHandler; -import com.google.gwt.user.client.ui.ComplexPanel; -import com.google.gwt.user.client.ui.Focusable; -import com.google.gwt.user.client.ui.HasWidgets; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.shared.event.ModalShowEvent; -import org.gwtbootstrap3.client.shared.event.ModalShowHandler; -import org.gwtbootstrap3.client.shared.event.ModalShownEvent; -import org.gwtbootstrap3.client.shared.event.ModalShownHandler; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Modal; -import org.gwtbootstrap3.client.ui.ModalBody; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.gwtbootstrap3.client.ui.base.button.CloseButton; -import org.gwtbootstrap3.client.ui.base.modal.ModalContent; -import org.gwtbootstrap3.client.ui.base.modal.ModalDialog; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.ModalBackdrop; - -/** - * Base class for modal popup implementations. Setting the following properties by default: - *

          - *
        • setBackdrop( {@link BackdropType#STATIC} );
        • - *
        • setKeyboard( true );
        • - *
        • setAnimation( true );
        • - *
        • setDynamicSafe( true );
        • - *
        • setHideOthers( false );
        • - *
        - *

        - * Furthermore this Modal provides: - *

          - *
        • Automatic focus to the first Focusable widget in the body
        • - *
        • Automatic invocation of the first Button's ClickHandler where {@link ButtonType}==PRIMARY when <enter> is - * pressed
        • - *
        - */ -public class BaseModal extends Modal { - - private ModalBody body; - - public BaseModal() { - setDataBackdrop(ModalBackdrop.STATIC); - setDataKeyboard(true); - setRemoveOnHide(true); - setHideOtherModals(false); - setShowHandler(); - setKeyPressHandler(); - getElement().setId("panel-id"); - addShowHandler(new ModalShowHandler() { - @Override - public void onShow(ModalShowEvent evt) { - Modal modal = evt.getModal(); - modal.getElement().setAttribute("maxHeight", - "100px"); - modal.getElement().setAttribute("overflowY", - "scroll"); - } - }); - } - - @Override - public void show() { - super.show(); - } - - private void setKeyPressHandler() { - this.addDomHandler(getEnterDomHandler(), - KeyDownEvent.getType()); - } - - protected KeyDownHandler getEnterDomHandler() { - return new KeyDownHandler() { - @Override - public void onKeyDown(KeyDownEvent event) { - if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { - if (handleDefaultAction()) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - }; - } - - private void setShowHandler() { - //Setting Focus in show() doesn't work so set after Modal is shown - addShownHandler(new ModalShownHandler() { - @Override - public void onShown(ModalShownEvent shownEvent) { - setFocus(BaseModal.this, - Boolean.FALSE); - } - }); - } - - //Set focus on first widget. Ideally we'd only scan the body of the Modal but this is - //not accessible from sub-classes so we ignore some Focusable elements in the Header - protected boolean setFocus(final HasWidgets container, - Boolean found) { - for (final Widget w : container) { - if (w instanceof CloseButton) { - continue; - } else if (w instanceof Focusable) { - ((Focusable) w).setFocus(true); - found = true; - } else if (w instanceof HasWidgets) { - found = setFocus(((HasWidgets) w), - found); - } - if (Boolean.TRUE.equals(found)) { - break; - } - } - return found; - } - - //When is pressed look for a PRIMARY button in the ModalFooters and click it - protected boolean handleDefaultAction() { - return handleDefaultAction(this); - } - - protected boolean handleDefaultAction(final T panel) { - for (int i = 0; i < panel.getWidgetCount(); i++) { - final Widget w = panel.getWidget(i); - if (w instanceof ModalFooter) { - return handleModalFooter((ModalFooter) w); - } else if (w instanceof ModalDialog) { - return handleDefaultAction((ModalDialog) w); - } else if (w instanceof ModalContent) { - return handleDefaultAction((ModalContent) w); - } - } - return false; - } - - private boolean handleModalFooter(final ModalFooter footer) { - for (final Widget fw : footer) { - //Many of our standard ModalFooters embed a ModalFooter within a ModalFooter - if (fw instanceof ModalFooter) { - return handleModalFooter(((ModalFooter) fw)); - } else if (fw instanceof Button) { - final Button b = (Button) fw; - if (b.getType().equals(ButtonType.PRIMARY)) { - b.fireEvent(new ClickEvent() { - }); - return true; - } - } - } - return false; - } - - public void setBody(final Widget widget) { - final ModalBody body = new ModalBody(); - body.add(widget); - this.add(body); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/FormStylePopup.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/FormStylePopup.ui.xml deleted file mode 100644 index 06667be5dd5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/FormStylePopup.ui.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.java deleted file mode 100644 index 33e8f4cd992..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common.popups; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.ScrollPanel; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.ModalBody; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterYesNoCancelButtons; -import org.uberfire.mvp.Command; - -public class YesNoCancelPopup extends BaseModal { - - @UiField - protected ScrollPanel scroll; - @UiField - protected HTML message; - private YesNoCancelPopupWidgetBinder uiBinder = GWT.create(YesNoCancelPopupWidgetBinder.class); - - protected YesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final String yesButtonText, - final ButtonType yesButtonType, - final IconType yesButtonIconType, - final Command noCommand, - final String noButtonText, - final ButtonType noButtonType, - final IconType noButtonIconType, - final Command cancelCommand, - final String cancelButtonText, - final ButtonType cancelButtonType, - final IconType cancelButtonIconType) { - - setTitle(title); - setHideOtherModals(false); - - add(new ModalBody() {{ - add(uiBinder.createAndBindUi(YesNoCancelPopup.this)); - }}); - add(new ModalFooterYesNoCancelButtons(this, - yesCommand, - yesButtonText, - yesButtonType, - yesButtonIconType, - noCommand, - noButtonText, - noButtonType, - noButtonIconType, - cancelCommand, - cancelButtonText, - cancelButtonType, - cancelButtonIconType)); - - message.setHTML(SafeHtmlUtils.fromTrustedString(content != null ? content : "")); - } - - protected YesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final Command noCommand, - final Command cancelCommand) { - this(title, - content, - yesCommand, - null, - null, - null, - noCommand, - null, - null, - null, - cancelCommand, - null, - null, - null); - } - - public static YesNoCancelPopup newYesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final String yesButtonText, - final ButtonType yesButtonType, - final IconType yesButtonIconType, - final Command noCommand, - final String noButtonText, - final ButtonType noButtonType, - final IconType noButtonIconType, - final Command cancelCommand, - final String cancelButtonText, - final ButtonType cancelButtonType, - final IconType cancelButtonIconType) { - - return new YesNoCancelPopup(title, - content, - yesCommand, - yesButtonText, - yesButtonType, - yesButtonIconType, - noCommand, - noButtonText, - noButtonType, - noButtonIconType, - cancelCommand, - cancelButtonText, - cancelButtonType, - cancelButtonIconType); - } - - public static YesNoCancelPopup newYesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final Command noCommand, - final Command cancelCommand) { - - return new YesNoCancelPopup(title, - content, - yesCommand, - null, - null, - null, - noCommand, - null, - null, - null, - cancelCommand, - null, - null, - null); - } - - public static YesNoCancelPopup newYesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final String yesButtonText, - final Command noCommand, - final String noButtonText, - final Command cancelCommand, - final String cancelButtonText) { - - return new YesNoCancelPopup(title, - content, - yesCommand, - yesButtonText, - null, - null, - noCommand, - noButtonText, - null, - null, - cancelCommand, - cancelButtonText, - null, - null); - } - - public static YesNoCancelPopup newYesNoCancelPopup(final String title, - final String content, - final Command yesCommand, - final String yesButtonText, - final ButtonType yesButtonType, - final Command noCommand, - final String noButtonText, - final ButtonType noButtonType, - final Command cancelCommand, - final String cancelButtonText, - final ButtonType cancelButtonType) { - - return new YesNoCancelPopup(title, - content, - yesCommand, - yesButtonText, - yesButtonType, - null, - noCommand, - noButtonText, - noButtonType, - null, - cancelCommand, - cancelButtonText, - cancelButtonType, - null); - } - - public void clearScrollHeight() { - this.scroll.getElement().getStyle().clearHeight(); - } - - interface YesNoCancelPopupWidgetBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.ui.xml deleted file mode 100644 index a90cc2d96a3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/YesNoCancelPopup.ui.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.java deleted file mode 100644 index 736ede2ccb5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.errors; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.shared.event.ModalHiddenEvent; -import org.gwtbootstrap3.client.shared.event.ModalHiddenHandler; -import org.gwtbootstrap3.client.shared.event.ModalShowEvent; -import org.gwtbootstrap3.client.shared.event.ModalShowHandler; -import org.uberfire.ext.widgets.common.client.common.popups.BaseModal; -import org.uberfire.ext.widgets.common.client.common.popups.footers.ModalFooterOKButton; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; - -/** - * A popup that shows an error message - */ -public class ErrorPopup extends BaseModal { - - private static ErrorPopupWidgetBinder uiBinder = GWT.create(ErrorPopupWidgetBinder.class); - private static ErrorPopup instance = new ErrorPopup(); - @UiField - protected HTML message; - - private ErrorPopup() { - setTitle(CommonConstants.INSTANCE.Error()); - - setBody(uiBinder.createAndBindUi(ErrorPopup.this)); - add(new ModalFooterOKButton(new Command() { - @Override - public void execute() { - hide(); - } - })); - } - - public static void showMessage(String message) { - instance.setMessage(message); - instance.show(); - } - - public static void showMessage(final String msg, - final Command afterShow, - final Command afterClose) { - new ErrorPopup() {{ - setMessage(msg); - addShowHandler(new ModalShowHandler() { - @Override - public void onShow(final ModalShowEvent showEvent) { - if (afterShow != null) { - afterShow.execute(); - } - } - }); - addHiddenHandler(new ModalHiddenHandler() { - @Override - public void onHidden(final ModalHiddenEvent hiddenEvent) { - if (afterClose != null) { - afterClose.execute(); - } - } - }); - }}.show(); - } - - public void setMessage(final String message) { - this.message.setHTML(SafeHtmlUtils.fromTrustedString(message)); - } - - interface ErrorPopupWidgetBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.ui.xml deleted file mode 100644 index 95858cb83f7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/errors/ErrorPopup.ui.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/GenericModalFooter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/GenericModalFooter.java deleted file mode 100644 index 87cf22b0aa8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/GenericModalFooter.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.uberfire.mvp.Command; - -/** - * A Modal Footer that can accept arbitrary buttons - */ -public class GenericModalFooter extends ModalFooter { - - public void addButton(final String caption, - final Command command, - final ButtonType buttonType) { - final Button button = new Button(caption, - new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - if (command != null) { - command.execute(); - } - } - }); - button.setType(buttonType); - this.add(button); - } - - public void addButton(final String caption, - final Command command, - final IconType iconType, - final ButtonType buttonType) { - final Button button = new Button(caption, - new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - if (command != null) { - command.execute(); - } - } - }); - button.setType(buttonType); - button.setIcon(iconType); - this.add(button); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.java deleted file mode 100644 index 095eefd05e6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Modal; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.uberfire.mvp.Command; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * A Modal Footer with OK and Cancel buttons - */ -public class ModalFooterForceSaveReOpenCancelButtons extends ModalFooter { - - private static ModalFooterForceSaveReOpenCancelButtonsBinder uiBinder = GWT.create(ModalFooterForceSaveReOpenCancelButtonsBinder.class); - - private final Command forceSaveCommand; - private final Command reopenCommand; - private final Command cancelCommand; - - private final Modal panel; - @UiField - Button forceSaveButton; - @UiField - Button reopenButton; - @UiField - Button cancelButton; - - public ModalFooterForceSaveReOpenCancelButtons(final Modal panel, - final Command forceSaveCommand, - final Command reopenCommand, - final Command cancelCommand) { - this.forceSaveCommand = checkNotNull("forceSaveCommand", - forceSaveCommand); - this.reopenCommand = checkNotNull("reopenCommand", - reopenCommand); - this.cancelCommand = checkNotNull("cancelCommand", - cancelCommand); - this.panel = checkNotNull("panel", - panel); - add(uiBinder.createAndBindUi(this)); - } - - @UiHandler("forceSaveButton") - public void onForceSaveButtonClick(final ClickEvent e) { - if (forceSaveCommand != null) { - forceSaveCommand.execute(); - } - panel.hide(); - } - - @UiHandler("reopenButton") - public void onReOpenButtonClick(final ClickEvent e) { - if (reopenCommand != null) { - reopenCommand.execute(); - } - panel.hide(); - } - - @UiHandler("cancelButton") - public void onCancelButtonClick(final ClickEvent e) { - if (cancelCommand != null) { - cancelCommand.execute(); - } - panel.hide(); - } - - interface ModalFooterForceSaveReOpenCancelButtonsBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.ui.xml deleted file mode 100644 index 00cff5a068e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterForceSaveReOpenCancelButtons.ui.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.java deleted file mode 100644 index f267bbc9177..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.kie.soup.commons.validation.PortablePreconditions; - -/** - * A Modal Footer with a single OK button - */ -public class ModalFooterOKButton extends ModalFooter { - - private static ModalFooterOKButtonBinder uiBinder = GWT.create(ModalFooterOKButtonBinder.class); - - private final Command okCommand; - @UiField - Button okButton; - - public ModalFooterOKButton(final Command okCommand) { - this.okCommand = PortablePreconditions.checkNotNull("okCommand", - okCommand); - add(uiBinder.createAndBindUi(this)); - } - - public void enableOkButton(final boolean enabled) { - okButton.setEnabled(enabled); - } - - @UiHandler("okButton") - public void onOKButtonClick(final ClickEvent e) { - okCommand.execute(); - } - - interface ModalFooterOKButtonBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.ui.xml deleted file mode 100644 index cfdd6597e65..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKButton.ui.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.java deleted file mode 100644 index 9bd055043c6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.kie.soup.commons.validation.PortablePreconditions; - -/** - * A Modal Footer with OK and Cancel buttons - */ -public class ModalFooterOKCancelButtons extends ModalFooter { - - private static ModalFooterOKCancelButtonsBinder uiBinder = GWT.create(ModalFooterOKCancelButtonsBinder.class); - - private final Command okCommand; - private final Command cancelCommand; - @UiField - Button okButton; - @UiField - Button cancelButton; - - public ModalFooterOKCancelButtons(final Command okCommand, - final Command cancelCommand) { - this.okCommand = PortablePreconditions.checkNotNull("okCommand", - okCommand); - this.cancelCommand = PortablePreconditions.checkNotNull("cancelCommand", - cancelCommand); - add(uiBinder.createAndBindUi(this)); - } - - public void enableOkButton(final boolean enabled) { - okButton.setEnabled(enabled); - } - - public void enableCancelButton(final boolean enabled) { - cancelButton.setEnabled(enabled); - } - - @UiHandler("okButton") - public void onOKButtonClick(final ClickEvent e) { - okCommand.execute(); - } - - @UiHandler("cancelButton") - public void onCancelButtonClick(final ClickEvent e) { - cancelCommand.execute(); - } - - interface ModalFooterOKCancelButtonsBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.ui.xml deleted file mode 100644 index 8c30b1bb7ad..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterOKCancelButtons.ui.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.java deleted file mode 100644 index 3a484829d28..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Modal; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.uberfire.mvp.Command; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * A Modal Footer with OK and Cancel buttons - */ -public class ModalFooterReOpenIgnoreButtons extends ModalFooter { - - private static ModalFooterReOpenIgnoreButtonsBinder uiBinder = GWT.create(ModalFooterReOpenIgnoreButtonsBinder.class); - - private final Command actionCommand; - private final Command ignoreCommand; - private final Modal panel; - @UiField - Button actionButton; - @UiField - Button ignoreButton; - - public ModalFooterReOpenIgnoreButtons(final Modal panel, - final Command actionCommand, - final Command ignoreCommand, - final String buttonText) { - this.actionCommand = checkNotNull("actionCommand", - actionCommand); - this.ignoreCommand = checkNotNull("ignoreCommand", - ignoreCommand); - this.panel = checkNotNull("panel", - panel); - add(uiBinder.createAndBindUi(this)); - this.actionButton.setText(buttonText); - } - - @UiHandler("actionButton") - public void onActionButtonClick(final ClickEvent e) { - if (actionCommand != null) { - actionCommand.execute(); - } - panel.hide(); - } - - @UiHandler("ignoreButton") - public void onIgnoreButtonClick(final ClickEvent e) { - if (ignoreCommand != null) { - ignoreCommand.execute(); - } - panel.hide(); - } - - interface ModalFooterReOpenIgnoreButtonsBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.ui.xml deleted file mode 100644 index 81e5d593d8d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterReOpenIgnoreButtons.ui.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.java deleted file mode 100644 index 9626e861839..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common.popups.footers; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Modal; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.uberfire.mvp.Command; - -public class ModalFooterYesNoCancelButtons extends ModalFooter { - - private static ModalFooterYesNoCancelButtonsBinder uiBinder = GWT.create(ModalFooterYesNoCancelButtonsBinder.class); - - private final Command yesCommand; - - private final Command cancelCommand; - - private final Command noCommand; - - private final Modal panel; - - private boolean closeModalAfterAction = true; - - @UiField - Button yesButton; - @UiField - Button noButton; - @UiField - Button cancelButton; - - public ModalFooterYesNoCancelButtons(final Modal panel, - final Command yesCommand, - final String yesButtonText, - final ButtonType yesButtonType, - final IconType yesButtonIconType, - final Command noCommand, - final String noButtonText, - final ButtonType noButtonType, - final IconType noButtonIconType, - final Command cancelCommand, - final String cancelButtonText, - final ButtonType cancelButtonType, - final IconType cancelButtonIconType) { - - this.yesCommand = yesCommand; - this.noCommand = noCommand; - this.cancelCommand = cancelCommand; - - add(uiBinder.createAndBindUi(this)); - - if (yesCommand == null) { - yesButton.setVisible(false); - } - if (noCommand == null) { - noButton.setVisible(false); - } - if (cancelCommand == null) { - cancelButton.setVisible(false); - } - - if (yesButtonType != null) { - yesButton.setType(yesButtonType); - } - if (yesButtonText != null) { - yesButton.setText(yesButtonText); - } - if (yesButtonIconType != null) { - yesButton.setIcon(yesButtonIconType); - } - - if (noButtonType != null) { - noButton.setType(noButtonType); - } - if (noButtonText != null) { - noButton.setText(noButtonText); - } - if (noButtonIconType != null) { - noButton.setIcon(noButtonIconType); - } - - if (cancelButtonType != null) { - cancelButton.setType(cancelButtonType); - } - if (cancelButtonText != null) { - cancelButton.setText(cancelButtonText); - } - if (cancelButtonIconType != null) { - cancelButton.setIcon(cancelButtonIconType); - } - - this.panel = panel; - } - - public ModalFooterYesNoCancelButtons(final Modal panel, - final Command yesCommand, - final ButtonType yesButtonType, - final Command noCommand, - final ButtonType noButtonType, - final Command cancelCommand, - final ButtonType cancelButtonType) { - this(panel, - yesCommand, - null, - yesButtonType, - null, - noCommand, - null, - noButtonType, - null, - cancelCommand, - null, - cancelButtonType, - null); - } - - public ModalFooterYesNoCancelButtons(final Modal panel, - final Command yesCommand, - final Command noCommand, - final Command cancelCommand) { - this(panel, - yesCommand, - null, - null, - null, - noCommand, - null, - null, - null, - cancelCommand, - null, - null, - null); - } - - @UiHandler("yesButton") - public void onYesButtonClick(final ClickEvent e) { - onButtonAction(yesCommand); - } - - @UiHandler("noButton") - public void onNoButtonClick(final ClickEvent e) { - onButtonAction(noCommand); - } - - @UiHandler("cancelButton") - public void onCancelButtonClick(final ClickEvent e) { - onButtonAction(cancelCommand); - } - - private void onButtonAction(Command command) { - if(command != null) { - command.execute(); - } - - if(closeModalAfterAction) { - panel.hide(); - } - } - - public void setCloseModalAfterAction(boolean closeModalAfterAction) { - this.closeModalAfterAction = closeModalAfterAction; - } - - interface ModalFooterYesNoCancelButtonsBinder - extends - UiBinder { - - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.ui.xml deleted file mode 100644 index 95dc9591ad1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/footers/ModalFooterYesNoCancelButtons.ui.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationEditor.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationEditor.java deleted file mode 100644 index d4bc9077e55..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationEditor.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.uberfire.mvp.Command; -import org.uberfire.mvp.ParameterizedCommand; - -public interface EntryCreationEditor { - - void init(ParameterizedCommand> okCommand, Command cancelCommand); - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationLiveSearchService.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationLiveSearchService.java deleted file mode 100644 index 1bb52537e20..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/EntryCreationLiveSearchService.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -public interface EntryCreationLiveSearchService> extends LiveSearchService { - - EDITOR getEditor(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/InlineCreationEditor.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/InlineCreationEditor.java deleted file mode 100644 index af3f431368a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/InlineCreationEditor.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.jboss.errai.common.client.api.IsElement; - -public interface InlineCreationEditor extends EntryCreationEditor, IsElement{ - - void clear(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchCallback.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchCallback.java deleted file mode 100644 index e12fa2ff6e3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchCallback.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -public interface LiveSearchCallback { - - void afterSearch(LiveSearchResults results); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDown.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDown.java deleted file mode 100644 index 84c8aa8227d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDown.java +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.HashMap; -import java.util.Map; - -import javax.annotation.PreDestroy; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.uberfire.client.mvp.UberView; -import org.uberfire.mvp.Command; - -@Dependent -public class LiveSearchDropDown implements IsWidget { - - private View view; - private int maxItems = 10; - private LiveSearchService searchService = null; - private boolean changeCallbackEnabled = true; - private boolean searchEnabled = true; - private boolean clearSelectionEnabled; - private boolean searchCacheEnabled = true; - private Map> searchCache = new HashMap<>(); - private LiveSearchSelectionHandler selectionHandler; - - private ManagedInstance> liveSearchSelectorItems; - private String lastSearch = null; - private String searchHint = null; - private String selectorHint = null; - private String notFoundMessage = null; - private Command onChange; - - private Command onAddItemPressed; - - @Inject - public LiveSearchDropDown(View view, - ManagedInstance> liveSearchSelectorItems) { - this.view = view; - this.liveSearchSelectorItems = liveSearchSelectorItems; - - this.view.init(this); - - searchHint = view.getDefaultSearchHintI18nMessage(); - selectorHint = view.getDefaultSelectorHintI18nMessage(); - notFoundMessage = view.getDefaultNotFoundI18nMessage(); - } - - @Override - public Widget asWidget() { - return view.asWidget(); - } - - public boolean isSearchEnabled() { - return searchEnabled; - } - - public void setSearchEnabled(boolean searchEnabled) { - this.searchEnabled = searchEnabled; - view.setSearchEnabled(searchEnabled); - } - - public void setClearSelectionEnabled(boolean clearSelectionEnabled) { - this.clearSelectionEnabled = clearSelectionEnabled; - view.setClearSelectionEnabled(clearSelectionEnabled); - } - - public void setSelectorHint(String text) { - selectorHint = text; - view.setDropDownText(text); - } - - public void setSearchHint(String text) { - searchHint = text; - view.setSearchHint(text); - } - - public void setNotFoundMessage(String noItemsMessage) { - this.notFoundMessage = noItemsMessage; - } - - public void init(LiveSearchService searchService, - LiveSearchSelectionHandler selectionHandler) { - this.searchService = searchService; - this.selectionHandler = selectionHandler; - - selectionHandler.setLiveSearchSelectionCallback(this::onItemSelected); - - view.setClearSelectionMessage(selectionHandler.isMultipleSelection()); - - if (searchService instanceof EntryCreationLiveSearchService) { - - view.setNewInstanceEnabled(true); - - EntryCreationLiveSearchService creationService = (EntryCreationLiveSearchService) searchService; - - EntryCreationEditor editor = creationService.getEditor(); - - if (creationService.getEditor() instanceof InlineCreationEditor) { - InlineCreationEditor inlineEditor = (InlineCreationEditor) editor; - inlineEditor.init(this::addNewItem, view::restoreFooter); - onAddItemPressed = () -> view.showNewItemEditor(inlineEditor); - } else if (creationService.getEditor() instanceof ModalCreationEditor) { - ModalCreationEditor modalEditor = (ModalCreationEditor) editor; - modalEditor.init(this::addNewItem, () -> {}); - onAddItemPressed = () -> modalEditor.show(); - } - } else { - view.setNewInstanceEnabled(false); - } - } - - protected void addNewItem(LiveSearchEntry entry) { - - LiveSearchSelectorItem itemInstance = liveSearchSelectorItems.get(); - - itemInstance.init(entry.getKey(), entry.getValue()); - - selectionHandler.selectItem(itemInstance); - - searchCache.clear(); - - String pattern = lastSearch; - - lastSearch = null; - - search(pattern); - - view.restoreFooter(); - } - - public boolean isSearchCacheEnabled() { - return searchCacheEnabled; - } - - public void setSearchCacheEnabled(boolean searchCacheEnabled) { - this.searchCacheEnabled = searchCacheEnabled; - } - - public int getMaxItems() { - return maxItems; - } - - public void setMaxItems(int maxItems) { - this.maxItems = maxItems; - } - - public void setWidth(int minWidth) { - view.setWidth(minWidth); - } - - public void clear() { - lastSearch = null; - view.clearSearch(); - view.clearItems(); - view.setDropDownText(selectorHint); - } - - public String getLastSearch() { - return lastSearch; - } - - public void search(String pattern) { - if (lastSearch == null || !lastSearch.equals(pattern)) { - lastSearch = pattern != null ? pattern : ""; - - if (searchCacheEnabled && searchCache.containsKey(lastSearch)) { - showResults(getFromSearchCache(lastSearch)); - } else { - doSearch(pattern); - } - } - } - - public void setSelectedItem(final TYPE key) { - searchService.searchEntry(key, - results -> { - if(results.size() == 1) { - LiveSearchEntry entry = results.get(0); - changeCallbackEnabled = false; - LiveSearchSelectorItem item = getSelectorItemForEntry(entry); - selectionHandler.selectItem(item); - item.select(); - view.clearItems(); - lastSearch = null; - changeCallbackEnabled = true; - } - }); - } - - protected void doSearch(String pattern) { - view.searchInProgress(searchHint); - searchService.search(lastSearch, - maxItems, - results -> { - addToSearchCache(pattern, - results); - showResults(results); - view.searchFinished(); - }); - } - - protected LiveSearchResults getFromSearchCache(String pattern) { - return searchCache.get(pattern); - } - - protected void addToSearchCache(String pattern, - LiveSearchResults searchResults) { - searchCache.put(pattern, - searchResults); - } - - public void showResults(LiveSearchResults results) { - view.clearItems(); - if (results.isEmpty()) { - view.noItems(notFoundMessage); - } else { - results.forEach(LiveSearchDropDown.this::getSelectorItemForEntry); - } - } - - public LiveSearchSelectorItem getSelectorItemForEntry(LiveSearchEntry entry) { - LiveSearchSelectorItem item = liveSearchSelectorItems.get(); - - item.init(entry.getKey(), - entry.getValue()); - - selectionHandler.registerItem(item); - - view.addItem(item); - - return item; - } - - void onItemsShown() { - Scheduler.get().scheduleDeferred(() -> { - search(lastSearch); - view.restoreFooter(); - }); - } - - public void setOnChange(Command onChange) { - this.onChange = onChange; - } - - public void setEnabled(boolean enabled) { - view.setEnabled(enabled); - } - - void onItemSelected() { - String message = selectionHandler.getDropDownMenuHeader(); - - if (message == null) { - message = selectorHint; - } - - view.setDropDownText(message); - - if (onChange != null & changeCallbackEnabled) { - onChange.execute(); - } - } - - public void clearSelection() { - selectionHandler.clearSelection(); - - if (onChange != null & changeCallbackEnabled) { - onChange.execute(); - } - } - - public void showNewItem() { - if (onAddItemPressed != null) { - onAddItemPressed.execute(); - } - } - - public interface View extends UberView> { - - void setNewInstanceEnabled(boolean enabled); - - void showNewItemEditor(InlineCreationEditor editor); - - void restoreFooter(); - - void clearItems(); - - void noItems(String msg); - - void addItem(LiveSearchSelectorItem item); - - void setSelectedValue(String selectedItem); - - void setSearchEnabled(boolean enabled); - - void setClearSelectionEnabled(boolean clearSelectionEnabled); - - void setSearchHint(String text); - - void clearSearch(); - - void searchInProgress(String msg); - - void searchFinished(); - - void setDropDownText(String text); - - void setWidth(int minWidth); - - void setMaxHeight(int maxHeight); - - void setNewEntryI18nMessage(String defaultNewInstanceI18nMessage); - - String getDefaultNewEntryI18nMessage(); - - String getDefaultSearchHintI18nMessage(); - - String getDefaultSelectorHintI18nMessage(); - - String getDefaultNotFoundI18nMessage(); - - // For single selection - String getDefaultResetSelectionI18nMessage(); - - // For multiple selection - String getDefaultClearSelectionI18nMessage(); - - void setEnabled(boolean enabled); - - void setClearSelectionMessage(boolean multipleSelection); - } - - @PreDestroy - public void destroy() { - liveSearchSelectorItems.destroyAll(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.css deleted file mode 100644 index 703139bbe20..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.css +++ /dev/null @@ -1,147 +0,0 @@ -.appformer-live-search-button-text { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.appformer-live-search-spinner-panel { - display: none; - margin-left: 10px; - height: 30px; -} - -.appformer-live-search-spinner { - display: table-cell; -} - -.appformer-live-search-spinner-text { - display: table-cell; - padding-left: 10px; - vertical-align: middle; -} - -.appformer-live-search-dropdown-menu { - max-height: 250px; - width: 100%; - overflow-y: auto; -} - -.appformer-live-search-spinner-select { - width: 220px; - vertical-align: middle; -} -.appformer-live-search-spinner-select > .dropdown-toggle { - position: relative; - width: 100%; - text-align: right; - white-space: nowrap; - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-box-align: center; - -webkit-align-items: center; - -ms-flex-align: center; - align-items: center; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - -ms-flex-pack: justify; - justify-content: space-between; -} -.appformer-live-search-spinner-select > .dropdown-toggle:after { - margin-top: -1px; -} -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder:hover, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder:focus, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder:active { - color: #999; -} -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder.btn-default, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder.btn-default:hover, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder.btn-default:focus, -.appformer-live-search-spinner-select > .dropdown-toggle.bs-placeholder.btn-default:active { - color: rgba(255, 255, 255, 0.5); -} - -.appformer-live-search-spinner-select:not([class*="col-"]):not([class*="form-control"]):not(.input-group-btn) { - width: 220px; -} -.appformer-live-search-spinner-select .dropdown-toggle:focus { - outline: thin dotted #333333 !important; - outline: 5px auto -webkit-focus-ring-color !important; - outline-offset: -2px; -} -.appformer-live-search-spinner-select.form-control { - margin-bottom: 0; - padding: 0; - border: none; - height: auto; -} - -.appformer-live-search-spinner-select .dropdown-toggle .caret { - position: absolute; - top: 50%; - right: 12px; - margin-top: -2px; - vertical-align: middle; -} - -.appformer-live-search-spinner-select .dropdown-menu { - min-width: 100%; - max-width: 100%; - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -.appformer-live-search-spinner-select .dropdown-menu > .inner:focus { - outline: none !important; -} -.appformer-live-search-spinner-select .dropdown-menu.inner { - position: static; - float: none; - border: 0; - padding: 0; - margin: 0; - border-radius: 0; - -webkit-box-shadow: none; - box-shadow: none; -} -.appformer-live-search-spinner-select .dropdown-menu li { - position: relative; -} -.appformer-live-search-spinner-select .dropdown-menu li.active small { - color: rgba(255, 255, 255, 0.5) !important; -} -.appformer-live-search-spinner-select .dropdown-menu li.disabled a { - cursor: not-allowed; -} -.appformer-live-search-spinner-select .dropdown-menu li a { - cursor: pointer; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.appformer-live-search-spinner-select .dropdown-menu li a.opt { - position: relative; - padding-left: 2.25em; -} -.appformer-live-search-spinner-select .dropdown-menu li a span.check-mark { - display: none; -} -.appformer-live-search-spinner-select .dropdown-menu li a span.text { - display: inline-block; -} -.appformer-live-search-spinner-select .dropdown-menu li small { - padding-left: 0.5em; -} - -.bs-searchbox { - padding: 4px 8px; -} -.bs-searchbox .form-control { - margin-bottom: 0; - width: 100%; - float: none; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.html deleted file mode 100644 index 051d00b24ca..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.html +++ /dev/null @@ -1,26 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.java deleted file mode 100644 index a1b6a814fc5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownView.java +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.KeyDownEvent; -import com.google.gwt.event.dom.client.KeyUpEvent; -import com.google.gwt.event.dom.client.MouseOverEvent; -import com.google.gwt.user.client.ui.Composite; -import org.jboss.errai.common.client.dom.Button; -import org.jboss.errai.common.client.dom.DOMUtil; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.Input; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.common.client.dom.UnorderedList; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.ext.widgets.common.client.dropdown.footer.LiveSearchFooter; -import org.uberfire.ext.widgets.common.client.dropdown.noItems.NoItemsComponent; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; - -@Dependent -@Templated -public class LiveSearchDropDownView extends Composite - implements LiveSearchDropDown.View { - - @Inject - @DataField - Div mainPanel; - - @Inject - @DataField - Div dropDownPanel; - - @Inject - @DataField - Button dropDownButton; - - @Inject - @DataField - Span dropDownText; - - @Inject - @DataField - Div searchPanel; - - @Inject - @DataField - Input searchInput; - - @Inject - @DataField - UnorderedList dropDownMenu; - - @Inject - @DataField - Div spinnerPanel; - - @Inject - @DataField - Span spinnerText; - - @Inject - @DataField - private LiveSearchFooter liveSearchFooter; - - @Inject - @DataField - private NoItemsComponent noItems; - - private boolean resetEnabled = true; - private boolean newItemEnabled = true; - - private LiveSearchDropDown presenter; - - @Override - public void init(LiveSearchDropDown presenter) { - this.presenter = presenter; - } - - @PostConstruct - public void initialize() { - setSearchHint(getDefaultSearchHintI18nMessage()); - setDropDownText(getDefaultSelectorHintI18nMessage()); - setNewInstanceEnabled(false); - setNewEntryI18nMessage(getDefaultNewEntryI18nMessage()); - liveSearchFooter.init(this::showNewItem, this::clearSelection); - } - - private void showNewItem() { - presenter.showNewItem(); - } - - - private void clearSelection() { - presenter.clearSelection(); - } - - @Override - public void setMaxHeight(int maxHeight) { - dropDownMenu.getStyle().setProperty("max-height", - maxHeight + "px"); - } - - @Override - public void setWidth(int minWidth) { - dropDownButton.getStyle().setProperty("width", - minWidth + "px"); - dropDownPanel.getStyle().setProperty("width", - minWidth + "px"); - } - - @Override - public void setSearchEnabled(boolean enabled) { - searchPanel.setHidden(!enabled); - } - - @Override - public void setClearSelectionEnabled(boolean enabled) { - resetEnabled = enabled; - liveSearchFooter.showReset(enabled); - refreshFooter(); - } - - @Override - public void setNewInstanceEnabled(boolean enabled) { - newItemEnabled = enabled; - liveSearchFooter.showAddNewEntry(enabled); - refreshFooter(); - } - - private void refreshFooter() { - liveSearchFooter.getElement().setHidden(!resetEnabled && !newItemEnabled); - } - - @Override - public void showNewItemEditor(InlineCreationEditor editor) { - editor.clear(); - liveSearchFooter.showEditor(editor); - } - - @Override - public void restoreFooter() { - liveSearchFooter.restore(); - } - - @Override - public void clearItems() { - DOMUtil.removeAllChildren(dropDownMenu); - noItems.hide(); - } - - @Override - public void noItems(String msg) { - DOMUtil.removeAllChildren(dropDownMenu); - noItems.setMessage(msg); - noItems.show(); - } - - @Override - public void addItem(LiveSearchSelectorItem item) { - dropDownMenu.appendChild(item.getElement()); - } - - @Override - public void setSelectedValue(String selectedItem) { - dropDownText.setTextContent(selectedItem); - } - - @Override - public void setDropDownText(String text) { - dropDownText.setTextContent(text); - } - - @Override - public void clearSearch() { - searchInput.setValue(""); - } - - @Override - public void setSearchHint(String text) { - searchInput.setAttribute("placeholder", - text); - } - - @Override - public void searchInProgress(String msg) { - spinnerText.setTextContent(msg); - spinnerPanel.getStyle().removeProperty("display"); - dropDownMenu.getStyle().setProperty("display", - "none"); - } - - @Override - public void searchFinished() { - spinnerPanel.getStyle().setProperty("display", - "none"); - dropDownMenu.getStyle().removeProperty("display"); - } - - @Override - public void setEnabled(boolean enabled) { - dropDownButton.setDisabled(!enabled); - } - - @Override - public void setClearSelectionMessage(boolean multipleSelection) { - String message = multipleSelection ? getDefaultClearSelectionI18nMessage() : getDefaultResetSelectionI18nMessage(); - liveSearchFooter.setResetLabel(message); - } - - @Override - public void setNewEntryI18nMessage(String message) { - liveSearchFooter.setNewEntryLabel(message); - } - - @Override - public String getDefaultNewEntryI18nMessage() { - return CommonConstants.INSTANCE.liveSearchNewEntry(); - } - - @Override - public String getDefaultSearchHintI18nMessage() { - return CommonConstants.INSTANCE.liveSearchHint(); - } - - @Override - public String getDefaultSelectorHintI18nMessage() { - return CommonConstants.INSTANCE.liveSearchSelectorHint(); - } - - @Override - public String getDefaultNotFoundI18nMessage() { - return CommonConstants.INSTANCE.liveSearchNotFoundMessage(); - } - - @Override - public String getDefaultResetSelectionI18nMessage() { - return CommonConstants.INSTANCE.liveSearchResetSelectionMessage(); - } - - @Override - public String getDefaultClearSelectionI18nMessage() { - return CommonConstants.INSTANCE.liveSearchClearSelectionMessage(); - } - - @EventHandler("searchInput") - void onSearchChanged(KeyUpEvent event) { - String pattern = searchInput.getValue(); - presenter.search(pattern); - } - - @EventHandler("searchInput") - void onSearchClick(ClickEvent event) { - // Capture and ignore in order to avoid the drop-down to hide - event.stopPropagation(); - } - - @EventHandler("searchInput") - void onSearchOver(MouseOverEvent event) { - searchInput.focus(); - } - - @EventHandler("searchInput") - void onSearchOver(KeyDownEvent event) { - // Capture and ignore in order to avoid the js errors - event.stopPropagation(); - } - - @EventHandler("dropDownButton") - void onDropDownClick(ClickEvent event) { - presenter.onItemsShown(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchEntry.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchEntry.java deleted file mode 100644 index 4ec1296d683..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchEntry.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -public class LiveSearchEntry { - - private TYPE key; - private String value; - - public LiveSearchEntry(TYPE key, String value) { - this.key = key; - this.value = value; - } - - public TYPE getKey() { - return key; - } - - public String getValue() { - return value; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchResults.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchResults.java deleted file mode 100644 index 0493c715283..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchResults.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; - -public class LiveSearchResults extends ArrayList> { - - private int maxEntries = -1; - private static Comparator _byValue = (e1, e2) -> e1.getValue().compareTo(e2.getValue()); - private static Comparator _byKey = (e1, e2) -> e1.getKey().toString().compareTo(e2.getKey().toString()); - - public LiveSearchResults() { - super(); - } - - public LiveSearchResults(int maxEntries) { - super(); - this.maxEntries = maxEntries; - } - - public LiveSearchResults(Collection keysCollection) { - super(); - this.addKeys(keysCollection); - } - - public LiveSearchResults(int maxEntries, Collection itemCollection) { - this(maxEntries); - this.addKeys(itemCollection); - } - - public boolean add(String key) { - return this.add(key, key); - } - - public boolean add(String key, String value) { - if (maxEntries <= 0 || size() < maxEntries) { - LiveSearchEntry entry = new LiveSearchEntry(key, value); - return this.add(entry); - } - return false; - } - - @Override - public boolean add(LiveSearchEntry entry) { - if (maxEntries <= 0 || size() < maxEntries) { - return super.add(entry); - } - return false; - } - - public void addKeys(Collection itemCollection) { - itemCollection.forEach(item -> add(item, item)); - } - - public LiveSearchResults sortByKey() { - sort(_byKey); - return this; - } - - public LiveSearchResults sortByValue() { - sort(_byValue); - return this; - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectionHandler.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectionHandler.java deleted file mode 100644 index da22b300ce9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectionHandler.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.uberfire.mvp.Command; - -/** - * Handles the selection of a {@link LiveSearchDropDown} - * @param The data type handled by the component - */ -public interface LiveSearchSelectionHandler { - - /** - * Retrieves the text for the {@link LiveSearchDropDown} header based on the selected values - * @return The {@link LiveSearchDropDown} header - */ - String getDropDownMenuHeader(); - - /** - * Registers and initializes the given {@link LiveSearchSelectorItem} - * @param item - */ - void registerItem(LiveSearchSelectorItem item); - - /** - * Sets the given {@link LiveSearchSelectorItem} as a selected value - * @param item - */ - void selectItem(LiveSearchSelectorItem item); - - /** - * Selects the {@link LiveSearchSelectorItem} that has the given key - * @param key - */ - void selectKey(TYPE key); - - /** - * Clears the selection - */ - void clearSelection(); - - /** - * Sets the {@link Command} callback to notify the {@link LiveSearchDropDown} when there's a selection change. - * @param command - */ - void setLiveSearchSelectionCallback(Command command); - - /** - * Determines if the handler supports multiple selection or not. - * @return True if supports multiple selection, false if not. - */ - boolean isMultipleSelection(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItem.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItem.java deleted file mode 100644 index a307841dfe4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItem.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.jboss.errai.common.client.api.IsElement; -import org.uberfire.mvp.Command; - -public interface LiveSearchSelectorItem extends IsElement{ - - void init(TYPE key, String value); - - TYPE getKey(); - - String getValue(); - - void reset(); - - void setMultipleSelection(boolean enable); - - void onItemClick(); - - void select(); - - void setSelectionCallback(Command selectionCallback); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItemView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItemView.java deleted file mode 100644 index a40461d10d6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchSelectorItemView.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.uberfire.client.mvp.UberElement; - -public interface LiveSearchSelectorItemView, TYPE> extends UberElement { - - void render(String value); - - void select(); - - void reset(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchService.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchService.java deleted file mode 100644 index fe6424e8431..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchService.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -public interface LiveSearchService { - - void search(String pattern, - int maxResults, - LiveSearchCallback callback); - - void searchEntry(TYPE key, LiveSearchCallback callback); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/ModalCreationEditor.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/ModalCreationEditor.java deleted file mode 100644 index 6843fb78dda..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/ModalCreationEditor.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -public interface ModalCreationEditor extends EntryCreationEditor { - - void show(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandler.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandler.java deleted file mode 100644 index 1ad108bf200..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandler.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; -import org.uberfire.mvp.Command; - -public class MultipleLiveSearchSelectionHandler implements LiveSearchSelectionHandler { - - private int maxDropDownTextItems = 5; - - private Command onChangeNotification; - - private List> visibleItems = new ArrayList<>(); - - private List> selectedItems = new ArrayList<>(); - - public MultipleLiveSearchSelectionHandler() { - } - - public MultipleLiveSearchSelectionHandler(int maxDropDownTextItems) { - this.maxDropDownTextItems = maxDropDownTextItems; - } - - @Override - public String getDropDownMenuHeader() { - if(selectedItems.isEmpty()) { - return null; - } - - if(selectedItems.size() > maxDropDownTextItems) { - return CommonConstants.INSTANCE.liveSearchElementsSelected(selectedItems.size()); - } - - StringBuilder builder = new StringBuilder(); - - for(int i = 0; i< selectedItems.size(); i++) { - if(i > 0) { - if(i == selectedItems.size() -1) { - builder.append(" & "); - } else { - builder.append(", "); - } - } - - builder.append(selectedItems.get(i).getValue()); - } - - return builder.toString(); - } - - @Override - public void registerItem(LiveSearchSelectorItem item) { - item.setSelectionCallback(() -> selectItem(item)); - - item.setMultipleSelection(true); - - LiveSearchSelectorItem selectedItem = selectedItems.stream() - .filter(filterItem -> filterItem.getKey().equals(item.getKey())) - .findFirst() - .orElse(null); - - if(selectedItem != null && selectedItem.getKey().equals(item.getKey())) { - selectedItems.remove(selectedItem); - visibleItems.remove(selectedItem); - - item.select(); - selectedItems.add(item); - } - - visibleItems.add(item); - } - - @Override - public void selectItem(LiveSearchSelectorItem item) { - - LiveSearchSelectorItem selectedItem = selectedItems.stream() - .filter(listItem -> listItem.getKey().equals(item.getKey())).findFirst() - .orElse(null); - - if(selectedItem != null) { - selectedItem.reset(); - selectedItems.remove(selectedItem); - } else { - item.select(); - selectedItems.add(item); - } - - if(onChangeNotification != null) { - onChangeNotification.execute(); - } - } - - - @Override - public void selectKey(TYPE key) { - visibleItems.stream() - .filter(selectorItem -> selectorItem.getKey().equals(key)) - .findFirst() - .ifPresent(this::selectItem); - } - - @Override - public void clearSelection() { - if(!selectedItems.isEmpty()) { - selectedItems.forEach(LiveSearchSelectorItem::reset); - selectedItems.clear(); - - if (onChangeNotification != null) { - onChangeNotification.execute(); - } - } - } - - public List getSelectedValues() { - return selectedItems.stream() - .map(LiveSearchSelectorItem::getKey) - .collect(Collectors.toList()); - } - - public void setMaxDropDownTextItems(int maxDropDownTextItems) { - this.maxDropDownTextItems = maxDropDownTextItems; - } - - @Override - public void setLiveSearchSelectionCallback(Command command) { - this.onChangeNotification = command; - } - - @Override - public boolean isMultipleSelection() { - return true; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDown.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDown.java deleted file mode 100644 index b0dcbc6a6dc..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDown.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.Set; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.jboss.errai.ioc.client.container.SyncBeanDef; -import org.uberfire.client.mvp.Activity; -import org.uberfire.client.mvp.ActivityBeansCache; -import org.uberfire.client.mvp.PerspectiveActivity; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; -import org.uberfire.mvp.Command; - -@Dependent -public class PerspectiveDropDown implements IsWidget { - - ActivityBeansCache activityBeansCache; - LiveSearchDropDown liveSearchDropDown; - PerspectiveNameProvider perspectiveNameProvider; - Set perspectiveIdsExcluded; - LiveSearchService searchService = new LiveSearchService() { - @Override - public void search(String pattern, int maxResults, LiveSearchCallback callback) { - LiveSearchResults result = new LiveSearchResults(maxResults); - for (SyncBeanDef beanDef : activityBeansCache.getPerspectiveActivities()) { - String perspectiveName = beanDef.getName(); - if (perspectiveIdsExcluded == null || !perspectiveIdsExcluded.contains(perspectiveName)) { - String name = getItemName(perspectiveName); - if (name.toLowerCase().contains(pattern.toLowerCase())) { - result.add(perspectiveName, name); - } - } - } - result.sortByValue(); - callback.afterSearch(result); - } - - @Override - public void searchEntry(String key, LiveSearchCallback callback) { - LiveSearchResults result = new LiveSearchResults(1); - - activityBeansCache.getPerspectiveActivities() - .stream() - .map(SyncBeanDef::getName) - .filter(perspectiveName -> (perspectiveIdsExcluded == null || !perspectiveIdsExcluded.contains(perspectiveName)) && perspectiveName.equals(key)) - .findAny() - .ifPresent(perspectiveName -> result.add(perspectiveName, getItemName(perspectiveName))); - callback.afterSearch(result); - } - }; - - SingleLiveSearchSelectionHandler selectionHandler = new SingleLiveSearchSelectionHandler<>(); - - @Inject - public PerspectiveDropDown(ActivityBeansCache activityBeansCache, - LiveSearchDropDown liveSearchDropDown) { - this.activityBeansCache = activityBeansCache; - this.liveSearchDropDown = liveSearchDropDown; - this.perspectiveNameProvider = null; - } - - @PostConstruct - private void init() { - liveSearchDropDown.setSelectorHint(CommonConstants.INSTANCE.PerspectiveSelectHint()); - liveSearchDropDown.setSearchHint(CommonConstants.INSTANCE.PerspectiveSearchHint()); - liveSearchDropDown.setNotFoundMessage(CommonConstants.INSTANCE.PerspectiveNotFound()); - liveSearchDropDown.setClearSelectionEnabled(false); - liveSearchDropDown.init(searchService, selectionHandler); - } - - @Override - public Widget asWidget() { - return liveSearchDropDown.asWidget(); - } - - public void setPerspectiveNameProvider(PerspectiveNameProvider perspectiveNameProvider) { - this.perspectiveNameProvider = perspectiveNameProvider; - } - - public void setPerspectiveIdsExcluded(Set perspectiveIdsExcluded) { - this.perspectiveIdsExcluded = perspectiveIdsExcluded; - } - - public PerspectiveActivity getDefaultPerspective() { - for (SyncBeanDef beanDef : activityBeansCache.getPerspectiveActivities()) { - PerspectiveActivity p = (PerspectiveActivity) beanDef.getInstance(); - if (p.isDefault()) { - return p; - } - } - return null; - } - - public PerspectiveActivity getSelectedPerspective() { - String selected = selectionHandler.getSelectedKey(); - if (selected == null) { - return null; - } - SyncBeanDef beanDef = activityBeansCache.getActivity(selected); - PerspectiveActivity p = (PerspectiveActivity) beanDef.getInstance(); - return p; - } - - public void setSelectedPerspective(String perspectiveId) { - liveSearchDropDown.setSelectedItem(perspectiveId); - } - - public void setSelectedPerspective(PerspectiveActivity selectedPerspective) { - liveSearchDropDown.setSelectedItem(selectedPerspective.getIdentifier()); - } - - public void setMaxItems(int maxItems) { - liveSearchDropDown.setMaxItems(maxItems); - } - - public void setWidth(int minWidth) { - liveSearchDropDown.setWidth(minWidth); - } - - public void setOnChange(Command onChange) { - liveSearchDropDown.setOnChange(onChange); - } - - public void clear() { - liveSearchDropDown.clear(); - } - - public String getItemName(PerspectiveActivity p) { - return getItemName(p.getIdentifier()); - } - - public String getItemName(String perspectiveId) { - if (perspectiveNameProvider != null) { - return perspectiveNameProvider.getPerspectiveName(perspectiveId); - } else { - String fullName = perspectiveId; - int lastDot = fullName.lastIndexOf("."); - return lastDot != -1 ? fullName.substring(lastDot + 1) : fullName; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveNameProvider.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveNameProvider.java deleted file mode 100644 index ad8c73d3556..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveNameProvider.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -/** - * Interface used to feed the {@link PerspectiveDropDown} widget with user friendly perspective names. - */ -public interface PerspectiveNameProvider { - - /** - * Get a user friendly name for the given perspective identifier - * @param perspectiveId The id. of an existing perspective. - * @return A displayable name - */ - String getPerspectiveName(String perspectiveId); -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandler.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandler.java deleted file mode 100644 index 15dfc5d3766..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandler.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.ArrayList; -import java.util.List; - -import org.uberfire.mvp.Command; - -public class SingleLiveSearchSelectionHandler implements LiveSearchSelectionHandler { - - protected List> visibleItems = new ArrayList<>(); - - private LiveSearchSelectorItem selectedItem; - - private Command onChangeNotification; - - public SingleLiveSearchSelectionHandler() { - } - - @Override - public String getDropDownMenuHeader() { - if(selectedItem != null) { - return selectedItem.getValue(); - } - return null; - } - - @Override - public void registerItem(final LiveSearchSelectorItem item) { - if(selectedItem != null && selectedItem.getKey().equals(item.getKey())) { - visibleItems.remove(selectedItem); - item.select(); - selectedItem = item; - } - - item.setSelectionCallback(() -> selectItem(item)); - - visibleItems.add(item); - } - - @Override - public void selectItem(LiveSearchSelectorItem item) { - if(selectedItem == null) { - selectedItem = item; - selectedItem.select(); - } else { - if(!selectedItem.getKey().equals(item.getKey())) { - selectedItem.reset(); - selectedItem = item; - selectedItem.select(); - } - } - - if(onChangeNotification != null) { - onChangeNotification.execute(); - } - } - - @Override - public void selectKey(TYPE key) { - if(selectedItem != null && selectedItem.getKey().equals(key)) { - return; - } - - visibleItems.stream() - .filter(item -> item.getKey().equals(key)) - .findFirst() - .ifPresent(item -> selectItem(item)); - } - - public TYPE getSelectedKey() { - if(selectedItem != null) { - return selectedItem.getKey(); - } - - return null; - } - - public String getSelectedValue() { - if(selectedItem != null) { - return selectedItem.getValue(); - } - - return null; - } - - @Override - public void setLiveSearchSelectionCallback(Command command) { - this.onChangeNotification = command; - } - - @Override - public void clearSelection() { - if(selectedItem != null) { - selectedItem.reset(); - selectedItem = null; - - if (onChangeNotification != null) { - onChangeNotification.execute(); - } - } - } - - @Override - public boolean isMultipleSelection() { - return false; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooter.java deleted file mode 100644 index fde2b65c6b4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooter.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.footer; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.ext.widgets.common.client.dropdown.InlineCreationEditor; -import org.uberfire.mvp.Command; - -@Dependent -public class LiveSearchFooter implements LiveSearchFooterView.Presenter, - IsElement { - - private LiveSearchFooterView view; - - private Command onNewEntry; - private Command onReset; - - @Inject - public LiveSearchFooter(LiveSearchFooterView view) { - this.view = view; - view.init(this); - } - - public void init(Command onNewEntry, Command onReset) { - this.onNewEntry = onNewEntry; - this.onReset = onReset; - } - - public void showEditor(InlineCreationEditor editor) { - view.show(editor.getElement()); - } - - public void showReset(boolean show) { - view.showReset(show); - } - - public void showAddNewEntry(boolean show) { - view.showAddNewEntry(show); - } - - @Override - public void onNewEntryPressed() { - onNewEntry.execute(); - } - - @Override - public void onResetPressed() { - onReset.execute(); - } - - @Override - public HTMLElement getElement() { - return view.getElement(); - } - - public void restore() { - view.restore(); - } - - public void setResetLabel(String resetLabel) { - view.setResetLabel(resetLabel); - } - - public void setNewEntryLabel(String newEntryLabel) { - view.setNewEntryLabel(newEntryLabel); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterView.java deleted file mode 100644 index 85aaef31f75..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterView.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.footer; - -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.client.mvp.UberElement; - -public interface LiveSearchFooterView extends UberElement { - - void showReset(boolean show); - - void showAddNewEntry(boolean show); - - void show(HTMLElement element); - - void restore(); - - void setResetLabel(String resetLabel); - - void setNewEntryLabel(String newEntryLabel); - - interface Presenter { - - void onNewEntryPressed(); - - void onResetPressed(); - } - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.css deleted file mode 100644 index 267da6d4aed..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.css +++ /dev/null @@ -1,14 +0,0 @@ -.appformer-live-search-selector-footer-panel { - border-top: 1px solid #bbb; - padding-top: 5px; - padding-left: 10px; - padding-right: 10px; -} - -.appformer-live-search-selector-action { - cursor: pointer; -} - -.appformer-live-search-selector-action-icon { - padding-right: 5px; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.html deleted file mode 100644 index 28f138ca049..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.html +++ /dev/null @@ -1,18 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.java deleted file mode 100644 index 2d834163665..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterViewImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.footer; - -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.ClickEvent; -import org.jboss.errai.common.client.dom.Anchor; -import org.jboss.errai.common.client.dom.DOMUtil; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.ui.client.local.api.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class LiveSearchFooterViewImpl implements LiveSearchFooterView, - IsElement { - - private Presenter presenter; - - @Inject - @DataField - private Div container; - - @Inject - @DataField - private Div footer; - - @Inject - @DataField - private Anchor newEntryAnchor; - - @Inject - @DataField - private Span newEntryAnchorLabel; - - @Inject - @DataField - private Anchor resetAnchor; - - @Inject - @DataField - private Span resetAnchorLabel; - - @Override - public void init(Presenter presenter) { - this.presenter = presenter; - } - - @Override - public void setResetLabel(String resetLabel) { - resetAnchorLabel.setTextContent(resetLabel); - } - - @Override - public void setNewEntryLabel(String newEntryLabel) { - newEntryAnchorLabel.setTextContent(newEntryLabel); - } - - @Override - public void showReset(boolean show) { - resetAnchor.setHidden(!show); - } - - @Override - public void showAddNewEntry(boolean show) { - newEntryAnchor.setHidden(!show); - } - - @Override - public void show(HTMLElement element) { - DOMUtil.removeAllChildren(container); - container.appendChild(element); - } - - @Override - public void restore() { - DOMUtil.removeAllChildren(container); - container.appendChild(footer); - } - - @EventHandler("newEntryAnchor") - public void onNewEntryPresed(ClickEvent clickEvent) { - clickEvent.stopPropagation(); - presenter.onNewEntryPressed(); - } - - @EventHandler("resetAnchor") - public void onResetPressed(ClickEvent clickEvent) { - presenter.onResetPressed(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItem.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItem.java deleted file mode 100644 index a85ac871268..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItem.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.dropdown.items; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchSelectorItem; -import org.uberfire.mvp.Command; - -@Dependent -public class LiveSearchSelectorDropDownItem implements LiveSearchSelectorItem { - - private LiveSearchSelectorDropDownItemView view; - private TYPE key; - private String value; - private Command selectionCallback; - - @Inject - public LiveSearchSelectorDropDownItem(LiveSearchSelectorDropDownItemView view) { - this.view = view; - this.view.init(this); - } - - @Override - public void init(TYPE key, - String value) { - - this.key = key; - this.value = value; - view.render(value); - } - - @Override - public void setSelectionCallback(Command selectionCallback) { - this.selectionCallback = selectionCallback; - } - - @Override - public TYPE getKey() { - return key; - } - - @Override - public String getValue() { - return value; - } - - @Override - public void onItemClick() { - if(selectionCallback != null) { - selectionCallback.execute(); - } - } - - @Override - public void select() { - view.select(); - } - - @Override - public void reset() { - view.reset(); - } - - @Override - public HTMLElement getElement() { - return view.getElement(); - } - - @Override - public void setMultipleSelection(boolean enable) { - view.setSelectionIconVisible(enable); - view.setMultiSelect(enable); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemView.java deleted file mode 100644 index acf91f9eef7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemView.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.items; - -import org.uberfire.ext.widgets.common.client.dropdown.LiveSearchSelectorItemView; - -public interface LiveSearchSelectorDropDownItemView extends LiveSearchSelectorItemView, TYPE> { - - void setSelectionIconVisible(boolean visible); - - void setMultiSelect(boolean multiSelect); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.css deleted file mode 100644 index cf7dae4628e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.css +++ /dev/null @@ -1,14 +0,0 @@ -.appformer-live-search-selector-dditem { - cursor: pointer; -} - -.appformer-live-search-selector-dditem-icon-hidden { - display: none; -} - -.appformer-live-search-selector-dditem-icon-visible { - margin-left: 5px; - cursor: pointer; - float: right; - display: block !important; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.html deleted file mode 100644 index 90f8a0b7ba4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.html +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.java deleted file mode 100644 index 1de7a77315c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/items/LiveSearchSelectorDropDownItemViewImpl.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright 2014 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.items; - -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.DomEvent; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.event.dom.client.KeyDownEvent; -import org.jboss.errai.common.client.dom.Anchor; -import org.jboss.errai.common.client.dom.DOMUtil; -import org.jboss.errai.common.client.dom.ListItem; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.ui.client.local.api.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class LiveSearchSelectorDropDownItemViewImpl implements LiveSearchSelectorDropDownItemView, - IsElement { - - private final static String ICON_VISIBLE_CLASSNAME = "appformer-live-search-selector-dditem-icon-visible"; - private final static String ICON_HIDDEN_CLASSNAME = "appformer-live-search-selector-dditem-icon-hidden"; - - @Inject - @DataField - private ListItem item; - - @Inject - @DataField - private Anchor itemAnchor; - - @Inject - @DataField - private Span itemText; - - @Inject - @DataField - private Span itemIcon; - - private LiveSearchSelectorDropDownItem presenter; - - private boolean iconVisible = false; - - private boolean multiSelect = false; - - @Override - public void render(String value) { - itemText.setTextContent(value); - } - - @Override - public void init(LiveSearchSelectorDropDownItem presenter) { - this.presenter = presenter; - this.reset(); - } - - @Override - public void select() { - item.setClassName("appformer-live-search-selector-dditem selected"); - if (iconVisible) { - DOMUtil.removeCSSClass(itemIcon, ICON_HIDDEN_CLASSNAME); - DOMUtil.addCSSClass(itemIcon, ICON_VISIBLE_CLASSNAME); - } - } - - @Override - public void reset() { - item.setClassName("appformer-live-search-selector-dditem"); - DOMUtil.removeCSSClass(itemIcon, ICON_VISIBLE_CLASSNAME); - DOMUtil.addCSSClass(itemIcon, ICON_HIDDEN_CLASSNAME); - } - - @Override - public void setSelectionIconVisible(boolean visible) { - iconVisible = visible; - if (!iconVisible) { - DOMUtil.removeCSSClass(itemIcon, ICON_VISIBLE_CLASSNAME); - DOMUtil.addCSSClass(itemIcon, ICON_HIDDEN_CLASSNAME); - } - } - - @Override - public void setMultiSelect(boolean multiSelect) { - this.multiSelect = multiSelect; - } - - private void onItemSelected(DomEvent event) { - presenter.onItemClick(); - - if (multiSelect) { - event.stopPropagation(); - } - } - - @EventHandler("itemAnchor") - public void onItemClick(ClickEvent event) { - onItemSelected(event); - } - - @EventHandler("itemAnchor") - void onEnterKeyDown(KeyDownEvent event) { - if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { - onItemSelected(event); - } - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponent.java deleted file mode 100644 index efae56b28c8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponent.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.noItems; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; - -@Dependent -public class NoItemsComponent implements IsElement { - - private NoItemsComponentView view; - - @Inject - public NoItemsComponent(NoItemsComponentView view) { - this.view = view; - } - - public void setMessage(String message) { - if(message == null || message.isEmpty()) { - message = CommonConstants.INSTANCE.liveSearchNotFoundMessage(); - } - - view.setMessage(message); - } - - public void show() { - view.show(); - } - - public void hide() { - view.hide(); - } - - @Override - public HTMLElement getElement() { - return view.getElement(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentView.java deleted file mode 100644 index effcb2d8a61..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentView.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.noItems; - -import org.jboss.errai.common.client.api.IsElement; - -public interface NoItemsComponentView extends IsElement { - - void setMessage(String message); - - void hide(); - - void show(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.css deleted file mode 100644 index 91242914e5f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.css +++ /dev/null @@ -1,3 +0,0 @@ -.appformer-widgets-livesearch-no-items { - margin-left: 10px; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.html deleted file mode 100644 index 80b2090d2f0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.html +++ /dev/null @@ -1,3 +0,0 @@ -
        - -
        diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.java deleted file mode 100644 index d0c69a9b775..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentViewImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.noItems; - -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.ui.client.local.api.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class NoItemsComponentViewImpl implements NoItemsComponentView, - IsElement { - @Inject - @DataField - private Div container; - - @Inject - @DataField - private Span message; - - @Override - public void setMessage(String msg) { - message.setTextContent(msg); - } - - @Override - public void hide() { - container.setHidden(true); - } - - @Override - public void show() { - container.setHidden(false); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/GetFormParamsEvent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/GetFormParamsEvent.java deleted file mode 100644 index 267bd258cdb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/GetFormParamsEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.forms; - -import java.util.Map; - -//This class is not @Portable since we only want it client-side -public class GetFormParamsEvent { - - private String action; - private Map params; - - public GetFormParamsEvent() { - } - - public GetFormParamsEvent(String action, - Map params) { - this.action = action; - this.params = params; - } - - public Map getParams() { - return params; - } - - public String getAction() { - return action; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/RequestFormParamsEvent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/RequestFormParamsEvent.java deleted file mode 100644 index c5a2f540e01..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/RequestFormParamsEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.forms; - -//This class is not @Portable since we only want it client-side -public class RequestFormParamsEvent { - - private String action; - - public RequestFormParamsEvent() { - } - - public RequestFormParamsEvent(String action) { - this.action = action; - } - - public String getAction() { - return action; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/SetFormParamsEvent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/SetFormParamsEvent.java deleted file mode 100644 index 1f54f25003b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/forms/SetFormParamsEvent.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.forms; - -import java.util.Map; - -//This class is not @Portable since we only want it client-side -public class SetFormParamsEvent { - - private Map params; - private boolean readOnly; - - public SetFormParamsEvent() { - } - - public SetFormParamsEvent(Map params, - boolean readOnly) { - this.params = params; - this.readOnly = readOnly; - } - - public Map getParams() { - return params; - } - - public boolean isReadOnly() { - return readOnly; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonAltedImages.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonAltedImages.java deleted file mode 100644 index eb28df237ae..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonAltedImages.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.resources; - -import com.google.gwt.user.client.ui.Image; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; - -/** - * - */ -public class CommonAltedImages { - - public static final CommonAltedImages INSTANCE = new CommonAltedImages(); - - public Image close() { - final Image image = new Image(CommonImages.INSTANCE.close()); - image.setAltText(CommonConstants.INSTANCE.Close()); - return image; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonCss.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonCss.java deleted file mode 100644 index 9b822b821e3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonCss.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.resources; - -import com.google.gwt.resources.client.CssResource; - -public interface CommonCss - extends - CssResource { - - @ClassName("whiteTopLeftCornerClass") - String whiteTopLeftCornerClass(); - - @ClassName("whiteTopRightCornerClass") - String whiteTopRightCornerClass(); - - @ClassName("whiteBottomLeftCornerClass") - String whiteBottomLeftCornerClass(); - - @ClassName("whiteBottomRightCornerClass") - String whiteBottomRightCornerClass(); - - @ClassName("whiteBottomClass") - String whiteBottomClass(); - - @ClassName("whiteTopClass") - String whiteTopClass(); - - @ClassName("whiteSideLeftClass") - String whiteSideLeftClass(); - - @ClassName("whiteSideRightClass") - String whiteSideRightClass(); - - @ClassName("whiteCenterClass") - String whiteCenterClass(); - - @ClassName("greyTopLeftCornerClass") - String greyTopLeftCornerClass(); - - @ClassName("greyTopRightCornerClass") - String greyTopRightCornerClass(); - - @ClassName("greyBottomLeftCornerClass") - String greyBottomLeftCornerClass(); - - @ClassName("greyBottomRightCornerClass") - String greyBottomRightCornerClass(); - - @ClassName("greyBottomClass") - String greyBottomClass(); - - @ClassName("greyTopClass") - String greyTopClass(); - - @ClassName("greySideLeftClass") - String greySideLeftClass(); - - @ClassName("greySideRightClass") - String greySideRightClass(); - - @ClassName("greyCenterClass") - String greyCenterClass(); - - @ClassName("clean-textarea") - String cleanTextArea(); - - @ClassName("busy-popup") - String busyPopup(); - - @ClassName("titleTextCellContainer") - String titleTextCellContainer(); - - @ClassName("titleTextCellDescription") - String titleTextCellDescription(); - - @ClassName("dataGrid") - String dataGrid(); - - @ClassName("dataGridHeader") - String dataGridHeader(); - - @ClassName("dataGridContent") - String dataGridContent(); - - @ClassName("dataGridRow") - String dataGridRow(); - - @ClassName("columnPickerPopup") - String columnPickerPopup(); - - @ClassName("columnPickerButton") - String columnPickerButton(); - - @ClassName("popoverTextBreakWord") - String popoverTextBreakWord(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonImages.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonImages.java deleted file mode 100644 index d94b288e181..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonImages.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.resources.client.ImageResource.ImageOptions; -import com.google.gwt.resources.client.ImageResource.RepeatStyle; - -public interface CommonImages - extends - ClientBundle { - - public static final CommonImages INSTANCE = GWT.create(CommonImages.class); - - @Source("images/new_item.gif") - ImageResource newItem(); - - @Source("images/new_item_disabled.gif") - ImageResource newItemDisabled(); - - @Source("images/collapse.gif") - ImageResource collapse(); - - @Source("images/collapseall.gif") - ImageResource collapseAll(); - - @Source("images/expand.gif") - ImageResource expand(); - - @Source("images/expandall.gif") - ImageResource expandAll(); - - @Source("images/close.gif") - ImageResource close(); - - @Source("images/corners/whiteTopLeft.gif") - ImageResource whiteTopLeftCorner(); - - @Source("images/corners/whiteTopRight.gif") - ImageResource whiteTopRightCorner(); - - @Source("images/corners/whiteBottomLeft.gif") - ImageResource whiteBottomLeftCorner(); - - @Source("images/corners/whiteBottomRight.gif") - ImageResource whiteBottomRightCorner(); - - @Source("images/corners/greyTopLeftCorner.gif") - ImageResource greyTopLeftCorner(); - - @Source("images/corners/greyTopRightCorner.gif") - ImageResource greyTopRightCorner(); - - @Source("images/corners/greyBottomLeftCorner.gif") - ImageResource greyBottomLeftCorner(); - - @Source("images/corners/greyBottomRightCorner.gif") - ImageResource greyBottomRightCorner(); - - @ImageOptions(repeatStyle = RepeatStyle.Horizontal) - @Source("images/corners/greyBottom.gif") - ImageResource greyBottom(); - - @ImageOptions(flipRtl = true, repeatStyle = RepeatStyle.Horizontal) - @Source("images/corners/greyTop.gif") - ImageResource greyTop(); - - @ImageOptions(repeatStyle = RepeatStyle.Vertical) - @Source("images/corners/greyLeftSide.gif") - ImageResource greySideLeft(); - - @ImageOptions(repeatStyle = RepeatStyle.Vertical) - @Source("images/corners/greyRightSide.gif") - ImageResource greySideRight(); - - //A warning triangle - @Source("images/warning-large.png") - ImageResource warningLarge(); - - @Source("images/information.gif") - ImageResource information(); - - @Source("images/validation_error.gif") - ImageResource validationError(); - - @Source("images/spinner.gif") - ImageResource spinner(); - - //Simple Pager - @Source("images/downArrow.png") - ImageResource downArrow(); - - //Simple Pager - @Source("images/smallDownArrow.png") - ImageResource smallDownArrow(); - - //Simple Pager - @Source("images/upArrow.png") - ImageResource upArrow(); - - //Simple Pager - @Source("images/smallUpArrow.png") - ImageResource smallUpArrow(); - - //Simple Pager - @Source("images/columnPicker.png") - ImageResource columnPicker(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonResources.java deleted file mode 100644 index 7cecd15f32f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/CommonResources.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; - -public interface CommonResources - extends - ClientBundle { - - CommonResources INSTANCE = GWT.create(CommonResources.class); - - @Source("css/common.css") - CommonCss CSS(); - - CommonImages images(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/HtmlEditorResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/HtmlEditorResources.java deleted file mode 100644 index e04a43318fc..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/HtmlEditorResources.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.TextResource; - -public interface HtmlEditorResources extends ClientBundle { - - HtmlEditorResources INSTANCE = GWT.create(HtmlEditorResources.class); - - @Source({"js/wysihtml/wysihtml.min.js"}) - TextResource wysihtml(); - - @Source({"js/wysihtml/wysihtml.all-commands.min.js"}) - TextResource wysihtmlAllCommands(); - - @Source({"js/wysihtml/wysihtml.table_editing.min.js"}) - TextResource wysihtmlTableEditing(); - - @Source({"js/wysihtml/wysihtml.toolbar.min.js"}) - TextResource wysihtmlToolbar(); - - @Source({"js/wysihtml/parser_rules/advanced_and_extended.js"}) - TextResource parserRules(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.java deleted file mode 100644 index 790a685cc17..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.java +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.resources.i18n; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.i18n.client.Messages; - -/** - * - */ -public interface CommonConstants - extends Messages { - - public static final CommonConstants INSTANCE = GWT.create(CommonConstants.class); - - String OK(); - - String YES(); - - String NO(); - - String Information(); - - String Close(); - - String Error(); - - String Warning(); - - String ShowDetail(); - - String AbstractTableOpen(); - - String AbstractTablePleaseSelectAnItemToDelete(); - - String AbstractTableRefreshList(); - - String AbstractTableOpenSelected(); - - String AbstractTableFileURI(); - - String ReOpen(); - - String Ignore(); - - String ForceSave(); - - String Cancel(); - - String ConcurrentIssue(); - - String ConcurrentUpdate(String identity, - String pathURI); - - String ConcurrentRename(String identity, - String sourceURI, - String targetURI); - - String ConcurrentDelete(String identity, - String pathURI); - - String ChooseFile(); - - String Upload(); - - String More(); - - String Active(); - - String ExceptionInvalidPath(); - - String ExceptionFileAlreadyExists0(final String uri); - - String ExceptionNoSuchFile0(final String uri); - - String ExceptionSecurity0(final String uri); - - String ExceptionGeneric0(final String message); - - String ItemDeletedSuccessfully(); - - String DeletePopupTitle(); - - String DeletePopupDelete(); - - String Version(); - - String Items(); - - String ColorPickerTitle(); - - String Add_New_Filter(); - - String Filter_parameters(); - - String Filter_Management(); - - String Filter_Name(); - - String Filter_Must_Have_A_Name(); - - String RemoveFilter(); - - String CustomFilters(); - - String NoCustomFilterAvailable(); - - String Refresh(); - - String ColumnPickerButtonTooltip(); - - String PageSizeSelectorTooltip(); - - String Reset(); - - String Actions(); - - String Basic_Properties(); - - String ClickToDisplay0(final String resourceGroup); - - String RemoveTabTitle(); - - String RemoveTabConfirm(String tabName); - - String AutoRefresh(); - - String Disable_autorefresh(); - - String Autorefresh_Disabled(); - - String Minutes(); - - String Minute(); - - String liveSearchHint(); - - String liveSearchSelectorHint(); - - String liveSearchNotFoundMessage(); - - String liveSearchElementsSelected(int elements); - - String liveSearchNewEntry(); - - String liveSearchClearSelectionMessage(); - - String liveSearchResetSelectionMessage(); - - String PerspectiveSelectHint(); - - String PerspectiveSearchHint(); - - String PerspectiveNotFound(); - - String by(); - - String on(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/NullSelectOption.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/NullSelectOption.java deleted file mode 100644 index 528a9b307c0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/NullSelectOption.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -public class NullSelectOption implements SelectOption { - - @Override - public String getSelector() { - return "NONE"; - } - - @Override - public String getName() { - return "None"; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectComponent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectComponent.java deleted file mode 100644 index 21d397c4058..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectComponent.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Consumer; -import java.util.stream.Collectors; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.uberfire.client.mvp.UberElemental; - -public class SelectComponent { - - private View view; - private ManagedInstance selectOptionWidget; - private SelectOption selected; - private Consumer callback; - private List components; - - @Inject - public SelectComponent(final View view, - final ManagedInstance selectOptionComponent) { - this.view = view; - this.selectOptionWidget = selectOptionComponent; - } - - @PostConstruct - public void init() { - this.view.init(this); - } - - public void setup(List options, - Consumer selectCallback) { - this.setSelected(getFirstSelectOption(options)); - this.setSelectOptions(options); - this.callback = selectCallback; - } - - private SelectOption getFirstSelectOption(List options) { - return !options.isEmpty() ? options.get(0) : new NullSelectOption(); - } - - protected void setSelectOptions(List options) { - this.view.clear(); - this.components = new ArrayList<>(); - components.addAll(options.stream().map(this::createSelectedOptionComponent).collect(Collectors.toList())); - this.view.addOptions(components); - } - - protected SelectOptionComponent createSelectedOptionComponent(SelectOption selectOption) { - SelectOptionComponent component = this.selectOptionWidget.get(); - component.initialize(selectOption, - selected -> { - this.deactivateAll(); - component.activate(); - this.setSelected(selected); - this.callback.accept(selected); - }); - return component; - } - - protected void deactivateAll() { - this.components.forEach(SelectOptionComponent::deactivate); - } - - public void setSelected(SelectOption selected) { - this.selected = selected; - this.update(); - } - - private void update() { - this.view.setSelected(this.selected.getName()); - } - - public SelectOption getSelected() { - return this.selected; - } - - public View getView() { - return this.view; - } - - public interface View extends UberElemental { - - void addOption(SelectOptionComponent selectOptionComponent); - - void setSelected(String label); - - void addOptions(List components); - - void clear(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponent.java deleted file mode 100644 index 63eb78cfb90..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponent.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import java.util.function.Consumer; - -import javax.inject.Inject; - -import org.uberfire.client.mvp.UberElemental; - -public class SelectOptionComponent { - - private View view; - private SelectOption selectOption; - private Consumer callback; - - @Inject - public SelectOptionComponent(final View view) { - this.view = view; - } - - public void initialize(SelectOption selectOption, - Consumer callback) { - this.view.init(this); - this.selectOption = selectOption; - this.callback = callback; - this.view.setName(selectOption.getName()); - } - - public void select() { - this.callback.accept(selectOption); - } - - public void activate() { - this.view.setActive(true); - } - - public void deactivate() { - this.view.setActive(false); - } - - public View getView() { - return this.view; - } - - public interface View extends UberElemental { - - void setName(String name); - - void setActive(boolean isActive); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionImpl.java deleted file mode 100644 index dfa718a8491..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionImpl.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotEmpty; - -public class SelectOptionImpl implements SelectOption { - - private final String selector; - private final String name; - - public SelectOptionImpl(String selector, - String name) { - - this.selector = checkNotEmpty("selector", - selector).toUpperCase(); - this.name = name; - } - - public String getSelector() { - return selector; - } - - public String getName() { - if (this.name == null || this.name.isEmpty()) { - return this.selector; - } else { - return this.name; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.html deleted file mode 100644 index 541ec3b6bf9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.html +++ /dev/null @@ -1,18 +0,0 @@ - - -
      • diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.java deleted file mode 100644 index e0fde25ad28..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectOptionView.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.ClickEvent; -import elemental2.dom.HTMLAnchorElement; -import elemental2.dom.HTMLLIElement; -import org.jboss.errai.ui.client.local.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class SelectOptionView implements SelectOptionComponent.View, - IsElement { - - @Inject - @DataField("selector") - private HTMLLIElement selector; - - @Inject - @DataField("option") - private HTMLAnchorElement option; - - private SelectOptionComponent presenter; - - @Override - public void init(SelectOptionComponent presenter) { - this.presenter = presenter; - } - - @Override - public void setName(String name) { - this.option.textContent = name; - } - - @Override - public void setActive(boolean isActive) { - this.selector.classList.remove("selected"); - if (isActive) { - this.selector.classList.add("selected"); - } - } - - @EventHandler("option") - public void onClick(ClickEvent clickEvent) { - this.presenter.select(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.html b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.html deleted file mode 100644 index 3cae8e6e98d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.html +++ /dev/null @@ -1,29 +0,0 @@ - - -
        - - -
        diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.java deleted file mode 100644 index 7b37c22294a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/select/SelectView.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import java.util.List; - -import javax.inject.Inject; -import javax.inject.Named; - -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLUListElement; -import org.jboss.errai.ui.client.local.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class SelectView implements SelectComponent.View, - IsElement { - - private SelectComponent presenter; - - @Inject - @Named("span") - @DataField("selected") - private HTMLElement selected; - - @Inject - @DataField("options") - private HTMLUListElement options; - - @Override - public void init(SelectComponent presenter) { - this.presenter = presenter; - } - - @Override - public void addOption(SelectOptionComponent selectOptionComponent) { - this.options.appendChild(selectOptionComponent.getView().getElement()); - } - - @Override - public void setSelected(String label) { - this.selected.textContent = label; - } - - @Override - public void addOptions(List components) { - components.forEach(this::addOption); - } - - @Override - public void clear() { - this.options.textContent = ""; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ColumnPicker.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ColumnPicker.java deleted file mode 100644 index d6a859746eb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ColumnPicker.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import java.util.List; - -import org.gwtbootstrap3.client.ui.gwt.DataGrid; -import org.uberfire.ext.widgets.table.client.ColumnMeta; -import org.uberfire.ext.widgets.table.client.UberfireColumnPicker; - -public class ColumnPicker extends UberfireColumnPicker { - - public static int DETAULT_COLUMN_WIDTH = 120; - private int dataGridMinWidth = 0; - - public ColumnPicker(DataGrid dataGrid) { - super(dataGrid); - } - - protected void sortAndAddColumns(List> columnMetas) { - super.sortAndAddColumns(columnMetas); - } - - public void adjustColumnWidths() { - super.adjustColumnWidths(); - - } - - public int getDataGridMinWidth() { - return this.dataGridMinWidth; - } - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResource.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResource.java deleted file mode 100644 index ce4e5200330..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResource.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.user.client.ui.Image; - -public class ComparableImageResource implements Comparable { - - private final String format; - private final Image imageResource; - - public ComparableImageResource(String format, - Image imageResource) { - this.format = format; - this.imageResource = imageResource; - } - - public String getImageHTML() { - return this.imageResource.toString(); - } - - public int compareTo(ComparableImageResource o) { - return format.compareTo(o.format); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResourceCell.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResourceCell.java deleted file mode 100644 index 3fe9e93883c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ComparableImageResourceCell.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.cell.client.AbstractCell; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; - -public class ComparableImageResourceCell extends AbstractCell { - - @Override - public void render(Context context, - ComparableImageResource value, - SafeHtmlBuilder sb) { - if (value != null) { - // The template will sanitize the URI. - sb.append(SafeHtmlUtils.fromTrustedString(value.getImageHTML())); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/DataGridFilter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/DataGridFilter.java deleted file mode 100644 index 995e740522e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/DataGridFilter.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.common.client.tables; - -import org.uberfire.mvp.Command; - -public class DataGridFilter implements Comparable { - - private String key; - private Command filterCommand; - - public DataGridFilter(String key, - Command filterCommand) { - this.key = key; - this.filterCommand = filterCommand; - } - - public DataGridFilter(String key, - String filterName, - Command filterCommand) { - this.key = key; - this.filterCommand = filterCommand; - } - - public String getKey() { - return key; - } - - public void setKey(String key) { - this.key = key; - } - - public Command getFilterCommand() { - return filterCommand; - } - - public void setFilterCommand(Command filterCommand) { - this.filterCommand = filterCommand; - } - - @Override - public int compareTo(Object o) { - if (!(o instanceof DataGridFilter)) { - return 0; - } - DataGridFilter otherFilter = (DataGridFilter) o; - if (key != null && key.trim().equals(otherFilter.getKey())) { - return 0; - } else { - return -1; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.java deleted file mode 100644 index c4ef20dd205..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.java +++ /dev/null @@ -1,216 +0,0 @@ -/* - * Copyright 2019 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.dom.client.Style; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.HasWidgets; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.AbstractDataProvider; -import com.google.gwt.view.client.ProvidesKey; -import org.gwtbootstrap3.client.ui.Column; -import org.gwtbootstrap3.extras.select.client.ui.Select; -import org.uberfire.ext.widgets.table.client.UberfireSimplePager; -import org.uberfire.ext.widgets.table.client.resources.UFTableResources; - -/** - * Paged Table Widget that stores user preferences. - * If you doesn't need persist the preferences, - * take a look at UberfirePagedTable. - */ -public class PagedTable - extends SimpleTable { - - public static final int DEFAULT_PAGE_SIZE = 10; - public static final int HEIGHT_OFFSET_PX = 20; - private static Binder uiBinder = GWT.create(Binder.class); - - @UiField - public UberfireSimplePager pager; - - @UiField - public Select pageSizesSelector; - - @UiField - public Column dataGridContainer; - - @UiField - public Column topToolbar; - - protected boolean showPageSizesSelector = false; - private int pageSize; - private AbstractDataProvider dataProvider; - private boolean dataGridMinWidthEnabled = false; - - public PagedTable() { - this(DEFAULT_PAGE_SIZE); - } - - public PagedTable(final int pageSize) { - this(pageSize, - null); - } - - - public PagedTable(final int pageSize, - final ProvidesKey providesKeys) { - this(pageSize, - providesKeys, - false); - } - - public PagedTable(final int pageSize, - final ProvidesKey providesKey, - final boolean showPageSizesSelector) { - - this(pageSize, - providesKey, - showPageSizesSelector, - false, - false); - } - - public PagedTable(final int pageSize, - final ProvidesKey providesKey, - final boolean showPageSizesSelector, - final boolean showFFButton, - final boolean showLButton) { - super(providesKey); - this.showPageSizesSelector = showPageSizesSelector; - this.pageSize = pageSize; - this.dataGrid.setPageStart(0); - this.dataGrid.setPageSize(pageSize); - this.pager.setDisplay(dataGrid); - this.pageSizesSelector.setVisible(this.showPageSizesSelector); - setShowFastFordwardPagerButton(showFFButton); - setShowLastPagerButton(showLButton); - this.pageSizesSelector.addValueChangeHandler(event -> { - storePageSizeInGridPreferences(Integer.parseInt(pageSizesSelector.getValue())); - loadPageSizePreferences(); - }); - loadPageSizePreferences(); - - dataGrid.addRedrawHandler(() -> Scheduler.get().scheduleDeferred(() -> setTableHeight())); - dataGrid.getElement().getStyle().setMarginBottom(0, - Style.Unit.PX); - } - - protected static native int getTableHeight(final JavaScriptObject grid, - final String headerCss, - final String contentCss)/*-{ - var headerHeight = $wnd.jQuery(grid).find("." + headerCss).outerHeight(); - var contentHeight = $wnd.jQuery(grid).find("." + contentCss).outerHeight(); - return headerHeight + contentHeight; - }-*/; - - @Override - protected Widget makeWidget() { - return uiBinder.createAndBindUi(this); - } - - public AbstractDataProvider getDataProvider() { - return dataProvider; - } - - public void setDataProvider(final AbstractDataProvider dataProvider) { - this.dataProvider = dataProvider; - this.dataProvider.addDataDisplay(this); - } - - public int getPageSize() { - return this.pageSize; - } - - public int getPageStart() { - return this.pager.getPageStart(); - } - - public final void loadPageSizePreferences() { - pageSize = getPageSizeStored(); - this.dataGrid.setPageStart(0); - this.dataGrid.setPageSize(pageSize); - this.pager.setPageSize(pageSize); - this.pageSizesSelector.setValue(String.valueOf(pageSize)); - setTableHeight(); - } - - protected void setTableHeight() { - int base = getTableHeight(dataGrid.getElement(), - UFTableResources.INSTANCE.CSS().dataGridHeader(), - UFTableResources.INSTANCE.CSS().dataGridContent()); - String height = (base + HEIGHT_OFFSET_PX) + "px"; - if (height.equals(dataGrid.getElement().getStyle().getHeight()) == false) { - this.dataGrid.setHeight(height); - this.dataGrid.redraw(); - } - if (isDataGridMinWidthEnabled()) { - dataGridContainer.getElement().setAttribute("style", "min-width:" + super.columnPicker.getDataGridMinWidth() + Style.Unit.PX.getType()); - } - } - - public boolean isDataGridMinWidthEnabled() { - return dataGridMinWidthEnabled; - } - - public void enableDataGridMinWidth(boolean enabled) { - this.dataGridMinWidthEnabled = enabled; - } - - public void setDefaultColumWidthSize(int defaultColumWidthSize) { - super.columnPicker.setDefaultColumnWidthSize(defaultColumWidthSize); - } - - public void setShowLastPagerButton(boolean showLastPagerButton) { - this.pager.setShowLastPageButton(showLastPagerButton); - } - - public void setShowFastFordwardPagerButton(boolean showFastFordwardPagerButton) { - this.pager.setShowFastFordwardPageButton(showFastFordwardPagerButton); - } - - private void storePageSizeInGridPreferences(int pageSize) { - this.pageSize = pageSize; - } - - private int getPageSizeStored() { - return pageSize; - } - - public void setPageSizesSelectorDropup(boolean forceDropup, - boolean dropupAuto) { - this.pageSizesSelector.setForceDropup(forceDropup); - this.pageSizesSelector.setDropupAuto(dropupAuto); - } - - public HasWidgets getTopToolbar() { - return topToolbar; - } - - protected void setColumnPicker(ColumnPicker columnPicker) { - super.columnPicker = columnPicker; - } - - interface Binder - extends - UiBinder { - - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.ui.xml deleted file mode 100644 index 79540ab2d36..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PagedTable.ui.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - - - .pagedTableContainer { - padding-top: 10px; - padding-bottom: 10px; - } - - .leftToolBar { - float: left; - text-align: left - } - - .rightToolBar { - display: inline; - text-align: right; - } - - .centerToolBar { - text-align: center - } - - .pager { - margin: 0px; - } - - .pager td { - padding-top: 0px; - } - - .pager-row { - padding-top: 5px; - } - - .dataGridContainer { - overflow: auto; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PopoverTextCell.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PopoverTextCell.java deleted file mode 100644 index 6ed1164a874..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/PopoverTextCell.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2015 JBoss Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.common.base.Strings; -import com.google.gwt.cell.client.AbstractSafeHtmlCell; -import com.google.gwt.cell.client.ValueUpdater; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.NativeEvent; -import com.google.gwt.dom.client.Style; -import com.google.gwt.safehtml.shared.SafeHtml; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.text.shared.SimpleSafeHtmlRenderer; -import com.google.gwt.user.client.DOM; -import org.uberfire.ext.widgets.common.client.resources.CommonCss; -import org.uberfire.ext.widgets.common.client.resources.CommonResources; - -import static com.google.gwt.dom.client.BrowserEvents.MOUSEOUT; -import static com.google.gwt.dom.client.BrowserEvents.MOUSEOVER; - -/** - * An extension to the normal TextCell that renders a Bootstrap Popover when text overflows. - */ -public class PopoverTextCell extends AbstractSafeHtmlCell { - - protected static final CommonCss CSS = CommonResources.INSTANCE.CSS(); - - private Placement placement; - - public PopoverTextCell(final Placement placement) { - super(SimpleSafeHtmlRenderer.getInstance(), - MOUSEOVER, - MOUSEOUT); - this.placement = placement; - } - - public PopoverTextCell() { - this(Placement.AUTO); - } - - @Override - protected void render(Context context, - SafeHtml data, - SafeHtmlBuilder sb) { - hideAllPopover(); - final String content = data.asString(); - if (Strings.isNullOrEmpty(content)) { - return; - } - - final Element div = DOM.createDiv(); - div.setId(DOM.createUniqueId()); - div.setInnerHTML(content); - div.getStyle().setOverflow(Style.Overflow.HIDDEN); - div.getStyle().setTextOverflow(Style.TextOverflow.ELLIPSIS); - div.getStyle().setWhiteSpace(Style.WhiteSpace.NOWRAP); - - final String html = div.getString(); - sb.appendHtmlConstant(html); - - Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { - @Override - public void execute() { - initPopover(div.getId(), placement.name().toLowerCase(), CSS.popoverTextBreakWord()); - } - }); - } - - @Override - public void onBrowserEvent(final Context context, - final Element parent, - final String value, - final NativeEvent event, - final ValueUpdater valueUpdater) { - super.onBrowserEvent(context, - parent, - value, - event, - valueUpdater); - - final Element element = Element.as(event.getEventTarget()); - - if (DivElement.is(element) == false) { - return; - } - - if (MOUSEOVER.equals(event.getType())) { - Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { - @Override - public void execute() { - showPopover(parent.getFirstChildElement().getId()); - } - }); - } else if (MOUSEOUT.equals(event.getType())) { - hidePopover(parent.getFirstChildElement().getId()); - } - } - - private native void hideAllPopover() /*-{ - $wnd.jQuery('.popover').popover('hide'); - }-*/; - - private native void hidePopover(String id) /*-{ - $wnd.jQuery('#' + id).popover('hide'); - }-*/; - - private native void showPopover(String id) /*-{ - $wnd.jQuery('#' + id).popover('show'); - }-*/; - - private native void initPopover(String id, String placement, String css) /*-{ - var jQueryId = '#' + id; - var div = $wnd.jQuery(jQueryId); - div.popover({ - trigger: 'manual', - placement: placement, - html: true, - content: function () { - var offsetWidth = $wnd.document.getElementById(id).offsetWidth; - var scrollWidth = $wnd.document.getElementById(id).scrollWidth; - - return offsetWidth < scrollWidth ? "" + div.html() + "" : ""; - }, - container: 'body' - }); - }-*/; - - public enum Placement { - - LEFT, - TOP, - AUTO, - BOTTOM, - RIGHT - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ResizableHeader.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ResizableHeader.java deleted file mode 100644 index 41c2423c4e6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/ResizableHeader.java +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.cell.client.AbstractCell; -import com.google.gwt.cell.client.Cell; -import com.google.gwt.cell.client.Cell.Context; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.NativeEvent; -import com.google.gwt.dom.client.Style.Cursor; -import com.google.gwt.dom.client.Style.Position; -import com.google.gwt.dom.client.Style.Unit; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.user.cellview.client.AbstractCellTable; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.Event.NativePreviewEvent; -import com.google.gwt.user.client.Event.NativePreviewHandler; - -public class ResizableHeader extends Header { - - private static final int width = 20; - private Column column = null; - private AbstractCellTable cellTable; - private String title = ""; - - public ResizableHeader(String title, - AbstractCellTable cellTable, - Column column) { - super(new HeaderCell()); - this.title = title; - this.cellTable = cellTable; - this.column = column; - } - - @Override - public String getValue() { - return title; - } - - @Override - public void onBrowserEvent(Context context, - Element target, - NativeEvent event) { - String eventType = event.getType(); - if (eventType.equals("mousemove")) { - new ColumnResizeHelper(cellTable, - column, - target); - } else { - return; - } - } - - private void setCursor(Element element, - Cursor cursor) { - element.getStyle().setCursor(cursor); - } - - static class HeaderCell extends AbstractCell { - - public HeaderCell() { - super("click", - "mousedown", - "mousemove", - "dblclick"); - } - - @Override - public void render(Context context, - String value, - SafeHtmlBuilder sb) { - sb.append(SafeHtmlUtils.fromString(value)); - } - } - - class ColumnResizeHelper implements NativePreviewHandler { - - private HandlerRegistration handler; - private AbstractCellTable table; - private Column col; - private Element el; - private boolean mousedown; - private Element measuringElement; - - public ColumnResizeHelper(AbstractCellTable table, - Column col, - Element el) { - this.el = el; - this.table = table; - this.col = col; - handler = Event.addNativePreviewHandler(this); - } - - @SuppressWarnings("unchecked") - @Override - public void onPreviewNativeEvent(NativePreviewEvent event) { - NativeEvent nativeEvent = event.getNativeEvent(); - nativeEvent.preventDefault(); - nativeEvent.stopPropagation(); - - String eventType = nativeEvent.getType(); - int clientX = nativeEvent.getClientX(); - if (eventType.equals("mousemove") && mousedown) { - int absoluteLeft = el.getAbsoluteLeft(); - int newWidth = clientX - absoluteLeft; - newWidth = newWidth < width ? width : newWidth; - table.setColumnWidth(col, - newWidth + "px"); - return; - } - - if (eventType.equals("mousemove") || eventType.equals("mousedown")) { - Element eventTargetEl = nativeEvent.getEventTarget().cast(); - int absoluteLeft = eventTargetEl.getAbsoluteLeft(); - int offsetWidth = eventTargetEl.getOffsetWidth(); - if (clientX > absoluteLeft + offsetWidth - width) { - if (eventType.equals("mousedown")) { - mousedown = true; - } else { - setCursor(el, - Cursor.COL_RESIZE); - } - } else { - removeHandler(); - return; - } - } else if (eventType.equals("mouseup")) { - mousedown = false; - } else if (eventType.equals("mouseout") && !mousedown) { - removeHandler(); - return; - } - - if (eventType.equals("dblclick")) { - // Get column - nativeEvent.preventDefault(); - nativeEvent.stopPropagation(); - double max = 0; - startMeasuring(); - for (E t : table.getVisibleItems()) { - Object value = col.getValue(t); - SafeHtmlBuilder sb = new SafeHtmlBuilder(); - Cell cell = (Cell) col.getCell(); - cell.render(null, - value, - sb); - max = Math.max(measureText(sb.toSafeHtml().asString()), - max); - } - finishMeasuring(); - table.setColumnWidth(col, - (max + width) + "px"); - removeHandler(); - } - } - - private void removeHandler() { - handler.removeHandler(); - setCursor(el, - Cursor.DEFAULT); - } - - private void startMeasuring() { - Document document = Document.get(); - measuringElement = document.createElement("div"); - measuringElement.getStyle().setPosition(Position.ABSOLUTE); - measuringElement.getStyle().setLeft(-1000, - Unit.PX); - measuringElement.getStyle().setTop(-1000, - Unit.PX); - document.getBody().appendChild(measuringElement); - } - - private double measureText(String text) { - measuringElement.setInnerHTML(text); - return measuringElement.getOffsetWidth(); - } - - private void finishMeasuring() { - Document.get().getBody().removeChild(measuringElement); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SelectionColumn.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SelectionColumn.java deleted file mode 100644 index 0972b72b210..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SelectionColumn.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.cell.client.CheckboxCell; -import com.google.gwt.cell.client.FieldUpdater; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.user.cellview.client.Column; -import org.gwtbootstrap3.client.ui.gwt.DataGrid; - -public class SelectionColumn extends Column { - - private final DataGrid dataGrid; - - public SelectionColumn(DataGrid dataGrid) { - super(new CheckboxCell(true, - true)); - this.dataGrid = dataGrid; - addUpdater(); - } - - public static SelectionColumn createAndAddSelectionColumn(DataGrid dataGrid) { - SelectionColumn selectionColumn = new SelectionColumn(dataGrid); - dataGrid.addColumn(selectionColumn, - SafeHtmlUtils.fromSafeConstant("
        ")); - return selectionColumn; - } - - private void addUpdater() { - setFieldUpdater(new FieldUpdater() { - public void update(int index, - T object, - Boolean value) { - dataGrid.getSelectionModel().setSelected(object, - value); - } - }); - } - - public Boolean getValue(T object) { - return dataGrid.getSelectionModel().isSelected(object); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.java deleted file mode 100644 index 05502eb6a97..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.ProvidesKey; -import org.uberfire.ext.widgets.table.client.ColumnChangedHandler; -import org.uberfire.ext.widgets.table.client.UberfireSimpleTable; - -/** - * A composite Widget that shows rows of data (not-paged) and a "column picker" - * to allow columns to be hidden from view. Columns can also be sorted. - * User preferences are persisted. If you need a client only version - * of this widget take a look at UberfireSimpleTable. - */ -public class SimpleTable - extends UberfireSimpleTable { - - private static Binder uiBinder = GWT.create(Binder.class); - private boolean persistPreferencesOnChange = true; - - public SimpleTable() { - super(); - } - - public SimpleTable(final ProvidesKey providesKey) { - - super(providesKey); - } - - public void setPersistPreferencesOnChange(boolean persistPreferencesOnChange) { - this.persistPreferencesOnChange = persistPreferencesOnChange; - } - - public boolean isPersistingPreferencesOnChange() { - return persistPreferencesOnChange; - } - - protected void setupColumnPicker() { - columnPicker = new ColumnPicker(dataGrid); - - columnPicker.addColumnChangedHandler(new ColumnChangedHandler() { - - @Override - public void beforeColumnChanged() {} - - @Override - public void afterColumnChanged() { - afterColumnChangedHandler(); - } - }); - } - - protected Widget makeWidget() { - return uiBinder.createAndBindUi(this); - } - - protected ColumnPicker getColumnPicker() { - return (ColumnPicker) columnPicker; - } - - interface Binder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.ui.xml deleted file mode 100644 index da396c3d563..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SimpleTable.ui.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - .dataGridContainer { - padding-top: 10px; - padding-bottom: 10px; - } - - .horizontalContainer { - height: 32px; - } - - .rightToolBar { - float: right; - text-align: right; - } - - .centerToolBar { - text-align: center - } - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortDirection.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortDirection.java deleted file mode 100644 index c936cbbb857..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortDirection.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -public enum SortDirection { - - NONE, - ASCENDING, - DESCENDING -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeader.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeader.java deleted file mode 100644 index 5015da4ad2c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeader.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.cell.client.Cell; -import com.google.gwt.cell.client.ClickableTextCell; -import com.google.gwt.cell.client.ValueUpdater; -import com.google.gwt.resources.client.ImageResource; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; -import com.google.gwt.user.client.ui.AbstractImagePrototype; -import org.uberfire.ext.widgets.common.client.resources.CommonResources; - -/** - * Based on GWT bikeshed example. - */ -public class SortableHeader extends Header { - - private static final String DOWN_ARROW = makeImage(CommonResources.INSTANCE.images().downArrow()); - private static final String SMALL_DOWN_ARROW = makeImage(CommonResources.INSTANCE.images().smallDownArrow()); - private static final String UP_ARROW = makeImage(CommonResources.INSTANCE.images().upArrow()); - private static final String SMALL_UP_ARROW = makeImage(CommonResources.INSTANCE.images().smallUpArrow()); - private final SortableHeaderGroup sortableHeaderGroup; - private final Column column; - private String text; - private SortDirection sortDirection = SortDirection.NONE; - private int sortIndex = -1; - public SortableHeader(SortableHeaderGroup sortableHeaderGroup, - String text, - Column column) { - super(new ClickableTextCell()); - this.sortableHeaderGroup = sortableHeaderGroup; - this.text = text; - this.column = column; - setUpdater(new ValueUpdater() { - public void update(String s) { - SortableHeader.this.sortableHeaderGroup.headerClicked(SortableHeader.this); - } - }); - } - - private static String makeImage(ImageResource resource) { - AbstractImagePrototype prototype = AbstractImagePrototype.create(resource); - return prototype.getHTML(); - } - - /** - * @return the header label - */ - public String getValue() { - return text; - } - - /** - * Set the Column header - * @param text - */ - public void setValue(String text) { - this.text = text; - } - - public Column getColumn() { - return column; - } - - public SortDirection getSortDirection() { - return sortDirection; - } - - public void setSortDirection(SortDirection sortDirection) { - this.sortDirection = sortDirection; - } - - public int getSortIndex() { - return sortIndex; - } - - public void setSortIndex(int sortIndex) { - this.sortIndex = sortIndex; - } - - @Override - public void render(Cell.Context context, - SafeHtmlBuilder sb) { - sb.appendHtmlConstant("
        "); - sb.appendHtmlConstant(""); - sb.appendEscaped(text); - sb.appendHtmlConstant(""); - // sb.appendHtmlConstant("
        "); - switch (sortDirection) { - case NONE: - // nothing - break; - case ASCENDING: - sb.appendHtmlConstant(sortIndex == 0 ? UP_ARROW : SMALL_UP_ARROW); - break; - case DESCENDING: - sb.appendHtmlConstant(sortIndex == 0 ? DOWN_ARROW : SMALL_DOWN_ARROW); - break; - default: - throw new IllegalArgumentException("Unknown sortDirection (" - + sortDirection - + ")."); - } - sb.appendHtmlConstant("
        "); - // sb.appendHtmlConstant("
        "); - // sb.appendHtmlConstant("
        "); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeaderGroup.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeaderGroup.java deleted file mode 100644 index 71c64189cc9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/SortableHeaderGroup.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.LinkedList; -import java.util.List; - -import org.gwtbootstrap3.client.ui.gwt.DataGrid; - -public class SortableHeaderGroup { - - private final DataGrid dataGrid; - // TODO change List into Deque after upgrade to java 6 - private List> sortOrderList = new LinkedList>(); - - public SortableHeaderGroup(DataGrid dataGrid) { - this.dataGrid = dataGrid; - } - - public void headerClicked(SortableHeader header) { - updateSortOrder(header); - dataGrid.redrawHeaders(); - updateData(); - } - - private void updateSortOrder(SortableHeader header) { - int index = sortOrderList.indexOf(header); - if (index == 0) { - if (header.getSortDirection() != SortDirection.ASCENDING) { - header.setSortDirection(SortDirection.ASCENDING); - } else { - header.setSortDirection(SortDirection.DESCENDING); - } - } else { - // Remove it if it's already sorted on this header later - if (index > 0) { - sortOrderList.remove(index); - } - header.setSortDirection(SortDirection.ASCENDING); - // Bring this header to front // Deque.addFirst(sortableHeader) - sortOrderList.add(0, - header); - // Update sortIndexes - int sortIndex = 0; - for (SortableHeader sortableHeader : sortOrderList) { - sortableHeader.setSortIndex(sortIndex); - sortIndex++; - } - } - } - - private void updateData() { - // TODO If paging is used, this should be a back-end call with a sorting meta data parameter - List displayedItems = new ArrayList(dataGrid.getDisplayedItems()); - Collections.sort(displayedItems, - new Comparator() { - public int compare(T leftRow, - T rightRow) { - for (SortableHeader sortableHeader : sortOrderList) { - Comparable leftColumnValue = sortableHeader.getColumn().getValue(leftRow); - Comparable rightColumnValue = sortableHeader.getColumn().getValue(rightRow); - int comparison = (leftColumnValue == rightColumnValue) ? 0 - : (leftColumnValue == null) ? -1 - : (rightColumnValue == null) ? 1 - : leftColumnValue.compareTo(rightColumnValue); - if (comparison != 0) { - switch (sortableHeader.getSortDirection()) { - case ASCENDING: - break; - case DESCENDING: - comparison = -comparison; - break; - default: - throw new IllegalStateException("Sorting can only be enabled for ASCENDING or" + - " DESCENDING, not sortDirection (" + sortableHeader.getSortDirection() + ") ."); - } - return comparison; - } - } - return leftRow.compareTo(rightRow); - } - }); - dataGrid.setRowData(0, - displayedItems); - dataGrid.redraw(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java deleted file mode 100644 index 0f7aa17e7ab..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.cell.client.AbstractSafeHtmlCell; -import com.google.gwt.safehtml.shared.SafeHtml; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.text.shared.SafeHtmlRenderer; -import org.uberfire.ext.widgets.common.client.resources.CommonCss; -import org.uberfire.ext.widgets.common.client.resources.CommonResources; - -/** - * An extension to the normal TextCell that renders upto two rows of text; one - * being the title and the other being narrative. - */ -public class TitledTextCell extends AbstractSafeHtmlCell { - - protected static final CommonCss css = CommonResources.INSTANCE.CSS(); - - /** - * Constructs a TitledTextCell that uses a - * {@link TitledTextSafeHtmlRenderer} to render its text. - */ - public TitledTextCell() { - super(TitledTextSafeHtmlRenderer.getInstance()); - } - - /** - * Constructs a TextCell that uses the provided {@link SafeHtmlRenderer} to - * render its text. - * @param renderer a {@link SafeHtmlRenderer SafeHtmlRenderer} instance - */ - public TitledTextCell(final SafeHtmlRenderer renderer) { - super(renderer); - } - - @Override - public void render(Context context, - SafeHtml value, - SafeHtmlBuilder sb) { - if (value != null) { - sb.append(value); - } - } - - /** - * Container for the Cell value; consisting of title and description - */ - public static class TitledText - implements - Comparable { - - private String title; - private String description; - - public TitledText(String title, - String description) { - this.title = title; - this.description = description; - } - - public String getTitle() { - return title; - } - - public String getDescription() { - return description; - } - - public int compareTo(TitledText o) { - return title.compareTo(o.title); - } - } - - /** - * A renderer for TitledText values - */ - public static class TitledTextSafeHtmlRenderer - implements - SafeHtmlRenderer { - - // Singleton - private static TitledTextSafeHtmlRenderer instance; - - private TitledTextSafeHtmlRenderer() { - } - - public static TitledTextSafeHtmlRenderer getInstance() { - if (instance == null) { - instance = new TitledTextSafeHtmlRenderer(); - } - return instance; - } - - public SafeHtml render(TitledText object) { - boolean bHasDescription = object.description != null && !"".equals(object.description); - - if (bHasDescription) { - String html = "
        "; - html = html + "
        " + object.title + "
        "; - html = html + "
        " + object.description + "
        "; - html = html + "
        "; - return SafeHtmlUtils.fromTrustedString(html); - } else { - String html = "
        "; - html = html + "
        " + object.title + "
        "; - html = html + "
        "; - return SafeHtmlUtils.fromTrustedString(html); - } - } - - public void render(TitledText object, - SafeHtmlBuilder builder) { - builder.append(render(object)); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextColumn.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextColumn.java deleted file mode 100644 index b6fb752f655..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextColumn.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.user.cellview.client.Column; - -/** - * A column containing TitleText cells - * @param - */ -public abstract class TitledTextColumn extends Column { - - /** - * Construct a new TitledTextColumn. - */ - public TitledTextColumn() { - super(new TitledTextCell()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index 68590395344..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/beans.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/beans.xml deleted file mode 100644 index cdff79efec6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/UberfireWidgetsCommons.gwt.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/UberfireWidgetsCommons.gwt.xml deleted file mode 100644 index 304c09f53cc..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/UberfireWidgetsCommons.gwt.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/css/common.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/css/common.css deleted file mode 100644 index 5ffc6c5de8b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/css/common.css +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -@sprite .whiteTopLeftCornerClass { - gwt-image: "images.whiteTopLeftCorner"; - height: 4px; - width: 4px; -} - -@sprite .whiteTopRightCornerClass { - gwt-image: "images.whiteTopRightCorner"; - height: 4px; - width: 4px; -} - -@sprite .whiteBottomLeftCornerClass { - gwt-image: "images.whiteBottomLeftCorner"; - height: 4px; - width: 4px; -} - -@sprite .whiteBottomRightCornerClass { - gwt-image: "images.whiteBottomRightCorner"; - height: 4px; - width: 4px; -} - -.whiteBottomClass { - border-bottom: 1px solid #bbbbbb; - height: 3px; - width: 100%; -} - -.whiteTopClass { - border-top: 1px solid #bbbbbb; - height: 3px; - width: 100%; -} - -.whiteSideLeftClass { - border-left: 1px solid #bbbbbb; - height: 100%; - width: 3px; -} - -.whiteSideRightClass { - border-right: 1px solid #bbbbbb; - height: 100%; - width: 3px; -} - -.whiteCenterClass { -} - -@sprite .greyTopLeftCornerClass { - gwt-image: "images.greyTopLeftCorner"; - height: 4px; - width: 4px; -} - -@sprite .greyTopRightCornerClass { - gwt-image: "images.greyTopRightCorner"; - height: 4px; - width: 4px; -} - -@sprite .greyBottomLeftCornerClass { - gwt-image: "images.greyBottomLeftCorner"; - height: 4px; - width: 4px; -} - -@sprite .greyBottomRightCornerClass { - gwt-image: "images.greyBottomRightCorner"; - height: 4px; - width: 4px; -} - -@sprite .greyBottomClass { - gwt-image: "images.greyBottom"; - height: 4px; - width: 100%; -} - -@sprite .greyTopClass { - gwt-image: "images.greyTop"; - height: 4px; - width: 100%; -} - -@sprite .greySideLeftClass { - gwt-image: "images.greySideLeft"; - height: 100%; - width: 4px; -} - -@sprite .greySideRightClass { - gwt-image: "images.greySideRight"; - height: 100%; - width: 4px; -} - -.greyCenterClass { - background: #e3e3e3; -} - -.clean-textarea { - border: none !important; - width: 95%; -} - -.busy-popup { - width: 300px; -} - -.busy-popup span { - padding-left: 15px; - vertical-align: text-top; -} - -@external .spinner; - -.busy-popup .spinner { - margin-top: -3px; -} - -.titleTextCellContainer { - height: 32px; - vertical-align: middle; - display: table-cell; -} - -.titleTextCellDescription { - font-size: smaller; - font-style: italic; -} - -.dataGrid td div { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.dataGridHeader { -} - -.dataGridHeader thead th { - overflow: hidden; - text-overflow: ellipsis; -} - -.dataGridContent { - border-top: none; -} - -.dataGridRow:first-child td { - border-top: none; -} - -.columnPickerPopup { - background-color: #ffffff; - padding: 5px; - border: 1px solid #d1d1d1; - z-index: 2000; -} - -@external .checkbox; - -.columnPickerPopup .checkbox { - margin-top: 2px; - margin-bottom: 2px; -} - -.columnPickerButton { -} - -/* Styles prefixed with uf- are not obfuscated and can be overridden in application stylesheets. */ -@external .btn-file; - -.btn-file { - position: relative; - overflow: hidden; -} - -.btn-file input[type="file"] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 999px; - text-align: right; - filter: literal("alpha(opacity=0)"); - opacity: 0; - outline: none; - background: white; - cursor: inherit; - display: block; -} - -.btn-file > i + span { - padding-left: 2px; -} - -.btn-file > span + i { - padding-left: 2px; -} - -.popoverTextBreakWord { - overflow-wrap: break-word; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.properties deleted file mode 100644 index 4b454a9acb1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants.properties +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -OK=Ok -YES=Yes -NO=No -Information=Information -Close=Close -Error=Error -Warning=Warning -ShowDetail=Show detail -AbstractTableOpen=Open -AbstractTablePleaseSelectAnItemToDelete=Please select one or more items to delete. -AbstractTableRefreshList=Refresh list -AbstractTableOpenSelected=Open selected -AbstractTableFileURI=URI -ReOpen=Re-open -Ignore=Ignore -ForceSave=Force Save -Cancel=Cancel -ConcurrentIssue=Concurrent issue -ConcurrentUpdate=User {0} has updated the following resource {1}. -ConcurrentRename=User {0} has renamed the following resource {1} to {2}. -ConcurrentDelete=User {0} has deleted the following resource {1}. -ChooseFile=Choose File... -Upload=Upload -More=More... -Active=Active: -ExceptionInvalidPath=Path is invalid. -ExceptionFileAlreadyExists0=File "{0}" already exists. -ExceptionNoSuchFile0=File "{0}" could not be found. -ExceptionSecurity0=Insufficient permissions for "{0}". -ExceptionGeneric0=Unable to complete your request. The following exception occurred: {0}. -ItemDeletedSuccessfully=Item successfully deleted. -DeletePopupTitle=Delete this item -DeletePopupDelete=Delete item -Version=Version -Items=Items -ColorPickerTitle=Select Color -Add_New_Filter=Add new filter -Filter_parameters=Filter parameters -Filter_Name=Filter name -Filter_Must_Have_A_Name=Filter must have a name -Filter_Management=Filter Management -RemoveFilter=Remove filter -CustomFilters=Custom filters -NoCustomFilterAvailable= No custom filter available -Refresh=Refresh -ColumnPickerButtonTooltip=Show/hide columns -PageSizeSelectorTooltip=Select table page size -Reset=Reset -Actions=Actions -Basic_Properties=Basic properties -ClickToDisplay0=Click to show/hide {0} -RemoveTabTitle=Remove tab -RemoveTabConfirm=Are you sure you want to remove tab {0}? -AutoRefresh=Auto Refresh -Disable_autorefresh=Disable auto refresh -Autorefresh_Disabled=Auto refresh Disabled -Minutes=Minutes -Minute=Minute -liveSearchHint =Search items ... -liveSearchSelectorHint =- Select - -liveSearchNotFoundMessage =No items found -liveSearchElementsSelected={0} elements selected -liveSearchNewEntry=New -liveSearchClearSelectionMessage=Clear Selection -liveSearchResetSelectionMessage=Reset -PerspectiveSelectHint=- Select Page - -PerspectiveSearchHint=Search Page... -PerspectiveNotFound=Page not found -by=by -on=on \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_de.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_de.properties deleted file mode 100644 index cbac20a6f7f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_de.properties +++ /dev/null @@ -1,58 +0,0 @@ -OK=Ok -YES=Ja -NO=Nein -Information=Information -Close=Schließen -Error=Fehler -Warning=Warnung -ShowDetail=Details anzeigen -AbstractTableOpen=Öffnen -AbstractTablePleaseSelectAnItemToDelete=Bitte wählen Sie ein oder mehrere zu löschende Elemente aus -AbstractTableRefreshList=Liste neu laden -AbstractTableOpenSelected=Auswahl öffnen -AbstractTableFileURI=URI -ReOpen=Erneut öffnen -Ignore=Ignorieren -ForceSave=Speichern erzwingen -Cancel=Abbrechen -ConcurrentIssue=Nebenläufiges Problem -ConcurrentUpdate=Benutzer {0} hat die folgende Ressource {1} aktualisiert. -ConcurrentRename=Benutzer {0} hat die folgende Ressource {1} in {2} umbenannt. -ConcurrentDelete=Benutzer {0} hat die folgende Ressource {1} gelöscht. -ChooseFile=Datei wählen... -Upload=Hochladen -More=Mehr... -Active=Aktiv\: -ExceptionInvalidPath=Pfad ist ungültig. -ExceptionFileAlreadyExists0=Datei "{0}" bereits vorhanden. -ExceptionNoSuchFile0=Datei "{0}" nicht gefunden. -ExceptionSecurity0=Unzureichende Berechtigungen für "{0}". -ExceptionGeneric0=Ihre Anfrage kann nicht ausgeführt werden. Die folgende Ausnahme ist aufgetreten\: {0}. -ItemDeletedSuccessfully=Element erfolgreich gelöscht. -DeletePopupTitle=Dieses Element löschen -DeletePopupDelete=Element löschen -Version=Version -Items=Posten -ColorPickerTitle=Farbe auswählen -Add_New_Filter=Neuen Filter hinzufügen -Filter_parameters=Filterparameter -Filter_Name=Filtername -Filter_Must_Have_A_Name=Filter muss einen Namen haben -Filter_Management=Filter Management -RemoveFilter=Filter entfernen -CustomFilters=Benutzerdefinierter Filter -NoCustomFilterAvailable=Kein benutzerdefinierter Filter verfügbar -Refresh=Aktualisieren -ColumnPickerButtonTooltip=Spalten einblenden/ausblenden -PageSizeSelectorTooltip=Größe der Tabellenseite auswählen -Reset=Zurücksetzen -Actions=Aktionen -Basic_Properties=Grundlegende Eigenschaften -ClickToDisplay0=Zum Einblenden/Ausblenden von {0} hier klicken -RemoveTabTitle=Registerkarte entfernen -RemoveTabConfirm=Sind Sie sicher, dass Sie Registerkarte {0} entfernen möchten? -AutoRefresh=Auto-Refresh -Disable_autorefresh=Auto-Refresh deaktivieren -Autorefresh_Disabled=Auto-Refresh deaktiviert -Minutes=Minuten -Minute=Minute diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_es.properties deleted file mode 100644 index 426c9eadcfb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_es.properties +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -OK=Aceptar -YES=Sí -NO=No -Information=Información -Close=Cerrar -Error=Error -Warning=Advertencia -ShowDetail=Mostrar detalle -AbstractTableOpen=Abrir -AbstractTablePleaseSelectAnItemToDelete=Seleccione uno o más ítems para eliminarlos. -AbstractTableRefreshList=Actualizar la lista -AbstractTableOpenSelected=Abrir seleccionado -AbstractTableFileURI=URI -ReOpen=Volver a abrir -Ignore=Ignorar -ForceSave=Forzar guardado -Cancel=Cancelar -ConcurrentIssue=Problema simultáneo -ConcurrentUpdate=El usuario {0} ha actualizado el siguiente recurso {1}. -ConcurrentRename=El usuario {0} ha cambiado el nombre del siguiente recurso de {1} a {2}. -ConcurrentDelete=El usuario {0} ha eliminado el siguiente recurso {1}. -ChooseFile=Elegir archivo… -Upload=Cargar -More=Más… -Active=Activo: -ExceptionInvalidPath=La ruta no es válida. -ExceptionFileAlreadyExists0=El archivo "{0}" ya existe. -ExceptionNoSuchFile0=No se encuentra el archivo "{0}". -ExceptionSecurity0=No hay suficientes permisos para "{0}". -ExceptionGeneric0=No se puede completar su solicitud. Se produjo la siguiente excepción: {0}. -ItemDeletedSuccessfully=El ítem se eliminó correctamente. -DeletePopupTitle=Eliminar este ítem -DeletePopupDelete=Eliminar ítem -Version=Versión -Items=Ítems -ColorPickerTitle=Seleccionar el color -Add_New_Filter=Agregar nuevo filtro -Filter_parameters=Parámetros de filtro -Filter_Name=Nombre de filtro -Filter_Must_Have_A_Name=El filtro debe tener un nombre -Filter_Management=Gestión de filtros -RemoveFilter=Quitar filtro -CustomFilters=Filtros personalizados -NoCustomFilterAvailable= No hay un filtro personalizado disponible -Refresh=Actualizar -ColumnPickerButtonTooltip=Mostrar/ocultar columnas -PageSizeSelectorTooltip=Seleccionar el tamaño de la página de la tabla -Reset=Restablecer -Actions=Acciones -Basic_Properties=Propiedades básicas -ClickToDisplay0=Haga clic para mostrar/ocultar {0} -RemoveTabTitle=Quitar la pestaña -RemoveTabConfirm=¿Está seguro de que desea quitar la pestaña {0}? -AutoRefresh=Actualización automática -Disable_autorefresh=Deshabilitar la actualización automática -Autorefresh_Disabled=Actualización automática deshabilitada -Minutes=Minutos -Minute=Minuto -liveSearchHint =Buscar ítems… -liveSearchSelectorHint =- Seleccionar - -liveSearchNotFoundMessage =No se encuentran ítems -liveSearchElementsSelected={0} elementos seleccionados -liveSearchNewEntry=Nuevo -liveSearchClearSelectionMessage=Anular selección -liveSearchResetSelectionMessage=Restablecer -PerspectiveSelectHint=- Seleccionar página - -PerspectiveSearchHint=Buscar página… -PerspectiveNotFound=No se encuentra la página -by=por -on=en \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_fr.properties deleted file mode 100644 index 74944fc809a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_fr.properties +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -OK=OK -YES=Oui -NO=Non -Information=Informations -Close=Fermer -Error=Erreur -Warning=Avertissement -ShowDetail=Afficher les détails -AbstractTableOpen=Ouvrir -AbstractTablePleaseSelectAnItemToDelete=Veuillez sélectionner un ou plusieurs éléments à supprimer. -AbstractTableRefreshList=Rafraîchir la liste -AbstractTableOpenSelected=Ouvrir la sélection -AbstractTableFileURI=URI -ReOpen=Rouvrir -Ignore=Ignorer -ForceSave=Force l’enregistrement -Cancel=Annuler -ConcurrentIssue=Problème simultané -ConcurrentUpdate=L’utilisateur {0} a mis à jour la ressource suivante {1}. -ConcurrentRename=L’utilisateur {0} a renommé la ressource suivante {1} en {2}. -ConcurrentDelete=L’utilisateur {0} a supprimé la ressource suivante {1}. -ChooseFile=Choisir un fichier… -Upload=Envoyer -More=Plus… -Active=Actif : -ExceptionInvalidPath=Le chemin d’accès n''est pas valide. -ExceptionFileAlreadyExists0=Le fichier "{0}" existe déjà. -ExceptionNoSuchFile0=Le fichier "{0}" est introuvable. -ExceptionSecurity0=Autorisations insuffisantes pour "{0}". -ExceptionGeneric0=Impossible de traiter votre demande. L’exception suivante s’est produite : {0}. -ItemDeletedSuccessfully=L’élément a été supprimé. -DeletePopupTitle=Supprimer cet élément -DeletePopupDelete=Supprimer l’élément -Version=Version -Items=Éléments -ColorPickerTitle=Sélectionner une couleur -Add_New_Filter=Ajouter un nouveau filtre -Filter_parameters=Paramètres du filtre -Filter_Name=Nom du filtre -Filter_Must_Have_A_Name=Le filtre doit avoir un nom -Filter_Management=Gestion des filtres -RemoveFilter=Supprimer le filtre -CustomFilters=Filtres personnalisés -NoCustomFilterAvailable= Aucun filtre personnalisé disponible -Refresh=Rafraîchir -ColumnPickerButtonTooltip=Afficher/masquer les colonnes -PageSizeSelectorTooltip=Sélectionner la taille de page du tableau -Reset=Réinitialiser -Actions=Actions -Basic_Properties=Propriétés de base -ClickToDisplay0=Cliquez pour afficher/masquer {0} -RemoveTabTitle=Supprimer l’onglet -RemoveTabConfirm=Voulez-vous vraiment supprimer l’onglet {0} ? -AutoRefresh=Rafraîchissement automatique -Disable_autorefresh=Désactiver le rafraîchissement automatique -Autorefresh_Disabled=Rafraîchissement automatique désactivé -Minutes=Minutes -Minute=Minute -liveSearchHint =Rechercher des éléments… -liveSearchSelectorHint =- Sélectionner - -liveSearchNotFoundMessage =Aucun élément trouvé -liveSearchElementsSelected={0} éléments sélectionnés -liveSearchNewEntry=Nouveau -liveSearchClearSelectionMessage=Effacer la sélection -liveSearchResetSelectionMessage=Réinitialiser -PerspectiveSelectHint=- Sélectionner une page - -PerspectiveSearchHint=Rechercher la page… -PerspectiveNotFound=Page introuvable -by=par -on=sur \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_ja.properties deleted file mode 100644 index 5bb9e0f6137..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_ja.properties +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -OK=OK -YES=はい -NO=いいえ -Information=情報 -Close=閉じる -Error=エラー -Warning=警告 -ShowDetail=詳細を表示 -AbstractTableOpen=開く -AbstractTablePleaseSelectAnItemToDelete=削除する項目を 1 つまたは複数選択してください。 -AbstractTableRefreshList=リストをリフレッシュ -AbstractTableOpenSelected=選択項目を開く -AbstractTableFileURI=URI -ReOpen=再度開く -Ignore=無視 -ForceSave=強制保存 -Cancel=キャンセル -ConcurrentIssue=同時性の問題 -ConcurrentUpdate=ユーザー {0} が次のリース {1} を更新しました。 -ConcurrentRename=ユーザー {0} が次のリソースの名前を {1} から {2}. に変更しました。 -ConcurrentDelete=ユーザー {0} が次のリース {1} を削除しました。 -ChooseFile=ファイルの選択... -Upload=アップロード -More=詳細... -Active=アクティブ: -ExceptionInvalidPath=パスが無効です。 -ExceptionFileAlreadyExists0=ファイル "{0}" はすでに存在します。 -ExceptionNoSuchFile0=ファイル "{0}" はありません。 -ExceptionSecurity0="{0}" のパーミッションが不十分です。 -ExceptionGeneric0=リクエストを完了できません。次の例外が発生しました: {0}。 -ItemDeletedSuccessfully=アイテムが削除されました。 -DeletePopupTitle=このアイテムの削除 -DeletePopupDelete=アイテムを削除 -Version=バージョン -Items=アイテム -ColorPickerTitle=色を選択 -Add_New_Filter=新規フィルターの追加 -Filter_parameters=パラメーターをフィルター -Filter_Name=フィルター名 -Filter_Must_Have_A_Name=フィルターに名前を付ける必要があります -Filter_Management=フィルター管理 -RemoveFilter=フィルターの削除 -CustomFilters=カスタムフィルター -NoCustomFilterAvailable= 使用できるカスタムフィルターがありません -Refresh=更新 -ColumnPickerButtonTooltip=カラムの表示/非表示 -PageSizeSelectorTooltip=テーブルページサイズの選択 -Reset=リセット -Actions=アクション -Basic_Properties=基本プロパティー -ClickToDisplay0=クリックして {0} の表示と非表示を切り替えます -RemoveTabTitle=タブを削除 -RemoveTabConfirm=本当にタブ {0} を削除していいですか? -AutoRefresh=自動更新 -Disable_autorefresh=自動更新を無効化 -Autorefresh_Disabled=自動更新が無効になりました -Minutes=分 -Minute=分 -liveSearchHint =アイテムを検索中 ... -liveSearchSelectorHint =- 選択 - -liveSearchNotFoundMessage =アイテムが見つかりません -liveSearchElementsSelected={0} 個の要素が選択されました -liveSearchNewEntry=新規 -liveSearchClearSelectionMessage=選択のクリア -liveSearchResetSelectionMessage=リセット -PerspectiveSelectHint=- ページの選択 - -PerspectiveSearchHint=ページを検索中... -PerspectiveNotFound=ページが見つかりません -by=更新者 -on=on \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_pt_BR.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_pt_BR.properties deleted file mode 100644 index b786958733d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_pt_BR.properties +++ /dev/null @@ -1,58 +0,0 @@ -OK=Ok -YES=Sim -NO=Não -Information=Informação -Close=Encerrar -Error=Erro -Warning=Aviso -ShowDetail=Apresentar detalhe -AbstractTableOpen=Abrir -AbstractTablePleaseSelectAnItemToDelete=Favor selecionar um ou mais itens para exclusão. -AbstractTableRefreshList=Atualizar a lista -AbstractTableOpenSelected=Abrir selecionado -AbstractTableFileURI=URI -ReOpen=Abrir novamente -Ignore=Ignorar -ForceSave=Forçar o "Salvar" -Cancel=Cancelar -ConcurrentIssue=Problema simultâneo -ConcurrentUpdate=O usuário {0} atualizou o seguinte recurso {1}. -ConcurrentRename=O usuário {0} renomeou o seguinte recurso {1} para {2}. -ConcurrentDelete=O usuário {0} excluiu o seguinte recurso {1}. -ChooseFile=Selecionar Arquivo... -Upload=Carregar -More=Mais... -Active=Ativo\: -ExceptionInvalidPath=O caminho é inválido. -ExceptionFileAlreadyExists0=O arquivo "{0}" já existe. -ExceptionNoSuchFile0=O arquivo "{0}" não pôde ser encontrado. -ExceptionSecurity0=Permissões insuficientes para "{0}". -ExceptionGeneric0=Não foi possível completar sua solicitação. Ocorreu a seguinte exceção\: {0}. -ItemDeletedSuccessfully=Item excluído com sucesso. -DeletePopupTitle=Excluir este item -DeletePopupDelete=Excluir item -Version=Versão -Items=Itens -ColorPickerTitle=Selecionar Cor -Add_New_Filter=Adicionar novo filtro -Filter_parameters=Parâmetros de filtro -Filter_Name=Nome do filtro -Filter_Must_Have_A_Name=O filtro deve ter um nome -Filter_Management=Gerenciamento de Filtros -RemoveFilter=Remover filtro -CustomFilters=Personalizar filtros -NoCustomFilterAvailable=Nenhum filtro personalizado disponível -Refresh=Atualizar -ColumnPickerButtonTooltip=Mostrar/ esconder colunas -PageSizeSelectorTooltip=Selecionar o tamanho da página da tabela -Reset=Restaurar -Actions=Ações -Basic_Properties=Propriedades básicas -ClickToDisplay0=Clique para mostrar/ esconder {0} -RemoveTabTitle=Remover aba -RemoveTabConfirm=Você tem certeza que deseja remover a aba {0} ? -AutoRefresh=Atualizar Automaticamente -Disable_autorefresh=Desabilitar atualização automática -Autorefresh_Disabled=Atualização Automaticamente Desabilitada -Minutes=Minutos -Minute=Minuto diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_zh_CN.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_zh_CN.properties deleted file mode 100644 index 3722d57fafd..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/i18n/CommonConstants_zh_CN.properties +++ /dev/null @@ -1,68 +0,0 @@ -OK=确定 -YES=是 -NO=否 -Information=信息 -Close=关闭 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -Error=错误 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -Warning=警告 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -ShowDetail=查看明细 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -AbstractTableOpen=打开 -AbstractTablePleaseSelectAnItemToDelete=请选择要删除的一个或多个项目 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -AbstractTableRefreshList=刷新列表 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -AbstractTableOpenSelected=打开选中的条目 -AbstractTableFileURI=URI -ReOpen=重新打开 -# auto translated by TM merge from project: JON strings, version: jon33strings, DocId: Messages -Ignore=忽略 -ForceSave=强制保存 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -Cancel=取消 -ConcurrentIssue=并发的问题 -ConcurrentUpdate=用户 {0} 已更新了下列资源 {1}。 -ConcurrentRename=用户 {0} 已将下列资源 {1} 重命名为 {2}。 -ConcurrentDelete=用户 {0} 已删除了下列资源 {1}。 -ChooseFile=选择文件... -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-dtable-xls-editor-client/org/drools/workbench/screens/dtablexls/client/resources/i18n/DecisionTableXLSEditorConstants -Upload=上传 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -More=更多... -Active=活动的: -ExceptionInvalidPath=路径是无效的。 -ExceptionFileAlreadyExists0=文件 "{0}" 已经存在。 -ExceptionNoSuchFile0=未找到 "{0}"。 -ExceptionSecurity0=对 "{0}" 没有足够的权限。 -ExceptionGeneric0=无法完成您的请求,发生了下列异常 {0}。 -ItemDeletedSuccessfully=成功删除了条目。 -DeletePopupTitle=删除这个条目 -DeletePopupDelete=删除条目 -Version=版本 -Items=条目 -ColorPickerTitle=选择颜色 -Add_New_Filter=添加新的过滤器 -Filter_parameters=过滤器参数 -Filter_Name=过滤器名称 -Filter_Must_Have_A_Name=过滤器必须具有名字 -Filter_Management=过滤器管理 -RemoveFilter=删除过滤器 -CustomFilters=自定义过滤器 -NoCustomFilterAvailable=没有可用的自定义过滤器 -Refresh=刷新 -ColumnPickerButtonTooltip=显示/隐藏列 -PageSizeSelectorTooltip=选择表页面大小 -Reset=重置 -Actions=动作 -Basic_Properties=基本属性 -ClickToDisplay0=点击显示/隐藏 {0} -RemoveTabTitle=删除标签页 -RemoveTabConfirm=你确定要删除标签页 {0} 吗? -AutoRefresh=自动刷新 -Disable_autorefresh=禁用自动刷新 -Autorefresh_Disabled=已禁用自动刷新 -Minutes=分 -Minute=分 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/close.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/close.gif deleted file mode 100644 index 2cd9c544436..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/close.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapse.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapse.gif deleted file mode 100644 index a6a44326299..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapse.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapseall.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapseall.gif deleted file mode 100644 index dc923f5e826..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/collapseall.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/columnPicker.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/columnPicker.png deleted file mode 100644 index 6ddaab85ed5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/columnPicker.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottom.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottom.gif deleted file mode 100644 index 9c585b05028..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottom.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomLeftCorner.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomLeftCorner.gif deleted file mode 100644 index 5de2b9633cd..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomLeftCorner.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomRightCorner.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomRightCorner.gif deleted file mode 100644 index 756b602a90e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyBottomRightCorner.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyLeftSide.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyLeftSide.gif deleted file mode 100644 index 5267f2ca36b..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyLeftSide.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyRightSide.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyRightSide.gif deleted file mode 100644 index cbe0ff4002d..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyRightSide.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTop.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTop.gif deleted file mode 100644 index 1847faa8601..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTop.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopLeftCorner.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopLeftCorner.gif deleted file mode 100644 index 7fc7d169cc0..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopLeftCorner.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopRightCorner.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopRightCorner.gif deleted file mode 100644 index 3331066ed84..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/greyTopRightCorner.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomLeft.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomLeft.gif deleted file mode 100644 index 83c0b76d57b..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomLeft.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomRight.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomRight.gif deleted file mode 100644 index cac04b61949..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteBottomRight.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopLeft.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopLeft.gif deleted file mode 100644 index 92fe64e00a5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopLeft.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopRight.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopRight.gif deleted file mode 100644 index e298f754754..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/corners/whiteTopRight.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/downArrow.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/downArrow.png deleted file mode 100644 index fd4012ce0aa..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/downArrow.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expand.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expand.gif deleted file mode 100644 index 2c68e1696d8..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expand.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expandall.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expandall.gif deleted file mode 100644 index c4a67bb21f6..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/expandall.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/information.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/information.gif deleted file mode 100644 index 3679f84ad88..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/information.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item.gif deleted file mode 100644 index 252d7ebcb8c..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item_disabled.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item_disabled.gif deleted file mode 100644 index 7258d809098..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/new_item_disabled.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForward.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForward.png deleted file mode 100644 index b6327acb221..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForward.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForwardDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForwardDisabled.png deleted file mode 100644 index 8f6b5ba763e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFastForwardDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPage.png deleted file mode 100644 index 13a2ba296d3..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPageDisabled.png deleted file mode 100644 index 645d305f2a5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerFirstPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPage.png deleted file mode 100644 index db4f865c95a..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPageDisabled.png deleted file mode 100644 index 72cea52f0bf..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerLastPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPage.png deleted file mode 100644 index a0879b6eca5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPageDisabled.png deleted file mode 100644 index 9f40e9106ba..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerNextPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPage.png deleted file mode 100644 index d4f15a1fa9e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png deleted file mode 100644 index aca6318de1e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallDownArrow.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallDownArrow.png deleted file mode 100644 index 3ba9a5c6765..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallDownArrow.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallUpArrow.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallUpArrow.png deleted file mode 100644 index 978bdb69ce5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/smallUpArrow.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/spinner.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/spinner.gif deleted file mode 100644 index 39a303790c2..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/spinner.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/upArrow.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/upArrow.png deleted file mode 100644 index a3369472fe8..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/upArrow.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/validation_error.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/validation_error.gif deleted file mode 100644 index 58873a11668..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/validation_error.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/warning-large.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/warning-large.png deleted file mode 100644 index 7233d45d8e6..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/images/warning-large.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/parser_rules/advanced_and_extended.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/parser_rules/advanced_and_extended.js deleted file mode 100644 index 8ae6196563b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/parser_rules/advanced_and_extended.js +++ /dev/null @@ -1,680 +0,0 @@ -/** - * Full HTML5 compatibility rule set - * Loosened and extended ruleset. Allows more freedom on user side - * These rules define which tags and CSS classes are supported and which tags should be specially treated. - */ - -var wysihtmlParserRulesDefaults = { - blockLevelEl: { - keep_styles: { - textAlign: /^((left)|(right)|(center)|(justify))$/i, - float: 1, - }, - add_style: { - align: "align_text", - }, - check_attributes: { - id: "any", - }, - }, - - makeDiv: { - rename_tag: "div", - one_of_type: { - alignment_object: 1, - }, - remove_action: "unwrap", - keep_styles: { - textAlign: 1, - float: 1, - }, - add_style: { - align: "align_text", - }, - check_attributes: { - id: "any", - }, - }, -}; - -var wysihtmlParserRules = { - /** - * CSS Class white-list - * Following CSS classes won't be removed when parsed by the wysihtml HTML parser - * If all classes should pass "any" as classes value. Ex: "classes": "any" - */ - classes: "any", - - /* blacklist of classes is only available if classes is set to any */ - classes_blacklist: { - "Apple-interchange-newline": 1, - MsoNormal: 1, - MsoPlainText: 1, - }, - - type_definitions: { - alignment_object: { - classes: { - "wysiwyg-text-align-center": 1, - "wysiwyg-text-align-justify": 1, - "wysiwyg-text-align-left": 1, - "wysiwyg-text-align-right": 1, - "wysiwyg-float-left": 1, - "wysiwyg-float-right": 1, - }, - styles: { - float: ["left", "right"], - "text-align": ["left", "right", "center"], - }, - }, - - valid_image_src: { - attrs: { - src: /^[^data\:]/i, - }, - }, - - text_color_object: { - styles: { - color: true, - "background-color": true, - }, - }, - - text_fontsize_object: { - styles: { - "font-size": true, - }, - }, - - text_formatting_object: { - classes: { - "wysiwyg-color-aqua": 1, - "wysiwyg-color-black": 1, - "wysiwyg-color-blue": 1, - "wysiwyg-color-fuchsia": 1, - "wysiwyg-color-gray": 1, - "wysiwyg-color-green": 1, - "wysiwyg-color-lime": 1, - "wysiwyg-color-maroon": 1, - "wysiwyg-color-navy": 1, - "wysiwyg-color-olive": 1, - "wysiwyg-color-purple": 1, - "wysiwyg-color-red": 1, - "wysiwyg-color-silver": 1, - "wysiwyg-color-teal": 1, - "wysiwyg-color-white": 1, - "wysiwyg-color-yellow": 1, - "wysiwyg-font-size-large": 1, - "wysiwyg-font-size-larger": 1, - "wysiwyg-font-size-medium": 1, - "wysiwyg-font-size-small": 1, - "wysiwyg-font-size-smaller": 1, - "wysiwyg-font-size-x-large": 1, - "wysiwyg-font-size-x-small": 1, - "wysiwyg-font-size-xx-large": 1, - "wysiwyg-font-size-xx-small": 1, - }, - }, - }, - - comments: 1, // if set allows comments to pass - - /** - * Tag list - * - * The following options are available: - * - * - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class - * The following methods are implemented in wysihtml.dom.parse: - * - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*") - *

        foo

        ... becomes ...

        class="wysiwyg-text-align-center">foo

        - * - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*" - *
        ... becomes ...
        - * - align_img: converts align attribute values (right/left) on to their corresponding css class "wysiwyg-float-*" - * - * - remove: removes the element and its content - * - * - unwrap removes element but leaves content - * - * - rename_tag: renames the element to the given tag - * - * - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above) - * - * - set_attributes: sets/overrides the given attributes - * - * - check_attributes: checks the given HTML attribute via the given method - * - url: allows only valid urls (starting with http:// or https://) - * - src: allows something like "/foobar.jpg", "http://google.com", ... - * - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg" - * - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML) - * - numbers: ensures that the attribute only contains numeric (integer) characters (no float values or units) - * - dimension: for with/height attributes where floating point numbrs and percentages are allowed - * - any: allows anything to pass - */ - tags: { - tr: { - add_style: { - align: "align_text", - }, - check_attributes: { - id: "any", - }, - }, - strike: { - unwrap: 1, - }, - form: { - unwrap: 1, - }, - rt: { - rename_tag: "span", - }, - code: {}, - acronym: { - rename_tag: "span", - }, - br: { - add_class: { - clear: "clear_br", - }, - }, - details: { - unwrap: 1, - }, - h4: wysihtmlParserRulesDefaults.blockLevelEl, - em: {}, - title: { - remove: 1, - }, - multicol: { - unwrap: 1, - }, - figure: { - unwrap: 1, - }, - xmp: { - unwrap: 1, - }, - small: { - rename_tag: "span", - set_class: "wysiwyg-font-size-smaller", - }, - area: { - remove: 1, - }, - time: { - unwrap: 1, - }, - dir: { - rename_tag: "ul", - }, - bdi: { - unwrap: 1, - }, - command: { - unwrap: 1, - }, - ul: { - check_attributes: { - id: "any", - }, - }, - progress: { - rename_tag: "span", - }, - dfn: { - unwrap: 1, - }, - iframe: { - check_attributes: { - src: "any", - width: "any", - height: "any", - frameborder: "any", - style: "any", - id: "any", - }, - }, - figcaption: { - unwrap: 1, - }, - a: { - check_attributes: { - href: "href", // if you compiled main manually then change this from 'url' to 'href' - rel: "any", - target: "any", - id: "any", - }, - }, - img: { - one_of_type: { - valid_image_src: 1, - }, - check_attributes: { - width: "dimension", - alt: "alt", - src: "src", // if you compiled main manually then change this from 'url' to 'src' - height: "dimension", - id: "any", - }, - add_class: { - align: "align_img", - }, - }, - rb: { - unwrap: 1, - }, - footer: wysihtmlParserRulesDefaults.makeDiv, - noframes: { - remove: 1, - }, - abbr: { - unwrap: 1, - }, - u: {}, - bgsound: { - remove: 1, - }, - sup: {}, - address: { - unwrap: 1, - }, - basefont: { - remove: 1, - }, - nav: { - unwrap: 1, - }, - h1: wysihtmlParserRulesDefaults.blockLevelEl, - head: { - unwrap: 1, - }, - tbody: wysihtmlParserRulesDefaults.blockLevelEl, - dd: { - unwrap: 1, - }, - s: { - unwrap: 1, - }, - li: {}, - td: { - check_attributes: { - rowspan: "numbers", - colspan: "numbers", - valign: "any", - align: "any", - id: "any", - class: "any", - }, - keep_styles: { - backgroundColor: 1, - width: 1, - height: 1, - }, - add_style: { - align: "align_text", - }, - }, - object: { - remove: 1, - }, - - div: { - one_of_type: { - alignment_object: 1, - }, - remove_action: "unwrap", - keep_styles: { - textAlign: 1, - float: 1, - }, - add_style: { - align: "align_text", - }, - check_attributes: { - id: "any", - contenteditable: "any", - }, - }, - - option: { - remove: 1, - }, - select: { - remove: 1, - }, - i: {}, - track: { - remove: 1, - }, - wbr: { - remove: 1, - }, - fieldset: { - unwrap: 1, - }, - big: { - rename_tag: "span", - set_class: "wysiwyg-font-size-larger", - }, - button: { - unwrap: 1, - }, - noscript: { - remove: 1, - }, - svg: { - remove: 1, - }, - input: { - remove: 1, - }, - table: { - keep_styles: { - width: 1, - textAlign: 1, - float: 1, - }, - check_attributes: { - id: "any", - }, - }, - keygen: { - remove: 1, - }, - h5: wysihtmlParserRulesDefaults.blockLevelEl, - meta: { - remove: 1, - }, - map: { - remove: 1, - }, - isindex: { - remove: 1, - }, - mark: { - unwrap: 1, - }, - caption: wysihtmlParserRulesDefaults.blockLevelEl, - tfoot: wysihtmlParserRulesDefaults.blockLevelEl, - base: { - remove: 1, - }, - video: { - remove: 1, - }, - strong: {}, - canvas: { - remove: 1, - }, - output: { - unwrap: 1, - }, - marquee: { - unwrap: 1, - }, - b: {}, - q: { - check_attributes: { - cite: "url", - id: "any", - }, - }, - applet: { - remove: 1, - }, - span: { - one_of_type: { - text_formatting_object: 1, - text_color_object: 1, - text_fontsize_object: 1, - }, - keep_styles: { - color: 1, - backgroundColor: 1, - fontSize: 1, - }, - remove_action: "unwrap", - check_attributes: { - id: "any", - }, - }, - rp: { - unwrap: 1, - }, - spacer: { - remove: 1, - }, - source: { - remove: 1, - }, - aside: wysihtmlParserRulesDefaults.makeDiv, - frame: { - remove: 1, - }, - section: wysihtmlParserRulesDefaults.makeDiv, - body: { - unwrap: 1, - }, - ol: {}, - nobr: { - unwrap: 1, - }, - html: { - unwrap: 1, - }, - summary: { - unwrap: 1, - }, - var: { - unwrap: 1, - }, - del: { - unwrap: 1, - }, - blockquote: { - keep_styles: { - textAlign: 1, - float: 1, - }, - add_style: { - align: "align_text", - }, - check_attributes: { - cite: "url", - id: "any", - }, - }, - style: { - check_attributes: { - type: "any", - src: "any", - charset: "any", - }, - }, - device: { - remove: 1, - }, - meter: { - unwrap: 1, - }, - h3: wysihtmlParserRulesDefaults.blockLevelEl, - textarea: { - unwrap: 1, - }, - embed: { - remove: 1, - }, - hgroup: { - unwrap: 1, - }, - font: { - rename_tag: "span", - add_class: { - size: "size_font", - }, - }, - tt: { - unwrap: 1, - }, - noembed: { - remove: 1, - }, - thead: { - add_style: { - align: "align_text", - }, - check_attributes: { - id: "any", - }, - }, - blink: { - unwrap: 1, - }, - plaintext: { - unwrap: 1, - }, - xml: { - remove: 1, - }, - h6: wysihtmlParserRulesDefaults.blockLevelEl, - param: { - remove: 1, - }, - th: { - check_attributes: { - rowspan: "numbers", - colspan: "numbers", - valign: "any", - align: "any", - id: "any", - }, - keep_styles: { - backgroundColor: 1, - width: 1, - height: 1, - }, - add_style: { - align: "align_text", - }, - }, - legend: { - unwrap: 1, - }, - hr: {}, - label: { - unwrap: 1, - }, - dl: { - unwrap: 1, - }, - kbd: { - unwrap: 1, - }, - listing: { - unwrap: 1, - }, - dt: { - unwrap: 1, - }, - nextid: { - remove: 1, - }, - pre: {}, - center: wysihtmlParserRulesDefaults.makeDiv, - audio: { - remove: 1, - }, - datalist: { - unwrap: 1, - }, - samp: { - unwrap: 1, - }, - col: { - remove: 1, - }, - article: wysihtmlParserRulesDefaults.makeDiv, - cite: {}, - link: { - remove: 1, - }, - script: { - check_attributes: { - type: "any", - src: "any", - charset: "any", - }, - }, - bdo: { - unwrap: 1, - }, - menu: { - rename_tag: "ul", - }, - colgroup: { - remove: 1, - }, - ruby: { - unwrap: 1, - }, - h2: wysihtmlParserRulesDefaults.blockLevelEl, - ins: { - unwrap: 1, - }, - p: wysihtmlParserRulesDefaults.blockLevelEl, - sub: {}, - comment: { - remove: 1, - }, - frameset: { - remove: 1, - }, - optgroup: { - unwrap: 1, - }, - header: wysihtmlParserRulesDefaults.makeDiv, - }, -}; - -(function () { - // Paste cleanup rules universal for all rules (also applied to content copied from editor) - var commonRules = wysihtml.lang.object(wysihtmlParserRules).clone(true); - commonRules.comments = false; - commonRules.selectors = { "a u": "unwrap" }; - commonRules.tags.style = { remove: 1 }; - commonRules.tags.script = { remove: 1 }; - commonRules.tags.head = { remove: 1 }; - - // Paste cleanup for unindentified source - var universalRules = wysihtml.lang.object(commonRules).clone(true); - universalRules.tags.div.one_of_type.alignment_object = 1; - universalRules.tags.div.remove_action = "unwrap"; - universalRules.tags.div.check_attributes.style = false; - universalRules.tags.div.keep_styles = { - textAlign: /^((left)|(right)|(center)|(justify))$/i, - float: 1, - }; - universalRules.tags.span.keep_styles = false; - - // Paste cleanup for MS Office - // TODO: should be extended to stricter ruleset, as current set will probably not cover all Office bizarreness - var msOfficeRules = wysihtml.lang.object(universalRules).clone(true); - msOfficeRules.classes = {}; - - window.wysihtmlParserPasteRulesets = [ - { - condition: - //i, - set: commonRules, - }, - { - set: universalRules, - }, - ]; -})(); diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.all-commands.min.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.all-commands.min.js deleted file mode 100644 index 64208c4f2ca..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.all-commands.min.js +++ /dev/null @@ -1,397 +0,0 @@ -/*! wysihtml - v0.6.0-beta1 (2016-09-01) */ - -(wysihtml.commands.alignCenterStyle = (function () { - var a = { styleProperty: "textAlign", styleValue: "center", toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; -})()), - (wysihtml.commands.alignJustifyStyle = (function () { - var a = { styleProperty: "textAlign", styleValue: "justify", toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.alignLeftStyle = (function () { - var a = { styleProperty: "textAlign", styleValue: "left", toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.alignRightStyle = (function () { - var a = { styleProperty: "textAlign", styleValue: "right", toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.bgColorStyle = (function () { - return { - exec: function (a, b, c) { - var d, - e = wysihtml.quirks.styleParser.parseColor("background-color:" + (c.color || c), "background-color"); - e && - ((d = (1 === e[3] ? "rgb(" + [e[0], e[1], e[2]].join(", ") : "rgba(" + e.join(", ")) + ")"), - wysihtml.commands.formatInline.exec(a, b, { styleProperty: "backgroundColor", styleValue: d })); - }, - state: function (a, b, c) { - var d, - e = c - ? wysihtml.quirks.styleParser.parseColor("background-color:" + (c.color || c), "background-color") - : null; - return ( - e && (d = (1 === e[3] ? "rgb(" + [e[0], e[1], e[2]].join(", ") : "rgba(" + e.join(", ")) + ")"), - wysihtml.commands.formatInline.state(a, b, { styleProperty: "backgroundColor", styleValue: d }) - ); - }, - remove: function (a, b) { - return wysihtml.commands.formatInline.remove(a, b, { styleProperty: "backgroundColor" }); - }, - stateValue: function (a, b, c) { - var d, - e = this.state(a, b), - f = !1; - return ( - e && wysihtml.lang.object(e).isArray() && (e = e[0]), - e && (d = e.getAttribute("style")) - ? ((f = wysihtml.quirks.styleParser.parseColor(d, "background-color")), - wysihtml.quirks.styleParser.unparseColor(f, c)) - : !1 - ); - }, - }; - })()), - (wysihtml.commands.bold = (function () { - var a = { nodeName: "B", toggle: !0 }; - return { - exec: function (b, c) { - wysihtml.commands.formatInline.exec(b, c, a); - }, - state: function (b, c) { - return wysihtml.commands.formatInline.state(b, c, a); - }, - }; - })()), - (wysihtml.commands.formatCode = (function () { - return { - exec: function (a, b, c) { - var d, - e, - f, - g = this.state(a)[0]; - g - ? a.selection.executeAndRestore(function () { - (d = g.querySelector("code")), - wysihtml.dom.replaceWithChildNodes(g), - d && wysihtml.dom.replaceWithChildNodes(d); - }) - : ((e = a.selection.getRange()), - (f = e.extractContents()), - (g = a.doc.createElement("pre")), - (d = a.doc.createElement("code")), - c && (d.className = c), - g.appendChild(d), - d.appendChild(f), - e.insertNode(g), - a.selection.selectNode(g)); - }, - state: function (a) { - var b, - c = a.selection.getSelectedNode(); - return c && - c.nodeName && - "PRE" == c.nodeName && - c.firstChild && - c.firstChild.nodeName && - "CODE" == c.firstChild.nodeName - ? [c] - : ((b = wysihtml.dom.getParentElement(c, { query: "pre code" })), b ? [b.parentNode] : !1); - }, - }; - })()), - (wysihtml.commands.insertImage = (function () { - var a = "IMG"; - return { - exec: function (b, c, d) { - d = "object" == typeof d ? d : { src: d }; - var e, - f, - g = b.doc, - h = this.state(b); - if (h && !d.src) - return ( - b.selection.setBefore(h), - (f = h.parentNode), - f.removeChild(h), - wysihtml.dom.removeEmptyTextNodes(f), - "A" !== f.nodeName || f.firstChild || (b.selection.setAfter(f), f.parentNode.removeChild(f)), - void wysihtml.quirks.redraw(b.element) - ); - if (h) for (var i in d) d.hasOwnProperty(i) && h.setAttribute("className" === i ? "class" : i, d[i]); - else { - h = g.createElement(a); - for (var j in d) h.setAttribute("className" === j ? "class" : j, d[j]); - b.selection.insertNode(h), - wysihtml.browser.hasProblemsSettingCaretAfterImg() - ? ((e = g.createTextNode(wysihtml.INVISIBLE_SPACE)), b.selection.insertNode(e), b.selection.setAfter(e)) - : b.selection.setAfter(h); - } - }, - state: function (b) { - var c, - d, - e, - f = b.doc; - return wysihtml.dom.hasElementWithTagName(f, a) && (c = b.selection.getSelectedNode()) - ? c.nodeName === a - ? c - : c.nodeType !== wysihtml.ELEMENT_NODE - ? !1 - : ((d = b.selection.getText()), - (d = wysihtml.lang.string(d).trim()) - ? !1 - : ((e = b.selection.getNodes(wysihtml.ELEMENT_NODE, function (a) { - return "IMG" === a.nodeName; - })), - 1 !== e.length ? !1 : e[0])) - : !1; - }, - }; - })()), - (wysihtml.commands.fontSize = (function () { - var a = /wysiwyg-font-size-[0-9a-z\-]+/g; - return { - exec: function (b, c, d) { - wysihtml.commands.formatInline.exec(b, c, { className: "wysiwyg-font-size-" + d, classRegExp: a, toggle: !0 }); - }, - state: function (a, b, c) { - return wysihtml.commands.formatInline.state(a, b, { className: "wysiwyg-font-size-" + c }); - }, - }; - })()), - (wysihtml.commands.fontSizeStyle = (function () { - return { - exec: function (a, b, c) { - (c = c.size || c), - /^\s*$/.test(c) || - wysihtml.commands.formatInline.exec(a, b, { styleProperty: "fontSize", styleValue: c, toggle: !1 }); - }, - state: function (a, b, c) { - return wysihtml.commands.formatInline.state(a, b, { styleProperty: "fontSize", styleValue: c || void 0 }); - }, - remove: function (a, b) { - return wysihtml.commands.formatInline.remove(a, b, { styleProperty: "fontSize" }); - }, - stateValue: function (a, b) { - var c, - d = this.state(a, b); - return ( - d && wysihtml.lang.object(d).isArray() && (d = d[0]), - d && (c = d.getAttribute("style")) ? wysihtml.quirks.styleParser.parseFontSize(c) : !1 - ); - }, - }; - })()), - (wysihtml.commands.foreColor = (function () { - var a = /wysiwyg-color-[0-9a-z]+/g; - return { - exec: function (b, c, d) { - wysihtml.commands.formatInline.exec(b, c, { className: "wysiwyg-color-" + d, classRegExp: a, toggle: !0 }); - }, - state: function (a, b, c) { - return wysihtml.commands.formatInline.state(a, b, { className: "wysiwyg-color-" + c }); - }, - }; - })()), - (wysihtml.commands.foreColorStyle = (function () { - return { - exec: function (a, b, c) { - var d, e; - c && - ((d = wysihtml.quirks.styleParser.parseColor("color:" + (c.color || c), "color")), - d && - ((e = (1 === d[3] ? "rgb(" + [d[0], d[1], d[2]].join(", ") : "rgba(" + d.join(", ")) + ")"), - wysihtml.commands.formatInline.exec(a, b, { styleProperty: "color", styleValue: e }))); - }, - state: function (a, b, c) { - var d, - e = c ? wysihtml.quirks.styleParser.parseColor("color:" + (c.color || c), "color") : null; - return ( - e && (d = (1 === e[3] ? "rgb(" + [e[0], e[1], e[2]].join(", ") : "rgba(" + e.join(", ")) + ")"), - wysihtml.commands.formatInline.state(a, b, { styleProperty: "color", styleValue: d }) - ); - }, - remove: function (a, b) { - return wysihtml.commands.formatInline.remove(a, b, { styleProperty: "color" }); - }, - stateValue: function (a, b, c) { - var d, - e = this.state(a, b), - f = !1; - return ( - e && wysihtml.lang.object(e).isArray() && (e = e[0]), - e && (d = e.getAttribute("style")) - ? ((f = wysihtml.quirks.styleParser.parseColor(d, "color")), wysihtml.quirks.styleParser.unparseColor(f, c)) - : !1 - ); - }, - }; - })()), - (wysihtml.commands.insertBlockQuote = (function () { - var a = { nodeName: "BLOCKQUOTE", toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.insertHorizontalRule = (function () { - return { - exec: function (a) { - var b = a.selection.getSelectedNode(), - c = wysihtml.dom.getParentElement( - b, - { query: wysihtml.PERMITTED_PHRASING_CONTENT_ONLY }, - null, - a.editableArea - ), - d = document.createElement("hr"); - c ? a.selection.splitElementAtCaret(c, d) : a.selection.insertNode(d), - d.nextSibling ? a.selection.setBefore(d.nextSibling) : a.selection.setAfter(d); - }, - state: function () { - return !1; - }, - }; - })()), - (wysihtml.commands.insertOrderedList = (function () { - return { - exec: function (a, b) { - wysihtml.commands.insertList.exec(a, b, "OL"); - }, - state: function (a, b) { - return wysihtml.commands.insertList.state(a, b, "OL"); - }, - }; - })()), - (wysihtml.commands.insertUnorderedList = (function () { - return { - exec: function (a, b) { - wysihtml.commands.insertList.exec(a, b, "UL"); - }, - state: function (a, b) { - return wysihtml.commands.insertList.state(a, b, "UL"); - }, - }; - })()), - (wysihtml.commands.italic = (function () { - var a = { nodeName: "I", toggle: !0 }; - return { - exec: function (b, c) { - wysihtml.commands.formatInline.exec(b, c, a); - }, - state: function (b, c) { - return wysihtml.commands.formatInline.state(b, c, a); - }, - }; - })()), - (wysihtml.commands.justifyCenter = (function () { - var a = { className: "wysiwyg-text-align-center", classRegExp: /wysiwyg-text-align-[0-9a-z]+/g, toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.justifyFull = (function () { - var a = { className: "wysiwyg-text-align-justify", classRegExp: /wysiwyg-text-align-[0-9a-z]+/g, toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.justifyLeft = (function () { - var a = { className: "wysiwyg-text-align-left", classRegExp: /wysiwyg-text-align-[0-9a-z]+/g, toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.justifyRight = (function () { - var a = { className: "wysiwyg-text-align-right", classRegExp: /wysiwyg-text-align-[0-9a-z]+/g, toggle: !0 }; - return { - exec: function (b, c) { - return wysihtml.commands.formatBlock.exec(b, "formatBlock", a); - }, - state: function (b, c) { - return wysihtml.commands.formatBlock.state(b, "formatBlock", a); - }, - }; - })()), - (wysihtml.commands.subscript = (function () { - var a = { nodeName: "SUB", toggle: !0 }; - return { - exec: function (b, c) { - wysihtml.commands.formatInline.exec(b, c, a); - }, - state: function (b, c) { - return wysihtml.commands.formatInline.state(b, c, a); - }, - }; - })()), - (wysihtml.commands.superscript = (function () { - var a = { nodeName: "SUP", toggle: !0 }; - return { - exec: function (b, c) { - wysihtml.commands.formatInline.exec(b, c, a); - }, - state: function (b, c) { - return wysihtml.commands.formatInline.state(b, c, a); - }, - }; - })()), - (wysihtml.commands.underline = (function () { - var a = { nodeName: "U", toggle: !0 }; - return { - exec: function (b, c) { - wysihtml.commands.formatInline.exec(b, c, a); - }, - state: function (b, c) { - return wysihtml.commands.formatInline.state(b, c, a); - }, - }; - })()); -//# sourceMappingURL=wysihtml.all-commands.min.map diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.min.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.min.js deleted file mode 100644 index ccbec8a32a3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.min.js +++ /dev/null @@ -1,8962 +0,0 @@ -/*! wysihtml - v0.6.0-beta1 (2016-09-01) */ - -var wysihtml = { - version: "0.6.0-beta1", - commands: {}, - dom: {}, - quirks: {}, - toolbar: {}, - lang: {}, - selection: {}, - views: {}, - editorExtenders: [], - extendEditor: function (a) { - this.editorExtenders.push(a); - }, - INVISIBLE_SPACE: "\ufeff", - INVISIBLE_SPACE_REG_EXP: /\uFEFF/g, - VOID_ELEMENTS: "area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr", - PERMITTED_PHRASING_CONTENT_ONLY: "h1, h2, h3, h4, h5, h6, p, pre", - EMPTY_FUNCTION: function () {}, - ELEMENT_NODE: 1, - TEXT_NODE: 3, - BACKSPACE_KEY: 8, - ENTER_KEY: 13, - ESCAPE_KEY: 27, - SPACE_KEY: 32, - TAB_KEY: 9, - DELETE_KEY: 46, -}; -(wysihtml.polyfills = function (a, b) { - var c = { - normalizeHasCaretError: function () { - if ("createRange" in b && "getSelection" in a) { - var c, - d, - e, - f = window.pageYOffset, - g = window.pageXOffset, - h = b.createElement("div"), - i = b.createTextNode("a"), - j = b.createTextNode("a"), - k = b.createTextNode("a"), - l = b.createRange(); - return ( - document.activeElement && - (1 === document.activeElement.nodeType && - ["INPUT", "TEXTAREA", "SELECT", "BUTTON"].indexOf(document.activeElement.nodeName) > -1 - ? (c = { - type: "form", - node: document.activeElement, - start: document.activeElement.selectionStart, - end: document.activeElement.selectionEnd, - }) - : ((d = a.getSelection()), - d && - d.anchorNode && - (c = { - type: "range", - anchorNode: d.anchorNode, - anchorOffset: d.anchorOffset, - focusNode: d.focusNode, - focusOffset: d.focusOffset, - }))), - h.setAttribute("contenteditable", "true"), - h.appendChild(i), - h.appendChild(j), - h.appendChild(k), - b.body.appendChild(h), - l.setStart(j, 1), - l.setEnd(j, 1), - (d = a.getSelection()), - d.removeAllRanges(), - d.addRange(l), - h.normalize(), - (d = a.getSelection()), - (e = 1 !== h.childNodes.length || d.anchorNode !== h.firstChild || 2 !== d.anchorOffset), - h.parentNode.removeChild(h), - d.removeAllRanges(), - c && - ("form" === c.type - ? ("undefined" != typeof c.start && - "undefined" != typeof c.end && - c.node.setSelectionRange(c.start, c.end), - c.node.focus()) - : "range" === c.type && - ((l = b.createRange()), - l.setStart(c.anchorNode, c.anchorOffset), - l.setEnd(c.focusNode, c.focusOffset), - d.addRange(l))), - (f !== window.pageYOffset || g !== window.pageXOffset) && a.scrollTo(g, f), - e - ); - } - }, - apply: function () { - function d() { - try { - var b = new a.CustomEvent("cat", { detail: { foo: "bar" } }); - return "cat" === b.type && "bar" === b.detail.foo; - } catch (c) {} - return !1; - } - !(function (a) { - (a.matches = - a.matches || - a.mozMatchesSelector || - a.msMatchesSelector || - a.oMatchesSelector || - a.webkitMatchesSelector || - function (a) { - for (var b = this, c = (b.document || b.ownerDocument).querySelectorAll(a), d = 0; c[d] && c[d] !== b; ) - ++d; - return c[d] ? !0 : !1; - }), - (a.closest = - a.closest || - function (a) { - for (var b = this; b && !b.matches(a); ) b = b.parentElement; - return b; - }), - (a.remove = - a.remove || - function () { - this.parentNode && this.parentNode.removeChild(this); - }); - })(a.Element.prototype), - "classList" in b.documentElement || - !a.Object.defineProperty || - "undefined" == typeof a.HTMLElement || - a.Object.defineProperty(a.HTMLElement.prototype, "classList", { - get: function () { - function b(a) { - return function (b) { - var d = c.className.split(/\s+/), - e = d.indexOf(b); - a(d, e, b), (c.className = d.join(" ")); - }; - } - var c = this, - d = { - add: b(function (a, b, c) { - ~b || a.push(c); - }), - remove: b(function (a, b) { - ~b && a.splice(b, 1); - }), - toggle: b(function (a, b, c) { - ~b ? a.splice(b, 1) : a.push(c); - }), - contains: function (a) { - return !!~c.className.split(/\s+/).indexOf(a); - }, - item: function (a) { - return c.className.split(/\s+/)[a] || null; - }, - }; - return ( - a.Object.defineProperty(d, "length", { - get: function () { - return c.className.split(/\s+/).length; - }, - }), - d - ); - }, - }); - var e = function (a) { - var b = []; - for (a = a.firstChild; a; a = a.nextSibling) 3 == a.nodeType ? b.push(a) : (b = b.concat(e(a))); - return b; - }, - f = function (a) { - var b = a.ownerDocument, - c = a; - do { - if (c === b) return !0; - c = c.parentNode; - } while (c); - return !1; - }, - g = function () { - var b = - (a.Node.prototype.normalize, - function () { - var b = e(this), - c = this.ownerDocument.defaultView.getSelection(), - d = c.anchorNode, - g = c.anchorOffset, - h = d && 1 === d.nodeType && d.childNodes.length > 0 ? d.childNodes[g] : void 0, - i = c.focusNode, - j = c.focusOffset, - k = i && 1 === i.nodeType && j > 0 ? i.childNodes[j - 1] : void 0, - l = this.ownerDocument.createRange(), - m = b.shift(), - n = m ? b.shift() : null; - for ( - k && 3 === k.nodeType && ((i = k), (j = k.nodeValue.length), (k = void 0)), - h && 3 === h.nodeType && ((d = h), (g = 0), (h = void 0)), - ((d === i && g > j) || - (d !== i && - d.compareDocumentPosition(i) & a.Node.DOCUMENT_POSITION_PRECEDING && - !(d.compareDocumentPosition(i) & a.Node.DOCUMENT_POSITION_CONTAINS))) && - ((i = [d, (d = i)][0]), (j = [g, (g = j)][0])); - m && n; - - ) - n.previousSibling && n.previousSibling === m - ? (d === n && ((d = m), (g = m.nodeValue.length + g)), - i === n && ((i = m), (j = m.nodeValue.length + j)), - (m.nodeValue = m.nodeValue + n.nodeValue), - n.parentNode.removeChild(n), - (n = b.shift())) - : ((m = n), (n = b.shift())); - k && (j = Array.prototype.indexOf.call(k.parentNode.childNodes, k) + 1), - h && (g = Array.prototype.indexOf.call(h.parentNode.childNodes, h)), - f(this) && - d && - d.parentNode && - i && - i.parentNode && - (l.setStart(d, g), l.setEnd(i, j), c.removeAllRanges(), c.addRange(l)); - }); - a.Node.prototype.normalize = b; - }, - h = function () { - a.removeEventListener("load", h), - "Node" in a && "normalize" in a.Node.prototype && c.normalizeHasCaretError() && g(); - }; - "complete" !== b.readyState ? a.addEventListener("load", h) : h(), - (function () { - function c(a, c) { - c = c || { bubbles: !1, cancelable: !1, detail: void 0 }; - var d = b.createEvent("CustomEvent"); - return d.initCustomEvent(a, c.bubbles, c.cancelable, c.detail), d; - } - !d() && "CustomEvent" in a && ((c.prototype = a.Event.prototype), (a.CustomEvent = c)); - })(); - }, - }; - return c; -}), - wysihtml.polyfills(window, document).apply(); -var Base = function () {}; -(Base.extend = function (a, b) { - var c = Base.prototype.extend; - Base._prototyping = !0; - var d = new this(); - c.call(d, a), (d.base = function () {}), delete Base._prototyping; - var e = d.constructor, - f = (d.constructor = function () { - if (!Base._prototyping) - if (this._constructing || this.constructor == f) - (this._constructing = !0), e.apply(this, arguments), delete this._constructing; - else if (null != arguments[0]) return (arguments[0].extend || c).call(arguments[0], d); - }); - return ( - (f.ancestor = this), - (f.extend = this.extend), - (f.forEach = this.forEach), - (f.implement = this.implement), - (f.prototype = d), - (f.toString = this.toString), - (f.valueOf = function (a) { - return "object" == a ? f : e.valueOf(); - }), - c.call(f, b), - "function" == typeof f.init && f.init(), - f - ); -}), - (Base.prototype = { - extend: function (a, b) { - if (arguments.length > 1) { - var c = this[a]; - if (c && "function" == typeof b && (!c.valueOf || c.valueOf() != b.valueOf()) && /\bbase\b/.test(b)) { - var d = b.valueOf(); - (b = function () { - var a = this.base || Base.prototype.base; - this.base = c; - var b = d.apply(this, arguments); - return (this.base = a), b; - }), - (b.valueOf = function (a) { - return "object" == a ? b : d; - }), - (b.toString = Base.toString); - } - this[a] = b; - } else if (a) { - var e = Base.prototype.extend; - Base._prototyping || "function" == typeof this || (e = this.extend || e); - for ( - var f = { toSource: null }, g = ["constructor", "toString", "valueOf"], h = Base._prototyping ? 0 : 1; - (i = g[h++]); - - ) - a[i] != f[i] && e.call(this, i, a[i]); - for (var i in a) f[i] || e.call(this, i, a[i]); - } - return this; - }, - }), - (Base = Base.extend( - { - constructor: function () { - this.extend(arguments[0]); - }, - }, - { - ancestor: Object, - version: "1.1", - forEach: function (a, b, c) { - for (var d in a) void 0 === this.prototype[d] && b.call(c, a[d], d, a); - }, - implement: function () { - for (var a = 0; a < arguments.length; a++) - "function" == typeof arguments[a] ? arguments[a](this.prototype) : this.prototype.extend(arguments[a]); - return this; - }, - toString: function () { - return String(this.valueOf()); - }, - } - )); -var rangy; -!(function () { - function a(a, b) { - var c = typeof a[b]; - return c == u || !(c != t || !a[b]) || "unknown" == c; - } - function b(a, b) { - return !(typeof a[b] != t || !a[b]); - } - function c(a, b) { - return typeof a[b] != v; - } - function d(a) { - return function (b, c) { - for (var d = c.length; d--; ) if (!a(b, c[d])) return !1; - return !0; - }; - } - function e(a) { - return a && A(a, z) && C(a, y); - } - function f(a) { - return b(a, "body") ? a.body : a.getElementsByTagName("body")[0]; - } - function g(b) { - typeof console != v && a(console, "log") && console.log(b); - } - function h(a, b) { - F && b ? alert(a) : g(a); - } - function i(a) { - (H.initialized = !0), - (H.supported = !1), - h("Rangy is not supported in this environment. Reason: " + a, H.config.alertOnFail); - } - function j(a) { - h("Rangy warning: " + a, H.config.alertOnWarn); - } - function k(a) { - return a.message || a.description || String(a); - } - function l() { - if (F && !H.initialized) { - var b, - c = !1, - d = !1; - a(document, "createRange") && ((b = document.createRange()), A(b, x) && C(b, w) && (c = !0)); - var h = f(document); - if (!h || "body" != h.nodeName.toLowerCase()) return void i("No body element found"); - if ((h && a(h, "createTextRange") && ((b = h.createTextRange()), e(b) && (d = !0)), !c && !d)) - return void i("Neither Range nor TextRange are available"); - (H.initialized = !0), (H.features = { implementsDomRange: c, implementsTextRange: d }); - var j, l; - for (var m in E) (j = E[m]) instanceof p && j.init(j, H); - for (var n = 0, o = K.length; o > n; ++n) - try { - K[n](H); - } catch (q) { - (l = "Rangy init listener threw an exception. Continuing. Detail: " + k(q)), g(l); - } - } - } - function m(a, b, c) { - c && (a += " in module " + c.name), H.warn("DEPRECATED: " + a + " is deprecated. Please use " + b + " instead."); - } - function n(a, b, c, d) { - a[b] = function () { - return m(b, c, d), a[c].apply(a, G.toArray(arguments)); - }; - } - function o(a) { - (a = a || window), l(); - for (var b = 0, c = L.length; c > b; ++b) L[b](a); - } - function p(a, b, c) { - (this.name = a), (this.dependencies = b), (this.initialized = !1), (this.supported = !1), (this.initializer = c); - } - function q(a, b, c) { - var d = new p(a, b, function (b) { - if (!b.initialized) { - b.initialized = !0; - try { - c(H, b), (b.supported = !0); - } catch (d) { - var e = "Module '" + a + "' failed to load: " + k(d); - g(e), d.stack && g(d.stack); - } - } - }); - return (E[a] = d), d; - } - function r() {} - function s() {} - var t = "object", - u = "function", - v = "undefined", - w = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed", "commonAncestorContainer"], - x = [ - "setStart", - "setStartBefore", - "setStartAfter", - "setEnd", - "setEndBefore", - "setEndAfter", - "collapse", - "selectNode", - "selectNodeContents", - "compareBoundaryPoints", - "deleteContents", - "extractContents", - "cloneContents", - "insertNode", - "surroundContents", - "cloneRange", - "toString", - "detach", - ], - y = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"], - z = [ - "collapse", - "compareEndPoints", - "duplicate", - "moveToElementText", - "parentElement", - "select", - "setEndPoint", - "getBoundingClientRect", - ], - A = d(a), - B = d(b), - C = d(c), - D = [].forEach - ? function (a, b) { - a.forEach(b); - } - : function (a, b) { - for (var c = 0, d = a.length; d > c; ++c) b(a[c], c); - }, - E = {}, - F = typeof window != v && typeof document != v, - G = { - isHostMethod: a, - isHostObject: b, - isHostProperty: c, - areHostMethods: A, - areHostObjects: B, - areHostProperties: C, - isTextRange: e, - getBody: f, - forEach: D, - }, - H = { - version: "1.3.1-dev", - initialized: !1, - isBrowser: F, - supported: !0, - util: G, - features: {}, - modules: E, - config: { - alertOnFail: !1, - alertOnWarn: !1, - preferTextRange: !1, - autoInitialize: typeof rangyAutoInitialize == v ? !0 : rangyAutoInitialize, - }, - }; - (H.fail = i), (H.warn = j); - var I; - ({}.hasOwnProperty - ? ((G.extend = I = - function (a, b, c) { - var d, e; - for (var f in b) - b.hasOwnProperty(f) && - ((d = a[f]), - (e = b[f]), - c && null !== d && "object" == typeof d && null !== e && "object" == typeof e && I(d, e, !0), - (a[f] = e)); - return b.hasOwnProperty("toString") && (a.toString = b.toString), a; - }), - (G.createOptions = function (a, b) { - var c = {}; - return I(c, b), a && I(c, a), c; - })) - : i("hasOwnProperty not supported"), - F || i("Rangy can only run in a browser"), - (function () { - var a; - if (F) { - var b = document.createElement("div"); - b.appendChild(document.createElement("span")); - var c = [].slice; - try { - 1 == c.call(b.childNodes, 0)[0].nodeType && - (a = function (a) { - return c.call(a, 0); - }); - } catch (d) {} - } - a || - (a = function (a) { - for (var b = [], c = 0, d = a.length; d > c; ++c) b[c] = a[c]; - return b; - }), - (G.toArray = a); - })()); - var J; - F && - (a(document, "addEventListener") - ? (J = function (a, b, c) { - a.addEventListener(b, c, !1); - }) - : a(document, "attachEvent") - ? (J = function (a, b, c) { - a.attachEvent("on" + b, c); - }) - : i("Document does not have required addEventListener or attachEvent method"), - (G.addListener = J)); - var K = []; - (G.deprecationNotice = m), - (G.createAliasForDeprecatedMethod = n), - (H.init = l), - (H.addInitListener = function (a) { - H.initialized ? a(H) : K.push(a); - }); - var L = []; - (H.addShimListener = function (a) { - L.push(a); - }), - F && ((H.shim = H.createMissingNativeApi = o), n(H, "createMissingNativeApi", "shim")), - (p.prototype = { - init: function () { - for (var a, b, c = this.dependencies || [], d = 0, e = c.length; e > d; ++d) { - if (((b = c[d]), (a = E[b]), !(a && a instanceof p))) - throw new Error("required module '" + b + "' not found"); - if ((a.init(), !a.supported)) throw new Error("required module '" + b + "' not supported"); - } - this.initializer(this); - }, - fail: function (a) { - throw ((this.initialized = !0), (this.supported = !1), new Error(a)); - }, - warn: function (a) { - H.warn("Module " + this.name + ": " + a); - }, - deprecationNotice: function (a, b) { - H.warn("DEPRECATED: " + a + " in module " + this.name + " is deprecated. Please use " + b + " instead"); - }, - createError: function (a) { - return new Error("Error in Rangy " + this.name + " module: " + a); - }, - }), - (H.createModule = function (a) { - var b, c; - 2 == arguments.length ? ((b = arguments[1]), (c = [])) : ((b = arguments[2]), (c = arguments[1])); - var d = q(a, c, b); - H.initialized && H.supported && d.init(); - }), - (H.createCoreModule = function (a, b, c) { - q(a, b, c); - }), - (H.RangePrototype = r), - (H.rangePrototype = new r()), - (H.selectionPrototype = new s()), - H.createCoreModule("DomUtil", [], function (a, b) { - function c(a) { - var b; - return typeof a.namespaceURI == F || null === (b = a.namespaceURI) || "http://www.w3.org/1999/xhtml" == b; - } - function d(a) { - var b = a.parentNode; - return 1 == b.nodeType ? b : null; - } - function e(a) { - for (var b = 0; (a = a.previousSibling); ) ++b; - return b; - } - function f(a) { - switch (a.nodeType) { - case 7: - case 10: - return 0; - case 3: - case 8: - return a.length; - default: - return a.childNodes.length; - } - } - function g(a, b) { - var c, - d = []; - for (c = a; c; c = c.parentNode) d.push(c); - for (c = b; c; c = c.parentNode) if (K(d, c)) return c; - return null; - } - function h(a, b, c) { - for (var d = c ? b : b.parentNode; d; ) { - if (d === a) return !0; - d = d.parentNode; - } - return !1; - } - function i(a, b) { - return h(a, b, !0); - } - function j(a, b, c) { - for (var d, e = c ? a : a.parentNode; e; ) { - if (((d = e.parentNode), d === b)) return e; - e = d; - } - return null; - } - function k(a) { - var b = a.nodeType; - return 3 == b || 4 == b || 8 == b; - } - function l(a) { - if (!a) return !1; - var b = a.nodeType; - return 3 == b || 8 == b; - } - function m(a, b) { - var c = b.nextSibling, - d = b.parentNode; - return c ? d.insertBefore(a, c) : d.appendChild(a), a; - } - function n(a, b, c) { - var d = a.cloneNode(!1); - if ((d.deleteData(0, b), a.deleteData(b, a.length - b), m(d, a), c)) - for (var f, g = 0; (f = c[g++]); ) - f.node == a && f.offset > b - ? ((f.node = d), (f.offset -= b)) - : f.node == a.parentNode && f.offset > e(a) && ++f.offset; - return d; - } - function o(a) { - if (9 == a.nodeType) return a; - if (typeof a.ownerDocument != F) return a.ownerDocument; - if (typeof a.document != F) return a.document; - if (a.parentNode) return o(a.parentNode); - throw b.createError("getDocument: no document found for node"); - } - function p(a) { - var c = o(a); - if (typeof c.defaultView != F) return c.defaultView; - if (typeof c.parentWindow != F) return c.parentWindow; - throw b.createError("Cannot get a window object for node"); - } - function q(a) { - if (typeof a.contentDocument != F) return a.contentDocument; - if (typeof a.contentWindow != F) return a.contentWindow.document; - throw b.createError("getIframeDocument: No Document object found for iframe element"); - } - function r(a) { - if (typeof a.contentWindow != F) return a.contentWindow; - if (typeof a.contentDocument != F) return a.contentDocument.defaultView; - throw b.createError("getIframeWindow: No Window object found for iframe element"); - } - function s(a) { - return a && G.isHostMethod(a, "setTimeout") && G.isHostObject(a, "document"); - } - function t(a, b, c) { - var d; - if ( - (a - ? G.isHostProperty(a, "nodeType") - ? (d = 1 == a.nodeType && "iframe" == a.tagName.toLowerCase() ? q(a) : o(a)) - : s(a) && (d = a.document) - : (d = document), - !d) - ) - throw b.createError(c + "(): Parameter must be a Window object or DOM node"); - return d; - } - function u(a) { - for (var b; (b = a.parentNode); ) a = b; - return a; - } - function v(a, c, d, f) { - var h, i, k, l, m; - if (a == d) return c === f ? 0 : f > c ? -1 : 1; - if ((h = j(d, a, !0))) return c <= e(h) ? -1 : 1; - if ((h = j(a, d, !0))) return e(h) < f ? -1 : 1; - if (((i = g(a, d)), !i)) throw new Error("comparePoints error: nodes have no common ancestor"); - if (((k = a === i ? i : j(a, i, !0)), (l = d === i ? i : j(d, i, !0)), k === l)) - throw b.createError("comparePoints got to case 4 and childA and childB are the same!"); - for (m = i.firstChild; m; ) { - if (m === k) return -1; - if (m === l) return 1; - m = m.nextSibling; - } - } - function w(a) { - var b; - try { - return (b = a.parentNode), !1; - } catch (c) { - return !0; - } - } - function x(a) { - if (!a) return "[No node]"; - if (L && w(a)) return "[Broken node]"; - if (k(a)) return '"' + a.data + '"'; - if (1 == a.nodeType) { - var b = a.id ? ' id="' + a.id + '"' : ""; - return ( - "<" + - a.nodeName + - b + - ">[index:" + - e(a) + - ",length:" + - a.childNodes.length + - "][" + - (a.innerHTML || "[innerHTML not supported]").slice(0, 25) + - "]" - ); - } - return a.nodeName; - } - function y(a) { - for (var b, c = o(a).createDocumentFragment(); (b = a.firstChild); ) c.appendChild(b); - return c; - } - function z(a, b, c) { - var d = H(a), - e = a.createElement("div"); - (e.contentEditable = "" + !!c), b && (e.innerHTML = b); - var f = d.firstChild; - return f ? d.insertBefore(e, f) : d.appendChild(e), e; - } - function A(a) { - return a.parentNode.removeChild(a); - } - function B(a) { - (this.root = a), (this._next = a); - } - function C(a) { - return new B(a); - } - function D(a, b) { - (this.node = a), (this.offset = b); - } - function E(a) { - (this.code = this[a]), (this.codeName = a), (this.message = "DOMException: " + this.codeName); - } - var F = "undefined", - G = a.util, - H = G.getBody; - G.areHostMethods(document, ["createDocumentFragment", "createElement", "createTextNode"]) || - b.fail("document missing a Node creation method"), - G.isHostMethod(document, "getElementsByTagName") || b.fail("document missing getElementsByTagName method"); - var I = document.createElement("div"); - G.areHostMethods( - I, - ["insertBefore", "appendChild", "cloneNode"] || - !G.areHostObjects(I, ["previousSibling", "nextSibling", "childNodes", "parentNode"]) - ) || b.fail("Incomplete Element implementation"), - G.isHostProperty(I, "innerHTML") || b.fail("Element is missing innerHTML property"); - var J = document.createTextNode("test"); - G.areHostMethods( - J, - ["splitText", "deleteData", "insertData", "appendData", "cloneNode"] || - !G.areHostObjects(I, ["previousSibling", "nextSibling", "childNodes", "parentNode"]) || - !G.areHostProperties(J, ["data"]) - ) || b.fail("Incomplete Text Node implementation"); - var K = function (a, b) { - for (var c = a.length; c--; ) if (a[c] === b) return !0; - return !1; - }, - L = !1; - !(function () { - var b = document.createElement("b"); - b.innerHTML = "1"; - var c = b.firstChild; - (b.innerHTML = "
        "), (L = w(c)), (a.features.crashyTextNodes = L); - })(); - var M; - typeof window.getComputedStyle != F - ? (M = function (a, b) { - return p(a).getComputedStyle(a, null)[b]; - }) - : typeof document.documentElement.currentStyle != F - ? (M = function (a, b) { - return a.currentStyle ? a.currentStyle[b] : ""; - }) - : b.fail("No means of obtaining computed style properties found"), - (B.prototype = { - _current: null, - hasNext: function () { - return !!this._next; - }, - next: function () { - var a, - b, - c = (this._current = this._next); - if (this._current) - if ((a = c.firstChild)) this._next = a; - else { - for (b = null; c !== this.root && !(b = c.nextSibling); ) c = c.parentNode; - this._next = b; - } - return this._current; - }, - detach: function () { - this._current = this._next = this.root = null; - }, - }), - (D.prototype = { - equals: function (a) { - return !!a && this.node === a.node && this.offset == a.offset; - }, - inspect: function () { - return "[DomPosition(" + x(this.node) + ":" + this.offset + ")]"; - }, - toString: function () { - return this.inspect(); - }, - }), - (E.prototype = { - INDEX_SIZE_ERR: 1, - HIERARCHY_REQUEST_ERR: 3, - WRONG_DOCUMENT_ERR: 4, - NO_MODIFICATION_ALLOWED_ERR: 7, - NOT_FOUND_ERR: 8, - NOT_SUPPORTED_ERR: 9, - INVALID_STATE_ERR: 11, - INVALID_NODE_TYPE_ERR: 24, - }), - (E.prototype.toString = function () { - return this.message; - }), - (a.dom = { - arrayContains: K, - isHtmlNamespace: c, - parentElement: d, - getNodeIndex: e, - getNodeLength: f, - getCommonAncestor: g, - isAncestorOf: h, - isOrIsAncestorOf: i, - getClosestAncestorIn: j, - isCharacterDataNode: k, - isTextOrCommentNode: l, - insertAfter: m, - splitDataNode: n, - getDocument: o, - getWindow: p, - getIframeWindow: r, - getIframeDocument: q, - getBody: H, - isWindow: s, - getContentDocument: t, - getRootContainer: u, - comparePoints: v, - isBrokenNode: w, - inspectNode: x, - getComputedStyleProperty: M, - createTestElement: z, - removeNode: A, - fragmentFromNodeChildren: y, - createIterator: C, - DomPosition: D, - }), - (a.DOMException = E); - }), - H.createCoreModule("DomRange", ["DomUtil"], function (a, b) { - function c(a, b) { - return 3 != a.nodeType && (P(a, b.startContainer) || P(a, b.endContainer)); - } - function d(a) { - return a.document || Q(a.startContainer); - } - function e(a) { - return W(a.startContainer); - } - function f(a) { - return new L(a.parentNode, O(a)); - } - function g(a) { - return new L(a.parentNode, O(a) + 1); - } - function h(a, b, c) { - var d = 11 == a.nodeType ? a.firstChild : a; - return ( - N(b) - ? c == b.length - ? J.insertAfter(a, b) - : b.parentNode.insertBefore(a, 0 == c ? b : S(b, c)) - : c >= b.childNodes.length - ? b.appendChild(a) - : b.insertBefore(a, b.childNodes[c]), - d - ); - } - function i(a, b, c) { - if ((z(a), z(b), d(b) != d(a))) throw new M("WRONG_DOCUMENT_ERR"); - var e = R(a.startContainer, a.startOffset, b.endContainer, b.endOffset), - f = R(a.endContainer, a.endOffset, b.startContainer, b.startOffset); - return c ? 0 >= e && f >= 0 : 0 > e && f > 0; - } - function j(a) { - for (var b, c, e, f = d(a.range).createDocumentFragment(); (c = a.next()); ) { - if ( - ((b = a.isPartiallySelectedSubtree()), - (c = c.cloneNode(!b)), - b && ((e = a.getSubtreeIterator()), c.appendChild(j(e)), e.detach()), - 10 == c.nodeType) - ) - throw new M("HIERARCHY_REQUEST_ERR"); - f.appendChild(c); - } - return f; - } - function k(a, b, c) { - var d, e; - c = c || { stop: !1 }; - for (var f, g; (f = a.next()); ) - if (a.isPartiallySelectedSubtree()) { - if (b(f) === !1) return void (c.stop = !0); - if (((g = a.getSubtreeIterator()), k(g, b, c), g.detach(), c.stop)) return; - } else for (d = J.createIterator(f); (e = d.next()); ) if (b(e) === !1) return void (c.stop = !0); - } - function l(a) { - for (var b; a.next(); ) - a.isPartiallySelectedSubtree() ? ((b = a.getSubtreeIterator()), l(b), b.detach()) : a.remove(); - } - function m(a) { - for (var b, c, e = d(a.range).createDocumentFragment(); (b = a.next()); ) { - if ( - (a.isPartiallySelectedSubtree() - ? ((b = b.cloneNode(!1)), (c = a.getSubtreeIterator()), b.appendChild(m(c)), c.detach()) - : a.remove(), - 10 == b.nodeType) - ) - throw new M("HIERARCHY_REQUEST_ERR"); - e.appendChild(b); - } - return e; - } - function n(a, b, c) { - var d, - e = !(!b || !b.length), - f = !!c; - e && (d = new RegExp("^(" + b.join("|") + ")$")); - var g = []; - return ( - k(new p(a, !1), function (b) { - if ((!e || d.test(b.nodeType)) && (!f || c(b))) { - var h = a.startContainer; - if (b != h || !N(h) || a.startOffset != h.length) { - var i = a.endContainer; - (b == i && N(i) && 0 == a.endOffset) || g.push(b); - } - } - }), - g - ); - } - function o(a) { - var b = "undefined" == typeof a.getName ? "Range" : a.getName(); - return ( - "[" + - b + - "(" + - J.inspectNode(a.startContainer) + - ":" + - a.startOffset + - ", " + - J.inspectNode(a.endContainer) + - ":" + - a.endOffset + - ")]" - ); - } - function p(a, b) { - if (((this.range = a), (this.clonePartiallySelectedTextNodes = b), !a.collapsed)) { - (this.sc = a.startContainer), (this.so = a.startOffset), (this.ec = a.endContainer), (this.eo = a.endOffset); - var c = a.commonAncestorContainer; - this.sc === this.ec && N(this.sc) - ? ((this.isSingleCharacterDataNode = !0), (this._first = this._last = this._next = this.sc)) - : ((this._first = this._next = - this.sc !== c || N(this.sc) ? T(this.sc, c, !0) : this.sc.childNodes[this.so]), - (this._last = this.ec !== c || N(this.ec) ? T(this.ec, c, !0) : this.ec.childNodes[this.eo - 1])); - } - } - function q(a) { - return function (b, c) { - for (var d, e = c ? b : b.parentNode; e; ) { - if (((d = e.nodeType), V(a, d))) return e; - e = e.parentNode; - } - return null; - }; - } - function r(a, b) { - if (ea(a, b)) throw new M("INVALID_NODE_TYPE_ERR"); - } - function s(a, b) { - if (!V(b, a.nodeType)) throw new M("INVALID_NODE_TYPE_ERR"); - } - function t(a, b) { - if (0 > b || b > (N(a) ? a.length : a.childNodes.length)) throw new M("INDEX_SIZE_ERR"); - } - function u(a, b) { - if (ca(a, !0) !== ca(b, !0)) throw new M("WRONG_DOCUMENT_ERR"); - } - function v(a) { - if (da(a, !0)) throw new M("NO_MODIFICATION_ALLOWED_ERR"); - } - function w(a, b) { - if (!a) throw new M(b); - } - function x(a, b) { - return b <= (N(a) ? a.length : a.childNodes.length); - } - function y(a) { - return ( - !!a.startContainer && - !!a.endContainer && - !(X && (J.isBrokenNode(a.startContainer) || J.isBrokenNode(a.endContainer))) && - W(a.startContainer) == W(a.endContainer) && - x(a.startContainer, a.startOffset) && - x(a.endContainer, a.endOffset) - ); - } - function z(a) { - if (!y(a)) - throw new Error( - "Range error: Range is not valid. This usually happens after DOM mutation. Range: (" + a.inspect() + ")" - ); - } - function A(a, b) { - z(a); - var c = a.startContainer, - d = a.startOffset, - e = a.endContainer, - f = a.endOffset, - g = c === e; - N(e) && f > 0 && f < e.length && S(e, f, b), - N(c) && - d > 0 && - d < c.length && - ((c = S(c, d, b)), g ? ((f -= d), (e = c)) : e == c.parentNode && f >= O(c) && f++, (d = 0)), - a.setStartAndEnd(c, d, e, f); - } - function B(a) { - z(a); - var b = a.commonAncestorContainer.parentNode.cloneNode(!1); - return b.appendChild(a.cloneContents()), b.innerHTML; - } - function C(a) { - (a.START_TO_START = ka), - (a.START_TO_END = la), - (a.END_TO_END = ma), - (a.END_TO_START = na), - (a.NODE_BEFORE = oa), - (a.NODE_AFTER = pa), - (a.NODE_BEFORE_AND_AFTER = qa), - (a.NODE_INSIDE = ra); - } - function D(a) { - C(a), C(a.prototype); - } - function E(a, b) { - return function () { - z(this); - var c, - d, - e = this.startContainer, - f = this.startOffset, - h = this.commonAncestorContainer, - i = new p(this, !0); - e !== h && ((c = T(e, h, !0)), (d = g(c)), (e = d.node), (f = d.offset)), k(i, v), i.reset(); - var j = a(i); - return i.detach(), b(this, e, f, e, f), j; - }; - } - function F(b, d) { - function e(a, b) { - return function (c) { - s(c, Z), s(W(c), $); - var d = (a ? f : g)(c); - (b ? h : i)(this, d.node, d.offset); - }; - } - function h(a, b, c) { - var e = a.endContainer, - f = a.endOffset; - (b !== a.startContainer || c !== a.startOffset) && - ((W(b) != W(e) || 1 == R(b, c, e, f)) && ((e = b), (f = c)), d(a, b, c, e, f)); - } - function i(a, b, c) { - var e = a.startContainer, - f = a.startOffset; - (b !== a.endContainer || c !== a.endOffset) && - ((W(b) != W(e) || -1 == R(b, c, e, f)) && ((e = b), (f = c)), d(a, e, f, b, c)); - } - var j = function () {}; - (j.prototype = a.rangePrototype), - (b.prototype = new j()), - K.extend(b.prototype, { - setStart: function (a, b) { - r(a, !0), t(a, b), h(this, a, b); - }, - setEnd: function (a, b) { - r(a, !0), t(a, b), i(this, a, b); - }, - setStartAndEnd: function () { - var a = arguments, - b = a[0], - c = a[1], - e = b, - f = c; - switch (a.length) { - case 3: - f = a[2]; - break; - case 4: - (e = a[2]), (f = a[3]); - } - d(this, b, c, e, f); - }, - setBoundary: function (a, b, c) { - this["set" + (c ? "Start" : "End")](a, b); - }, - setStartBefore: e(!0, !0), - setStartAfter: e(!1, !0), - setEndBefore: e(!0, !1), - setEndAfter: e(!1, !1), - collapse: function (a) { - z(this), - a - ? d(this, this.startContainer, this.startOffset, this.startContainer, this.startOffset) - : d(this, this.endContainer, this.endOffset, this.endContainer, this.endOffset); - }, - selectNodeContents: function (a) { - r(a, !0), d(this, a, 0, a, U(a)); - }, - selectNode: function (a) { - r(a, !1), s(a, Z); - var b = f(a), - c = g(a); - d(this, b.node, b.offset, c.node, c.offset); - }, - extractContents: E(m, d), - deleteContents: E(l, d), - canSurroundContents: function () { - z(this), v(this.startContainer), v(this.endContainer); - var a = new p(this, !0), - b = (a._first && c(a._first, this)) || (a._last && c(a._last, this)); - return a.detach(), !b; - }, - splitBoundaries: function () { - A(this); - }, - splitBoundariesPreservingPositions: function (a) { - A(this, a); - }, - normalizeBoundaries: function () { - z(this); - var a, - b = this.startContainer, - c = this.startOffset, - e = this.endContainer, - f = this.endOffset, - g = function (a) { - var b = a.nextSibling; - b && b.nodeType == a.nodeType && ((e = a), (f = a.length), a.appendData(b.data), Y(b)); - }, - h = function (a) { - var d = a.previousSibling; - if (d && d.nodeType == a.nodeType) { - b = a; - var g = a.length; - if (((c = d.length), a.insertData(0, d.data), Y(d), b == e)) (f += c), (e = b); - else if (e == a.parentNode) { - var h = O(a); - f == h ? ((e = a), (f = g)) : f > h && f--; - } - } - }, - i = !0; - if (N(e)) - f == e.length - ? g(e) - : 0 == f && - ((a = e.previousSibling), - a && - a.nodeType == e.nodeType && - ((f = a.length), b == e && (i = !1), a.appendData(e.data), Y(e), (e = a))); - else { - if (f > 0) { - var j = e.childNodes[f - 1]; - j && N(j) && g(j); - } - i = !this.collapsed; - } - if (i) { - if (N(b)) - 0 == c - ? h(b) - : c == b.length && - ((a = b.nextSibling), - a && - a.nodeType == b.nodeType && - (e == a && ((e = b), (f += b.length)), b.appendData(a.data), Y(a))); - else if (c < b.childNodes.length) { - var k = b.childNodes[c]; - k && N(k) && h(k); - } - } else (b = e), (c = f); - d(this, b, c, e, f); - }, - collapseToPoint: function (a, b) { - r(a, !0), t(a, b), this.setStartAndEnd(a, b); - }, - }), - D(b); - } - function G(a) { - (a.collapsed = a.startContainer === a.endContainer && a.startOffset === a.endOffset), - (a.commonAncestorContainer = a.collapsed - ? a.startContainer - : J.getCommonAncestor(a.startContainer, a.endContainer)); - } - function H(a, b, c, d, e) { - (a.startContainer = b), - (a.startOffset = c), - (a.endContainer = d), - (a.endOffset = e), - (a.document = J.getDocument(b)), - G(a); - } - function I(a) { - (this.startContainer = a), - (this.startOffset = 0), - (this.endContainer = a), - (this.endOffset = 0), - (this.document = a), - G(this); - } - var J = a.dom, - K = a.util, - L = J.DomPosition, - M = a.DOMException, - N = J.isCharacterDataNode, - O = J.getNodeIndex, - P = J.isOrIsAncestorOf, - Q = J.getDocument, - R = J.comparePoints, - S = J.splitDataNode, - T = J.getClosestAncestorIn, - U = J.getNodeLength, - V = J.arrayContains, - W = J.getRootContainer, - X = a.features.crashyTextNodes, - Y = J.removeNode; - p.prototype = { - _current: null, - _next: null, - _first: null, - _last: null, - isSingleCharacterDataNode: !1, - reset: function () { - (this._current = null), (this._next = this._first); - }, - hasNext: function () { - return !!this._next; - }, - next: function () { - var a = (this._current = this._next); - return ( - a && - ((this._next = a !== this._last ? a.nextSibling : null), - N(a) && - this.clonePartiallySelectedTextNodes && - (a === this.ec && (a = a.cloneNode(!0)).deleteData(this.eo, a.length - this.eo), - this._current === this.sc && (a = a.cloneNode(!0)).deleteData(0, this.so))), - a - ); - }, - remove: function () { - var a, - b, - c = this._current; - !N(c) || (c !== this.sc && c !== this.ec) - ? c.parentNode && Y(c) - : ((a = c === this.sc ? this.so : 0), - (b = c === this.ec ? this.eo : c.length), - a != b && c.deleteData(a, b - a)); - }, - isPartiallySelectedSubtree: function () { - var a = this._current; - return c(a, this.range); - }, - getSubtreeIterator: function () { - var a; - if (this.isSingleCharacterDataNode) (a = this.range.cloneRange()), a.collapse(!1); - else { - a = new I(d(this.range)); - var b = this._current, - c = b, - e = 0, - f = b, - g = U(b); - P(b, this.sc) && ((c = this.sc), (e = this.so)), - P(b, this.ec) && ((f = this.ec), (g = this.eo)), - H(a, c, e, f, g); - } - return new p(a, this.clonePartiallySelectedTextNodes); - }, - detach: function () { - this.range = - this._current = - this._next = - this._first = - this._last = - this.sc = - this.so = - this.ec = - this.eo = - null; - }, - }; - var Z = [1, 3, 4, 5, 7, 8, 10], - $ = [2, 9, 11], - _ = [5, 6, 10, 12], - aa = [1, 3, 4, 5, 7, 8, 10, 11], - ba = [1, 3, 4, 5, 7, 8], - ca = q([9, 11]), - da = q(_), - ea = q([6, 10, 12]), - fa = document.createElement("style"), - ga = !1; - try { - (fa.innerHTML = "x"), (ga = 3 == fa.firstChild.nodeType); - } catch (ha) {} - a.features.htmlParsingConforms = ga; - var ia = ga - ? function (a) { - var b = this.startContainer, - c = Q(b); - if (!b) throw new M("INVALID_STATE_ERR"); - var d = null; - return ( - 1 == b.nodeType ? (d = b) : N(b) && (d = J.parentElement(b)), - (d = - null === d || - ("HTML" == d.nodeName && J.isHtmlNamespace(Q(d).documentElement) && J.isHtmlNamespace(d)) - ? c.createElement("body") - : d.cloneNode(!1)), - (d.innerHTML = a), - J.fragmentFromNodeChildren(d) - ); - } - : function (a) { - var b = d(this), - c = b.createElement("body"); - return (c.innerHTML = a), J.fragmentFromNodeChildren(c); - }, - ja = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed", "commonAncestorContainer"], - ka = 0, - la = 1, - ma = 2, - na = 3, - oa = 0, - pa = 1, - qa = 2, - ra = 3; - K.extend(a.rangePrototype, { - compareBoundaryPoints: function (a, b) { - z(this), u(this.startContainer, b.startContainer); - var c, - d, - e, - f, - g = a == na || a == ka ? "start" : "end", - h = a == la || a == ka ? "start" : "end"; - return ( - (c = this[g + "Container"]), - (d = this[g + "Offset"]), - (e = b[h + "Container"]), - (f = b[h + "Offset"]), - R(c, d, e, f) - ); - }, - insertNode: function (a) { - if ((z(this), s(a, aa), v(this.startContainer), P(a, this.startContainer))) - throw new M("HIERARCHY_REQUEST_ERR"); - var b = h(a, this.startContainer, this.startOffset); - this.setStartBefore(b); - }, - cloneContents: function () { - z(this); - var a, b; - if (this.collapsed) return d(this).createDocumentFragment(); - if (this.startContainer === this.endContainer && N(this.startContainer)) - return ( - (a = this.startContainer.cloneNode(!0)), - (a.data = a.data.slice(this.startOffset, this.endOffset)), - (b = d(this).createDocumentFragment()), - b.appendChild(a), - b - ); - var c = new p(this, !0); - return (a = j(c)), c.detach(), a; - }, - canSurroundContents: function () { - z(this), v(this.startContainer), v(this.endContainer); - var a = new p(this, !0), - b = (a._first && c(a._first, this)) || (a._last && c(a._last, this)); - return a.detach(), !b; - }, - surroundContents: function (a) { - if ((s(a, ba), !this.canSurroundContents())) throw new M("INVALID_STATE_ERR"); - var b = this.extractContents(); - if (a.hasChildNodes()) for (; a.lastChild; ) a.removeChild(a.lastChild); - h(a, this.startContainer, this.startOffset), a.appendChild(b), this.selectNode(a); - }, - cloneRange: function () { - z(this); - for (var a, b = new I(d(this)), c = ja.length; c--; ) (a = ja[c]), (b[a] = this[a]); - return b; - }, - toString: function () { - z(this); - var a = this.startContainer; - if (a === this.endContainer && N(a)) - return 3 == a.nodeType || 4 == a.nodeType ? a.data.slice(this.startOffset, this.endOffset) : ""; - var b = [], - c = new p(this, !0); - return ( - k(c, function (a) { - (3 == a.nodeType || 4 == a.nodeType) && b.push(a.data); - }), - c.detach(), - b.join("") - ); - }, - compareNode: function (a) { - z(this); - var b = a.parentNode, - c = O(a); - if (!b) throw new M("NOT_FOUND_ERR"); - var d = this.comparePoint(b, c), - e = this.comparePoint(b, c + 1); - return 0 > d ? (e > 0 ? qa : oa) : e > 0 ? pa : ra; - }, - comparePoint: function (a, b) { - return ( - z(this), - w(a, "HIERARCHY_REQUEST_ERR"), - u(a, this.startContainer), - R(a, b, this.startContainer, this.startOffset) < 0 - ? -1 - : R(a, b, this.endContainer, this.endOffset) > 0 - ? 1 - : 0 - ); - }, - createContextualFragment: ia, - toHtml: function () { - return B(this); - }, - intersectsNode: function (a, b) { - if ((z(this), W(a) != e(this))) return !1; - var c = a.parentNode, - d = O(a); - if (!c) return !0; - var f = R(c, d, this.endContainer, this.endOffset), - g = R(c, d + 1, this.startContainer, this.startOffset); - return b ? 0 >= f && g >= 0 : 0 > f && g > 0; - }, - isPointInRange: function (a, b) { - return ( - z(this), - w(a, "HIERARCHY_REQUEST_ERR"), - u(a, this.startContainer), - R(a, b, this.startContainer, this.startOffset) >= 0 && R(a, b, this.endContainer, this.endOffset) <= 0 - ); - }, - intersectsRange: function (a) { - return i(this, a, !1); - }, - intersectsOrTouchesRange: function (a) { - return i(this, a, !0); - }, - intersection: function (a) { - if (this.intersectsRange(a)) { - var b = R(this.startContainer, this.startOffset, a.startContainer, a.startOffset), - c = R(this.endContainer, this.endOffset, a.endContainer, a.endOffset), - d = this.cloneRange(); - return ( - -1 == b && d.setStart(a.startContainer, a.startOffset), 1 == c && d.setEnd(a.endContainer, a.endOffset), d - ); - } - return null; - }, - union: function (a) { - if (this.intersectsOrTouchesRange(a)) { - var b = this.cloneRange(); - return ( - -1 == R(a.startContainer, a.startOffset, this.startContainer, this.startOffset) && - b.setStart(a.startContainer, a.startOffset), - 1 == R(a.endContainer, a.endOffset, this.endContainer, this.endOffset) && - b.setEnd(a.endContainer, a.endOffset), - b - ); - } - throw new M("Ranges do not intersect"); - }, - containsNode: function (a, b) { - return b ? this.intersectsNode(a, !1) : this.compareNode(a) == ra; - }, - containsNodeContents: function (a) { - return this.comparePoint(a, 0) >= 0 && this.comparePoint(a, U(a)) <= 0; - }, - containsRange: function (a) { - var b = this.intersection(a); - return null !== b && a.equals(b); - }, - containsNodeText: function (a) { - var b = this.cloneRange(); - b.selectNode(a); - var c = b.getNodes([3]); - if (c.length > 0) { - b.setStart(c[0], 0); - var d = c.pop(); - return b.setEnd(d, d.length), this.containsRange(b); - } - return this.containsNodeContents(a); - }, - getNodes: function (a, b) { - return z(this), n(this, a, b); - }, - getDocument: function () { - return d(this); - }, - collapseBefore: function (a) { - this.setEndBefore(a), this.collapse(!1); - }, - collapseAfter: function (a) { - this.setStartAfter(a), this.collapse(!0); - }, - getBookmark: function (b) { - var c = d(this), - e = a.createRange(c); - (b = b || J.getBody(c)), e.selectNodeContents(b); - var f = this.intersection(e), - g = 0, - h = 0; - return ( - f && (e.setEnd(f.startContainer, f.startOffset), (g = e.toString().length), (h = g + f.toString().length)), - { start: g, end: h, containerNode: b } - ); - }, - moveToBookmark: function (a) { - var b = a.containerNode, - c = 0; - this.setStart(b, 0), this.collapse(!0); - for (var d, e, f, g, h = [b], i = !1, j = !1; !j && (d = h.pop()); ) - if (3 == d.nodeType) - (e = c + d.length), - !i && a.start >= c && a.start <= e && (this.setStart(d, a.start - c), (i = !0)), - i && a.end >= c && a.end <= e && (this.setEnd(d, a.end - c), (j = !0)), - (c = e); - else for (g = d.childNodes, f = g.length; f--; ) h.push(g[f]); - }, - getName: function () { - return "DomRange"; - }, - equals: function (a) { - return I.rangesEqual(this, a); - }, - isValid: function () { - return y(this); - }, - inspect: function () { - return o(this); - }, - detach: function () {}, - }), - F(I, H), - K.extend(I, { - rangeProperties: ja, - RangeIterator: p, - copyComparisonConstants: D, - createPrototypeRange: F, - inspect: o, - toHtml: B, - getRangeDocument: d, - rangesEqual: function (a, b) { - return ( - a.startContainer === b.startContainer && - a.startOffset === b.startOffset && - a.endContainer === b.endContainer && - a.endOffset === b.endOffset - ); - }, - }), - (a.DomRange = I); - }), - H.createCoreModule("WrappedRange", ["DomRange"], function (a, b) { - var c, - d, - e = a.dom, - f = a.util, - g = e.DomPosition, - h = a.DomRange, - i = e.getBody, - j = e.getContentDocument, - k = e.isCharacterDataNode; - if ( - (a.features.implementsDomRange && - !(function () { - function d(a) { - for (var b, c = m.length; c--; ) (b = m[c]), (a[b] = a.nativeRange[b]); - a.collapsed = a.startContainer === a.endContainer && a.startOffset === a.endOffset; - } - function g(a, b, c, d, e) { - var f = a.startContainer !== b || a.startOffset != c, - g = a.endContainer !== d || a.endOffset != e, - h = !a.equals(a.nativeRange); - (f || g || h) && (a.setEnd(d, e), a.setStart(b, c)); - } - var k, - l, - m = h.rangeProperties; - (c = function (a) { - if (!a) throw b.createError("WrappedRange: Range must be specified"); - (this.nativeRange = a), d(this); - }), - h.createPrototypeRange(c, g), - (k = c.prototype), - (k.selectNode = function (a) { - this.nativeRange.selectNode(a), d(this); - }), - (k.cloneContents = function () { - return this.nativeRange.cloneContents(); - }), - (k.surroundContents = function (a) { - this.nativeRange.surroundContents(a), d(this); - }), - (k.collapse = function (a) { - this.nativeRange.collapse(a), d(this); - }), - (k.cloneRange = function () { - return new c(this.nativeRange.cloneRange()); - }), - (k.refresh = function () { - d(this); - }), - (k.toString = function () { - return this.nativeRange.toString(); - }); - var n = document.createTextNode("test"); - i(document).appendChild(n); - var o = document.createRange(); - o.setStart(n, 0), o.setEnd(n, 0); - try { - o.setStart(n, 1), - (k.setStart = function (a, b) { - this.nativeRange.setStart(a, b), d(this); - }), - (k.setEnd = function (a, b) { - this.nativeRange.setEnd(a, b), d(this); - }), - (l = function (a) { - return function (b) { - this.nativeRange[a](b), d(this); - }; - }); - } catch (p) { - (k.setStart = function (a, b) { - try { - this.nativeRange.setStart(a, b); - } catch (c) { - this.nativeRange.setEnd(a, b), this.nativeRange.setStart(a, b); - } - d(this); - }), - (k.setEnd = function (a, b) { - try { - this.nativeRange.setEnd(a, b); - } catch (c) { - this.nativeRange.setStart(a, b), this.nativeRange.setEnd(a, b); - } - d(this); - }), - (l = function (a, b) { - return function (c) { - try { - this.nativeRange[a](c); - } catch (e) { - this.nativeRange[b](c), this.nativeRange[a](c); - } - d(this); - }; - }); - } - (k.setStartBefore = l("setStartBefore", "setEndBefore")), - (k.setStartAfter = l("setStartAfter", "setEndAfter")), - (k.setEndBefore = l("setEndBefore", "setStartBefore")), - (k.setEndAfter = l("setEndAfter", "setStartAfter")), - (k.selectNodeContents = function (a) { - this.setStartAndEnd(a, 0, e.getNodeLength(a)); - }), - o.selectNodeContents(n), - o.setEnd(n, 3); - var q = document.createRange(); - q.selectNodeContents(n), - q.setEnd(n, 4), - q.setStart(n, 2), - -1 == o.compareBoundaryPoints(o.START_TO_END, q) && 1 == o.compareBoundaryPoints(o.END_TO_START, q) - ? (k.compareBoundaryPoints = function (a, b) { - return ( - (b = b.nativeRange || b), - a == b.START_TO_END ? (a = b.END_TO_START) : a == b.END_TO_START && (a = b.START_TO_END), - this.nativeRange.compareBoundaryPoints(a, b) - ); - }) - : (k.compareBoundaryPoints = function (a, b) { - return this.nativeRange.compareBoundaryPoints(a, b.nativeRange || b); - }); - var r = document.createElement("div"); - r.innerHTML = "123"; - var s = r.firstChild, - t = i(document); - t.appendChild(r), - o.setStart(s, 1), - o.setEnd(s, 2), - o.deleteContents(), - "13" == s.data && - ((k.deleteContents = function () { - this.nativeRange.deleteContents(), d(this); - }), - (k.extractContents = function () { - var a = this.nativeRange.extractContents(); - return d(this), a; - })), - t.removeChild(r), - (t = null), - f.isHostMethod(o, "createContextualFragment") && - (k.createContextualFragment = function (a) { - return this.nativeRange.createContextualFragment(a); - }), - i(document).removeChild(n), - (k.getName = function () { - return "WrappedRange"; - }), - (a.WrappedRange = c), - (a.createNativeRange = function (a) { - return (a = j(a, b, "createNativeRange")), a.createRange(); - }); - })(), - a.features.implementsTextRange) - ) { - var l = function (a) { - var b = a.parentElement(), - c = a.duplicate(); - c.collapse(!0); - var d = c.parentElement(); - (c = a.duplicate()), c.collapse(!1); - var f = c.parentElement(), - g = d == f ? d : e.getCommonAncestor(d, f); - return g == b ? g : e.getCommonAncestor(b, g); - }, - m = function (a) { - return 0 == a.compareEndPoints("StartToEnd", a); - }, - n = function (a, b, c, d, f) { - var h = a.duplicate(); - h.collapse(c); - var i = h.parentElement(); - if ((e.isOrIsAncestorOf(b, i) || (i = b), !i.canHaveHTML)) { - var j = new g(i.parentNode, e.getNodeIndex(i)); - return { boundaryPosition: j, nodeInfo: { nodeIndex: j.offset, containerElement: j.node } }; - } - var l = e.getDocument(i).createElement("span"); - l.parentNode && e.removeNode(l); - for ( - var m, - n, - o, - p, - q, - r = c ? "StartToStart" : "StartToEnd", - s = f && f.containerElement == i ? f.nodeIndex : 0, - t = i.childNodes.length, - u = t, - v = u; - ; - - ) { - if ( - (v == t ? i.appendChild(l) : i.insertBefore(l, i.childNodes[v]), - h.moveToElementText(l), - (m = h.compareEndPoints(r, a)), - 0 == m || s == u) - ) - break; - if (-1 == m) { - if (u == s + 1) break; - s = v; - } else u = u == s + 1 ? s : v; - (v = Math.floor((s + u) / 2)), i.removeChild(l); - } - if (((q = l.nextSibling), -1 == m && q && k(q))) { - h.setEndPoint(c ? "EndToStart" : "EndToEnd", a); - var w; - if (/[\r\n]/.test(q.data)) { - var x = h.duplicate(), - y = x.text.replace(/\r\n/g, "\r").length; - for (w = x.moveStart("character", y); -1 == (m = x.compareEndPoints("StartToEnd", x)); ) - w++, x.moveStart("character", 1); - } else w = h.text.length; - p = new g(q, w); - } else - (n = (d || !c) && l.previousSibling), - (o = (d || c) && l.nextSibling), - (p = o && k(o) ? new g(o, 0) : n && k(n) ? new g(n, n.data.length) : new g(i, e.getNodeIndex(l))); - return e.removeNode(l), { boundaryPosition: p, nodeInfo: { nodeIndex: v, containerElement: i } }; - }, - o = function (a, b) { - var c, - d, - f, - g, - h = a.offset, - j = e.getDocument(a.node), - l = i(j).createTextRange(), - m = k(a.node); - return ( - m - ? ((c = a.node), (d = c.parentNode)) - : ((g = a.node.childNodes), (c = h < g.length ? g[h] : null), (d = a.node)), - (f = j.createElement("span")), - (f.innerHTML = "&#feff;"), - c ? d.insertBefore(f, c) : d.appendChild(f), - l.moveToElementText(f), - l.collapse(!b), - d.removeChild(f), - m && l[b ? "moveStart" : "moveEnd"]("character", h), - l - ); - }; - (d = function (a) { - (this.textRange = a), this.refresh(); - }), - (d.prototype = new h(document)), - (d.prototype.refresh = function () { - var a, - b, - c, - d = l(this.textRange); - m(this.textRange) - ? (b = a = n(this.textRange, d, !0, !0).boundaryPosition) - : ((c = n(this.textRange, d, !0, !1)), - (a = c.boundaryPosition), - (b = n(this.textRange, d, !1, !1, c.nodeInfo).boundaryPosition)), - this.setStart(a.node, a.offset), - this.setEnd(b.node, b.offset); - }), - (d.prototype.getName = function () { - return "WrappedTextRange"; - }), - h.copyComparisonConstants(d); - var p = function (a) { - if (a.collapsed) return o(new g(a.startContainer, a.startOffset), !0); - var b = o(new g(a.startContainer, a.startOffset), !0), - c = o(new g(a.endContainer, a.endOffset), !1), - d = i(h.getRangeDocument(a)).createTextRange(); - return d.setEndPoint("StartToStart", b), d.setEndPoint("EndToEnd", c), d; - }; - if ( - ((d.rangeToTextRange = p), - (d.prototype.toTextRange = function () { - return p(this); - }), - (a.WrappedTextRange = d), - !a.features.implementsDomRange || a.config.preferTextRange) - ) { - var q = (function (a) { - return a("return this;")(); - })(Function); - "undefined" == typeof q.Range && (q.Range = d), - (a.createNativeRange = function (a) { - return (a = j(a, b, "createNativeRange")), i(a).createTextRange(); - }), - (a.WrappedRange = d); - } - } - (a.createRange = function (c) { - return (c = j(c, b, "createRange")), new a.WrappedRange(a.createNativeRange(c)); - }), - (a.createRangyRange = function (a) { - return (a = j(a, b, "createRangyRange")), new h(a); - }), - f.createAliasForDeprecatedMethod(a, "createIframeRange", "createRange"), - f.createAliasForDeprecatedMethod(a, "createIframeRangyRange", "createRangyRange"), - a.addShimListener(function (b) { - var c = b.document; - "undefined" == typeof c.createRange && - (c.createRange = function () { - return a.createRange(c); - }), - (c = b = null); - }); - }), - H.createCoreModule("WrappedSelection", ["DomRange", "WrappedRange"], function (a, b) { - function c(a) { - return "string" == typeof a ? /^backward(s)?$/i.test(a) : !!a; - } - function d(a, c) { - if (a) { - if (C.isWindow(a)) return a; - if (a instanceof r) return a.win; - var d = C.getContentDocument(a, b, c); - return C.getWindow(d); - } - return window; - } - function e(a) { - return d(a, "getWinSelection").getSelection(); - } - function f(a) { - return d(a, "getDocSelection").document.selection; - } - function g(a) { - var b = !1; - return a.anchorNode && (b = 1 == C.comparePoints(a.anchorNode, a.anchorOffset, a.focusNode, a.focusOffset)), b; - } - function h(a, b, c) { - var d = c ? "end" : "start", - e = c ? "start" : "end"; - (a.anchorNode = b[d + "Container"]), - (a.anchorOffset = b[d + "Offset"]), - (a.focusNode = b[e + "Container"]), - (a.focusOffset = b[e + "Offset"]); - } - function i(a) { - var b = a.nativeSelection; - (a.anchorNode = b.anchorNode), - (a.anchorOffset = b.anchorOffset), - (a.focusNode = b.focusNode), - (a.focusOffset = b.focusOffset); - } - function j(a) { - (a.anchorNode = a.focusNode = null), - (a.anchorOffset = a.focusOffset = 0), - (a.rangeCount = 0), - (a.isCollapsed = !0), - (a._ranges.length = 0); - } - function k(b) { - var c; - return ( - b instanceof F - ? ((c = a.createNativeRange(b.getDocument())), - c.setEnd(b.endContainer, b.endOffset), - c.setStart(b.startContainer, b.startOffset)) - : b instanceof G - ? (c = b.nativeRange) - : J.implementsDomRange && b instanceof C.getWindow(b.startContainer).Range && (c = b), - c - ); - } - function l(a) { - if (!a.length || 1 != a[0].nodeType) return !1; - for (var b = 1, c = a.length; c > b; ++b) if (!C.isAncestorOf(a[0], a[b])) return !1; - return !0; - } - function m(a) { - var c = a.getNodes(); - if (!l(c)) - throw b.createError( - "getSingleElementFromRange: range " + a.inspect() + " did not consist of a single element" - ); - return c[0]; - } - function n(a) { - return !!a && "undefined" != typeof a.text; - } - function o(a, b) { - var c = new G(b); - (a._ranges = [c]), h(a, c, !1), (a.rangeCount = 1), (a.isCollapsed = c.collapsed); - } - function p(b) { - if (((b._ranges.length = 0), "None" == b.docSelection.type)) j(b); - else { - var c = b.docSelection.createRange(); - if (n(c)) o(b, c); - else { - b.rangeCount = c.length; - for (var d, e = L(c.item(0)), f = 0; f < b.rangeCount; ++f) - (d = a.createRange(e)), d.selectNode(c.item(f)), b._ranges.push(d); - (b.isCollapsed = 1 == b.rangeCount && b._ranges[0].collapsed), h(b, b._ranges[b.rangeCount - 1], !1); - } - } - } - function q(a, c) { - for ( - var d = a.docSelection.createRange(), - e = m(c), - f = L(d.item(0)), - g = M(f).createControlRange(), - h = 0, - i = d.length; - i > h; - ++h - ) - g.add(d.item(h)); - try { - g.add(e); - } catch (j) { - throw b.createError( - "addRange(): Element within the specified Range could not be added to control selection (does it have layout?)" - ); - } - g.select(), p(a); - } - function r(a, b, c) { - (this.nativeSelection = a), (this.docSelection = b), (this._ranges = []), (this.win = c), this.refresh(); - } - function s(a) { - (a.win = a.anchorNode = a.focusNode = a._ranges = null), - (a.rangeCount = a.anchorOffset = a.focusOffset = 0), - (a.detached = !0); - } - function t(a, b) { - for (var c, d, e = ba.length; e--; ) - if (((c = ba[e]), (d = c.selection), "deleteAll" == b)) s(d); - else if (c.win == a) return "delete" == b ? (ba.splice(e, 1), !0) : d; - return "deleteAll" == b && (ba.length = 0), null; - } - function u(a, c) { - for (var d, e = L(c[0].startContainer), f = M(e).createControlRange(), g = 0, h = c.length; h > g; ++g) { - d = m(c[g]); - try { - f.add(d); - } catch (i) { - throw b.createError( - "setRanges(): Element within one of the specified Ranges could not be added to control selection (does it have layout?)" - ); - } - } - f.select(), p(a); - } - function v(a, b) { - if (a.win.document != L(b)) throw new H("WRONG_DOCUMENT_ERR"); - } - function w(b) { - return function (c, d) { - var e; - this.rangeCount - ? ((e = this.getRangeAt(0)), e["set" + (b ? "Start" : "End")](c, d)) - : ((e = a.createRange(this.win.document)), e.setStartAndEnd(c, d)), - this.setSingleRange(e, this.isBackward()); - }; - } - function x(a) { - var b = [], - c = new I(a.anchorNode, a.anchorOffset), - d = new I(a.focusNode, a.focusOffset), - e = "function" == typeof a.getName ? a.getName() : "Selection"; - if ("undefined" != typeof a.rangeCount) - for (var f = 0, g = a.rangeCount; g > f; ++f) b[f] = F.inspect(a.getRangeAt(f)); - return "[" + e + "(Ranges: " + b.join(", ") + ")(anchor: " + c.inspect() + ", focus: " + d.inspect() + "]"; - } - a.config.checkSelectionRanges = !0; - var y, - z, - A = "boolean", - B = "number", - C = a.dom, - D = a.util, - E = D.isHostMethod, - F = a.DomRange, - G = a.WrappedRange, - H = a.DOMException, - I = C.DomPosition, - J = a.features, - K = "Control", - L = C.getDocument, - M = C.getBody, - N = F.rangesEqual, - O = E(window, "getSelection"), - P = D.isHostObject(document, "selection"); - (J.implementsWinGetSelection = O), (J.implementsDocSelection = P); - var Q = P && (!O || a.config.preferTextRange); - if (Q) - (y = f), - (a.isSelectionValid = function (a) { - var b = d(a, "isSelectionValid").document, - c = b.selection; - return "None" != c.type || L(c.createRange().parentElement()) == b; - }); - else { - if (!O) return b.fail("Neither document.selection or window.getSelection() detected."), !1; - (y = e), - (a.isSelectionValid = function () { - return !0; - }); - } - a.getNativeSelection = y; - var R = y(); - if (!R) return b.fail("Native selection was null (possibly issue 138?)"), !1; - var S = a.createNativeRange(document), - T = M(document), - U = D.areHostProperties(R, ["anchorNode", "focusNode", "anchorOffset", "focusOffset"]); - J.selectionHasAnchorAndFocus = U; - var V = E(R, "extend"); - J.selectionHasExtend = V; - var W = typeof R.rangeCount == B; - J.selectionHasRangeCount = W; - var X = !1, - Y = !0, - Z = V - ? function (b, c) { - var d = F.getRangeDocument(c), - e = a.createRange(d); - e.collapseToPoint(c.endContainer, c.endOffset), - b.addRange(k(e)), - b.extend(c.startContainer, c.startOffset); - } - : null; - D.areHostMethods(R, ["addRange", "getRangeAt", "removeAllRanges"]) && - typeof R.rangeCount == B && - J.implementsDomRange && - !(function () { - var b = window.getSelection(); - if (b) { - for (var c = b.rangeCount, d = c > 1, e = [], f = g(b), h = 0; c > h; ++h) e[h] = b.getRangeAt(h); - var i = C.createTestElement(document, "", !1), - j = i.appendChild(document.createTextNode("   ")), - k = document.createRange(); - if ( - (k.setStart(j, 1), - k.collapse(!0), - b.removeAllRanges(), - b.addRange(k), - (Y = 1 == b.rangeCount), - b.removeAllRanges(), - !d) - ) { - var l = window.navigator.appVersion.match(/Chrome\/(.*?) /); - if (l && parseInt(l[1]) >= 36) X = !1; - else { - var m = k.cloneRange(); - k.setStart(j, 0), - m.setEnd(j, 3), - m.setStart(j, 2), - b.addRange(k), - b.addRange(m), - (X = 2 == b.rangeCount); - } - } - for (C.removeNode(i), b.removeAllRanges(), h = 0; c > h; ++h) - 0 == h && f - ? Z - ? Z(b, e[h]) - : (a.warn( - "Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend" - ), - b.addRange(e[h])) - : b.addRange(e[h]); - } - })(), - (J.selectionSupportsMultipleRanges = X), - (J.collapsedNonEditableSelectionsSupported = Y); - var $, - _ = !1; - T && - E(T, "createControlRange") && - (($ = T.createControlRange()), D.areHostProperties($, ["item", "add"]) && (_ = !0)), - (J.implementsControlRange = _), - (z = U - ? function (a) { - return a.anchorNode === a.focusNode && a.anchorOffset === a.focusOffset; - } - : function (a) { - return a.rangeCount ? a.getRangeAt(a.rangeCount - 1).collapsed : !1; - }); - var aa; - E(R, "getRangeAt") - ? (aa = function (a, b) { - try { - return a.getRangeAt(b); - } catch (c) { - return null; - } - }) - : U && - (aa = function (b) { - var c = L(b.anchorNode), - d = a.createRange(c); - return ( - d.setStartAndEnd(b.anchorNode, b.anchorOffset, b.focusNode, b.focusOffset), - d.collapsed !== this.isCollapsed && - d.setStartAndEnd(b.focusNode, b.focusOffset, b.anchorNode, b.anchorOffset), - d - ); - }), - (r.prototype = a.selectionPrototype); - var ba = [], - ca = function (a) { - if (a && a instanceof r) return a.refresh(), a; - a = d(a, "getNativeSelection"); - var b = t(a), - c = y(a), - e = P ? f(a) : null; - return ( - b - ? ((b.nativeSelection = c), (b.docSelection = e), b.refresh()) - : ((b = new r(c, e, a)), ba.push({ win: a, selection: b })), - b - ); - }; - (a.getSelection = ca), D.createAliasForDeprecatedMethod(a, "getIframeSelection", "getSelection"); - var da = r.prototype; - if (!Q && U && D.areHostMethods(R, ["removeAllRanges", "addRange"])) { - da.removeAllRanges = function () { - this.nativeSelection.removeAllRanges(), j(this); - }; - var ea = function (a, b) { - Z(a.nativeSelection, b), a.refresh(); - }; - W - ? (da.addRange = function (b, d) { - if (_ && P && this.docSelection.type == K) q(this, b); - else if (c(d) && V) ea(this, b); - else { - var e; - X ? (e = this.rangeCount) : (this.removeAllRanges(), (e = 0)); - var f = k(b).cloneRange(); - try { - this.nativeSelection.addRange(f); - } catch (g) {} - if (((this.rangeCount = this.nativeSelection.rangeCount), this.rangeCount == e + 1)) { - if (a.config.checkSelectionRanges) { - var i = aa(this.nativeSelection, this.rangeCount - 1); - i && !N(i, b) && (b = new G(i)); - } - (this._ranges[this.rangeCount - 1] = b), - h(this, b, ha(this.nativeSelection)), - (this.isCollapsed = z(this)); - } else this.refresh(); - } - }) - : (da.addRange = function (a, b) { - c(b) && V ? ea(this, a) : (this.nativeSelection.addRange(k(a)), this.refresh()); - }), - (da.setRanges = function (a) { - if (_ && P && a.length > 1) u(this, a); - else { - this.removeAllRanges(); - for (var b = 0, c = a.length; c > b; ++b) this.addRange(a[b]); - } - }); - } else { - if (!(E(R, "empty") && E(S, "select") && _ && Q)) - return b.fail("No means of selecting a Range or TextRange was found"), !1; - (da.removeAllRanges = function () { - try { - if ((this.docSelection.empty(), "None" != this.docSelection.type)) { - var a; - if (this.anchorNode) a = L(this.anchorNode); - else if (this.docSelection.type == K) { - var b = this.docSelection.createRange(); - b.length && (a = L(b.item(0))); - } - if (a) { - var c = M(a).createTextRange(); - c.select(), this.docSelection.empty(); - } - } - } catch (d) {} - j(this); - }), - (da.addRange = function (b) { - this.docSelection.type == K - ? q(this, b) - : (a.WrappedTextRange.rangeToTextRange(b).select(), - (this._ranges[0] = b), - (this.rangeCount = 1), - (this.isCollapsed = this._ranges[0].collapsed), - h(this, b, !1)); - }), - (da.setRanges = function (a) { - this.removeAllRanges(); - var b = a.length; - b > 1 ? u(this, a) : b && this.addRange(a[0]); - }); - } - da.getRangeAt = function (a) { - if (0 > a || a >= this.rangeCount) throw new H("INDEX_SIZE_ERR"); - return this._ranges[a].cloneRange(); - }; - var fa; - if (Q) - fa = function (b) { - var c; - a.isSelectionValid(b.win) - ? (c = b.docSelection.createRange()) - : ((c = M(b.win.document).createTextRange()), c.collapse(!0)), - b.docSelection.type == K ? p(b) : n(c) ? o(b, c) : j(b); - }; - else if (E(R, "getRangeAt") && typeof R.rangeCount == B) - fa = function (b) { - if (_ && P && b.docSelection.type == K) p(b); - else if (((b._ranges.length = b.rangeCount = b.nativeSelection.rangeCount), b.rangeCount)) { - for (var c = 0, d = b.rangeCount; d > c; ++c) - b._ranges[c] = new a.WrappedRange(b.nativeSelection.getRangeAt(c)); - h(b, b._ranges[b.rangeCount - 1], ha(b.nativeSelection)), (b.isCollapsed = z(b)); - } else j(b); - }; - else { - if (!U || typeof R.isCollapsed != A || typeof S.collapsed != A || !J.implementsDomRange) - return b.fail("No means of obtaining a Range or TextRange from the user's selection was found"), !1; - fa = function (a) { - var b, - c = a.nativeSelection; - c.anchorNode ? ((b = aa(c, 0)), (a._ranges = [b]), (a.rangeCount = 1), i(a), (a.isCollapsed = z(a))) : j(a); - }; - } - da.refresh = function (a) { - var b = a ? this._ranges.slice(0) : null, - c = this.anchorNode, - d = this.anchorOffset; - if ((fa(this), a)) { - var e = b.length; - if (e != this._ranges.length) return !0; - if (this.anchorNode != c || this.anchorOffset != d) return !0; - for (; e--; ) if (!N(b[e], this._ranges[e])) return !0; - return !1; - } - }; - var ga = function (a, b) { - var c = a.getAllRanges(); - a.removeAllRanges(); - for (var d = 0, e = c.length; e > d; ++d) N(b, c[d]) || a.addRange(c[d]); - a.rangeCount || j(a); - }; - _ && P - ? (da.removeRange = function (a) { - if (this.docSelection.type == K) { - for ( - var b, - c = this.docSelection.createRange(), - d = m(a), - e = L(c.item(0)), - f = M(e).createControlRange(), - g = !1, - h = 0, - i = c.length; - i > h; - ++h - ) - (b = c.item(h)), b !== d || g ? f.add(c.item(h)) : (g = !0); - f.select(), p(this); - } else ga(this, a); - }) - : (da.removeRange = function (a) { - ga(this, a); - }); - var ha; - !Q && U && J.implementsDomRange - ? ((ha = g), - (da.isBackward = function () { - return ha(this); - })) - : (ha = da.isBackward = - function () { - return !1; - }), - (da.isBackwards = da.isBackward), - (da.toString = function () { - for (var a = [], b = 0, c = this.rangeCount; c > b; ++b) a[b] = "" + this._ranges[b]; - return a.join(""); - }), - (da.collapse = function (b, c) { - v(this, b); - var d = a.createRange(b); - d.collapseToPoint(b, c), this.setSingleRange(d), (this.isCollapsed = !0); - }), - (da.collapseToStart = function () { - if (!this.rangeCount) throw new H("INVALID_STATE_ERR"); - var a = this._ranges[0]; - this.collapse(a.startContainer, a.startOffset); - }), - (da.collapseToEnd = function () { - if (!this.rangeCount) throw new H("INVALID_STATE_ERR"); - var a = this._ranges[this.rangeCount - 1]; - this.collapse(a.endContainer, a.endOffset); - }), - (da.selectAllChildren = function (b) { - v(this, b); - var c = a.createRange(b); - c.selectNodeContents(b), this.setSingleRange(c); - }), - (da.deleteFromDocument = function () { - if (_ && P && this.docSelection.type == K) { - for (var a, b = this.docSelection.createRange(); b.length; ) (a = b.item(0)), b.remove(a), C.removeNode(a); - this.refresh(); - } else if (this.rangeCount) { - var c = this.getAllRanges(); - if (c.length) { - this.removeAllRanges(); - for (var d = 0, e = c.length; e > d; ++d) c[d].deleteContents(); - this.addRange(c[e - 1]); - } - } - }), - (da.eachRange = function (a, b) { - for (var c = 0, d = this._ranges.length; d > c; ++c) if (a(this.getRangeAt(c))) return b; - }), - (da.getAllRanges = function () { - var a = []; - return ( - this.eachRange(function (b) { - a.push(b); - }), - a - ); - }), - (da.setSingleRange = function (a, b) { - this.removeAllRanges(), this.addRange(a, b); - }), - (da.callMethodOnEachRange = function (a, b) { - var c = []; - return ( - this.eachRange(function (d) { - c.push(d[a].apply(d, b || [])); - }), - c - ); - }), - (da.setStart = w(!0)), - (da.setEnd = w(!1)), - (a.rangePrototype.select = function (a) { - ca(this.getDocument()).setSingleRange(this, a); - }), - (da.changeEachRange = function (a) { - var b = [], - c = this.isBackward(); - this.eachRange(function (c) { - a(c), b.push(c); - }), - this.removeAllRanges(), - c && 1 == b.length ? this.addRange(b[0], "backward") : this.setRanges(b); - }), - (da.containsNode = function (a, b) { - return ( - this.eachRange(function (c) { - return c.containsNode(a, b); - }, !0) || !1 - ); - }), - (da.getBookmark = function (a) { - return { backward: this.isBackward(), rangeBookmarks: this.callMethodOnEachRange("getBookmark", [a]) }; - }), - (da.moveToBookmark = function (b) { - for (var c, d, e = [], f = 0; (c = b.rangeBookmarks[f++]); ) - (d = a.createRange(this.win)), d.moveToBookmark(c), e.push(d); - b.backward ? this.setSingleRange(e[0], "backward") : this.setRanges(e); - }), - (da.saveRanges = function () { - return { backward: this.isBackward(), ranges: this.callMethodOnEachRange("cloneRange") }; - }), - (da.restoreRanges = function (a) { - this.removeAllRanges(); - for (var b, c = 0; (b = a.ranges[c]); ++c) this.addRange(b, a.backward && 0 == c); - }), - (da.toHtml = function () { - var a = []; - return ( - this.eachRange(function (b) { - a.push(F.toHtml(b)); - }), - a.join("") - ); - }), - J.implementsTextRange && - (da.getNativeTextRange = function () { - var c; - if ((c = this.docSelection)) { - var d = c.createRange(); - if (n(d)) return d; - throw b.createError("getNativeTextRange: selection is a control selection"); - } - if (this.rangeCount > 0) return a.WrappedTextRange.rangeToTextRange(this.getRangeAt(0)); - throw b.createError("getNativeTextRange: selection contains no range"); - }), - (da.getName = function () { - return "WrappedSelection"; - }), - (da.inspect = function () { - return x(this); - }), - (da.detach = function () { - t(this.win, "delete"), s(this); - }), - (r.detachAll = function () { - t(null, "deleteAll"); - }), - (r.inspect = x), - (r.isDirectionBackward = c), - (a.Selection = r), - (a.selectionPrototype = da), - a.addShimListener(function (a) { - "undefined" == typeof a.getSelection && - (a.getSelection = function () { - return ca(a); - }), - (a = null); - }); - }); - var M = !1, - N = function (a) { - M || ((M = !0), !H.initialized && H.config.autoInitialize && l()); - }; - F && - ("complete" == document.readyState - ? N() - : (a(document, "addEventListener") && document.addEventListener("DOMContentLoaded", N, !1), - J(window, "load", N))), - (rangy = H); -})(), - rangy.createModule("SaveRestore", ["WrappedRange"], function (a, b) { - function c(a, b) { - return (b || document).getElementById(a); - } - function d(a, b) { - var c, - d = "selectionBoundary_" + +new Date() + "_" + ("" + Math.random()).slice(2), - e = o.getDocument(a.startContainer), - f = a.cloneRange(); - return ( - f.collapse(b), - (c = e.createElement("span")), - (c.id = d), - (c.style.lineHeight = "0"), - (c.style.display = "none"), - (c.className = "rangySelectionBoundary"), - c.appendChild(e.createTextNode(r)), - f.insertNode(c), - c - ); - } - function e(a, d, e, f) { - var g = c(e, a); - g - ? (d[f ? "setStartBefore" : "setEndBefore"](g), p(g)) - : b.warn("Marker element has been removed. Cannot restore selection."); - } - function f(a, b) { - return b.compareBoundaryPoints(a.START_TO_START, a); - } - function g(b, c) { - var e, - f, - g = a.DomRange.getRangeDocument(b), - h = b.toString(), - i = q(c); - return b.collapsed - ? ((f = d(b, !1)), { document: g, markerId: f.id, collapsed: !0 }) - : ((f = d(b, !1)), - (e = d(b, !0)), - { - document: g, - startMarkerId: e.id, - endMarkerId: f.id, - collapsed: !1, - backward: i, - toString: function () { - return "original text: '" + h + "', new text: '" + b.toString() + "'"; - }, - }); - } - function h(d, f) { - var g = d.document; - "undefined" == typeof f && (f = !0); - var h = a.createRange(g); - if (d.collapsed) { - var i = c(d.markerId, g); - if (i) { - i.style.display = "inline"; - var j = i.previousSibling; - j && 3 == j.nodeType ? (p(i), h.collapseToPoint(j, j.length)) : (h.collapseBefore(i), p(i)); - } else b.warn("Marker element has been removed. Cannot restore selection."); - } else e(g, h, d.startMarkerId, !0), e(g, h, d.endMarkerId, !1); - return f && h.normalizeBoundaries(), h; - } - function i(b, d) { - var e, - h, - i = [], - j = q(d); - (b = b.slice(0)), b.sort(f); - for (var k = 0, l = b.length; l > k; ++k) i[k] = g(b[k], j); - for (k = l - 1; k >= 0; --k) - (e = b[k]), - (h = a.DomRange.getRangeDocument(e)), - e.collapsed - ? e.collapseAfter(c(i[k].markerId, h)) - : (e.setEndBefore(c(i[k].endMarkerId, h)), e.setStartAfter(c(i[k].startMarkerId, h))); - return i; - } - function j(c) { - if (!a.isSelectionValid(c)) - return ( - b.warn( - "Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus." - ), - null - ); - var d = a.getSelection(c), - e = d.getAllRanges(), - f = 1 == e.length && d.isBackward(), - g = i(e, f); - return f ? d.setSingleRange(e[0], f) : d.setRanges(e), { win: c, rangeInfos: g, restored: !1 }; - } - function k(a) { - for (var b = [], c = a.length, d = c - 1; d >= 0; d--) b[d] = h(a[d], !0); - return b; - } - function l(b, c) { - if (!b.restored) { - var d = b.rangeInfos, - e = a.getSelection(b.win), - f = k(d), - g = d.length; - 1 == g && c && a.features.selectionHasExtend && d[0].backward - ? (e.removeAllRanges(), e.addRange(f[0], !0)) - : e.setRanges(f), - (b.restored = !0); - } - } - function m(a, b) { - var d = c(b, a); - d && p(d); - } - function n(a) { - for (var b, c = a.rangeInfos, d = 0, e = c.length; e > d; ++d) - (b = c[d]), b.collapsed ? m(a.doc, b.markerId) : (m(a.doc, b.startMarkerId), m(a.doc, b.endMarkerId)); - } - var o = a.dom, - p = o.removeNode, - q = a.Selection.isDirectionBackward, - r = "\ufeff"; - a.util.extend(a, { - saveRange: g, - restoreRange: h, - saveRanges: i, - restoreRanges: k, - saveSelection: j, - restoreSelection: l, - removeMarkerElement: m, - removeMarkers: n, - }); - }), - rangy.createModule("TextRange", ["WrappedSelection"], function (a, b) { - function c(a, b) { - function c(a, b, c) { - h.push({ start: a, end: b, isWord: c }); - } - for (var d, e, f, g = a.join(""), h = [], i = 0; (d = b.wordRegex.exec(g)); ) { - if (((e = d.index), (f = e + d[0].length), e > i && c(i, e, !1), b.includeTrailingSpace)) - for (; $.test(a[f]); ) ++f; - c(e, f, !0), (i = f); - } - return i < a.length && c(i, a.length, !1), h; - } - function d(a, b) { - for ( - var c = a.slice(b.start, b.end), - d = { - isWord: b.isWord, - chars: c, - toString: function () { - return c.join(""); - }, - }, - e = 0, - f = c.length; - f > e; - ++e - ) - c[e].token = d; - return d; - } - function e(a, b, c) { - for (var e, f = c(a, b), g = [], h = 0; (e = f[h++]); ) g.push(d(a, e)); - return g; - } - function f(a) { - var b = a || "", - c = "string" == typeof b ? b.split("") : b; - return ( - c.sort(function (a, b) { - return a.charCodeAt(0) - b.charCodeAt(0); - }), - c.join("").replace(/(.)\1+/g, "$1") - ); - } - function g(a) { - var b, c; - return a ? ((b = a.language || _), (c = {}), U(c, ia[b] || ia[_]), U(c, a), c) : ia[_]; - } - function h(a, b) { - var c = V(a, b); - return ( - b.hasOwnProperty("wordOptions") && (c.wordOptions = g(c.wordOptions)), - b.hasOwnProperty("characterOptions") && (c.characterOptions = V(c.characterOptions, ga)), - c - ); - } - function i(a, b) { - var c = na(a, "display", b), - d = a.tagName.toLowerCase(); - return "block" == c && fa && oa.hasOwnProperty(d) ? oa[d] : c; - } - function j(a) { - for (var b = o(a), c = 0, d = b.length; d > c; ++c) if (1 == b[c].nodeType && "none" == i(b[c])) return !0; - return !1; - } - function k(a) { - var b; - return 3 == a.nodeType && (b = a.parentNode) && "hidden" == na(b, "visibility"); - } - function l(a) { - return ( - a && ((1 == a.nodeType && !/^(inline(-block|-table)?|none)$/.test(i(a))) || 9 == a.nodeType || 11 == a.nodeType) - ); - } - function m(a) { - return ( - S.isCharacterDataNode(a) || - !/^(area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param)$/i.test(a.nodeName) - ); - } - function n(a) { - for (var b = []; a.parentNode; ) b.unshift(a.parentNode), (a = a.parentNode); - return b; - } - function o(a) { - return n(a).concat([a]); - } - function p(a) { - for (; a && !a.nextSibling; ) a = a.parentNode; - return a ? a.nextSibling : null; - } - function q(a, b) { - return !b && a.hasChildNodes() ? a.firstChild : p(a); - } - function r(a) { - var b = a.previousSibling; - if (b) { - for (a = b; a.hasChildNodes(); ) a = a.lastChild; - return a; - } - var c = a.parentNode; - return c && 1 == c.nodeType ? c : null; - } - function s(a) { - if (!a || 3 != a.nodeType) return !1; - var b = a.data; - if ("" === b) return !0; - var c = a.parentNode; - if (!c || 1 != c.nodeType) return !1; - var d = na(a.parentNode, "whiteSpace"); - return (/^[\t\n\r ]+$/.test(b) && /^(normal|nowrap)$/.test(d)) || (/^[\t\r ]+$/.test(b) && "pre-line" == d); - } - function t(a) { - if ("" === a.data) return !0; - if (!s(a)) return !1; - var b = a.parentNode; - return b ? (j(a) ? !0 : !1) : !0; - } - function u(a) { - var b = a.nodeType; - return 7 == b || 8 == b || j(a) || /^(script|style)$/i.test(a.nodeName) || k(a) || t(a); - } - function v(a, b) { - var c = a.nodeType; - return 7 == c || 8 == c || (1 == c && "none" == i(a, b)); - } - function w() { - this.store = {}; - } - function x(a, b, c) { - return function (d) { - var e = this.cache; - if (e.hasOwnProperty(a)) return pa++, e[a]; - qa++; - var f = b.call(this, c ? this[c] : this, d); - return (e[a] = f), f; - }; - } - function y(a, b) { - (this.node = a), (this.session = b), (this.cache = new w()), (this.positions = new w()); - } - function z(a, b) { - (this.offset = b), - (this.nodeWrapper = a), - (this.node = a.node), - (this.session = a.session), - (this.cache = new w()); - } - function A() { - return "[Position(" + S.inspectNode(this.node) + ":" + this.offset + ")]"; - } - function B() { - return D(), (Da = new Ea()); - } - function C() { - return Da || B(); - } - function D() { - Da && Da.detach(), (Da = null); - } - function E(a, c, d, e) { - function f() { - var a = null; - return ( - c - ? ((a = h), i || ((h = h.previousVisible()), (i = !h || (d && h.equals(d))))) - : i || ((a = h = h.nextVisible()), (i = !h || (d && h.equals(d)))), - i && (h = null), - a - ); - } - d && (c ? u(d.node) && (d = a.previousVisible()) : u(d.node) && (d = d.nextVisible())); - var g, - h = a, - i = !1, - j = !1; - return { - next: function () { - if (j) return (j = !1), g; - for (var a, b; (a = f()); ) if ((b = a.getCharacter(e))) return (g = a), a; - return null; - }, - rewind: function () { - if (!g) throw b.createError("createCharacterIterator: cannot rewind. Only one position can be rewound."); - j = !0; - }, - dispose: function () { - a = d = null; - }, - }; - } - function F(a, b, c) { - function d(a) { - for (var b, c, d = [], e = a ? f : g, h = !1, i = !1; (b = e.next()); ) { - if (((c = b.character), Z.test(c))) i && ((i = !1), (h = !0)); - else { - if (h) { - e.rewind(); - break; - } - i = !0; - } - d.push(b); - } - return d; - } - var f = E(a, !1, null, b), - g = E(a, !0, null, b), - h = c.tokenizer, - i = d(!0), - j = d(!1).reverse(), - k = e(j.concat(i), c, h), - l = i.length ? k.slice(Fa(k, i[0].token)) : [], - m = j.length ? k.slice(0, Fa(k, j.pop().token) + 1) : []; - return { - nextEndToken: function () { - for (var a, b; 1 == l.length && !(a = l[0]).isWord && (b = d(!0)).length > 0; ) - l = e(a.chars.concat(b), c, h); - return l.shift(); - }, - previousStartToken: function () { - for (var a, b; 1 == m.length && !(a = m[0]).isWord && (b = d(!1)).length > 0; ) - m = e(b.reverse().concat(a.chars), c, h); - return m.pop(); - }, - dispose: function () { - f.dispose(), g.dispose(), (l = m = null); - }, - }; - } - function G(a, b, c, d, e) { - var f, - g, - h, - i, - j = 0, - k = a, - l = Math.abs(c); - if (0 !== c) { - var m = 0 > c; - switch (b) { - case Q: - for (g = E(a, m, null, d); (f = g.next()) && l > j; ) ++j, (k = f); - (h = f), g.dispose(); - break; - case R: - for (var n = F(a, d, e), o = m ? n.previousStartToken : n.nextEndToken; (i = o()) && l > j; ) - i.isWord && (++j, (k = m ? i.chars[0] : i.chars[i.chars.length - 1])); - break; - default: - throw new Error("movePositionBy: unit '" + b + "' not implemented"); - } - m - ? ((k = k.previousVisible()), (j = -j)) - : k && - k.isLeadingSpace && - !k.isTrailingSpace && - (b == R && ((g = E(a, !1, null, d)), (h = g.next()), g.dispose()), h && (k = h.previousVisible())); - } - return { position: k, unitsMoved: j }; - } - function H(a, b, c, d) { - var e = a.getRangeBoundaryPosition(b, !0), - f = a.getRangeBoundaryPosition(b, !1), - g = d ? f : e, - h = d ? e : f; - return E(g, !!d, h, c); - } - function I(a, b, c) { - for (var d, e = [], f = H(a, b, c); (d = f.next()); ) e.push(d); - return f.dispose(), e; - } - function J(b, c, d) { - var e = a.createRange(b.node); - return e.setStartAndEnd(b.node, b.offset, c.node, c.offset), !e.expand("word", { wordOptions: d }); - } - function K(a, b, c, d, e) { - function f(a, b) { - var c = p[a].previousVisible(), - d = p[b - 1], - f = !e.wholeWordsOnly || J(c, d, e.wordOptions); - return { startPos: c, endPos: d, valid: f }; - } - for ( - var g, - h, - i, - j, - k, - l, - m = aa(e.direction), - n = E(a, m, a.session.getRangeBoundaryPosition(d, m), e.characterOptions), - o = "", - p = [], - q = null; - (g = n.next()); - - ) - if ( - ((h = g.character), - c || e.caseSensitive || (h = h.toLowerCase()), - m ? (p.unshift(g), (o = h + o)) : (p.push(g), (o += h)), - c) - ) { - if ((k = b.exec(o))) - if (((i = k.index), (j = i + k[0].length), l)) { - if ((!m && j < o.length) || (m && i > 0)) { - q = f(i, j); - break; - } - } else l = !0; - } else if (-1 != (i = o.indexOf(b))) { - q = f(i, i + b.length); - break; - } - return l && (q = f(i, j)), n.dispose(), q; - } - function L(a) { - return function () { - var b = !!Da, - c = C(), - d = [c].concat(T.toArray(arguments)), - e = a.apply(this, d); - return b || D(), e; - }; - } - function M(a, b) { - return L(function (c, d, e, f) { - typeof e == P && ((e = d), (d = Q)), (f = h(f, ka)); - var g = a; - b && ((g = e >= 0), this.collapse(!g)); - var i = G(c.getRangeBoundaryPosition(this, g), d, e, f.characterOptions, f.wordOptions), - j = i.position; - return this[g ? "setStart" : "setEnd"](j.node, j.offset), i.unitsMoved; - }); - } - function N(a) { - return L(function (b, c) { - c = V(c, ga); - for (var d, e = H(b, this, c, !a), f = 0; (d = e.next()) && Z.test(d.character); ) ++f; - e.dispose(); - var g = f > 0; - return g && this[a ? "moveStart" : "moveEnd"]("character", a ? f : -f, { characterOptions: c }), g; - }); - } - function O(a) { - return L(function (b, c) { - var d = !1; - return ( - this.changeEachRange(function (b) { - d = b[a](c) || d; - }), - d - ); - }); - } - var P = "undefined", - Q = "character", - R = "word", - S = a.dom, - T = a.util, - U = T.extend, - V = T.createOptions, - W = S.getBody, - X = /^[ \t\f\r\n]+$/, - Y = /^[ \t\f\r]+$/, - Z = /^[\t-\r \u0085\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]+$/, - $ = /^[\t \u00A0\u1680\u180E\u2000-\u200B\u202F\u205F\u3000]+$/, - _ = "en", - aa = a.Selection.isDirectionBackward, - ba = !1, - ca = !1, - da = !1, - ea = !0; - !(function () { - var b = S.createTestElement(document, "

        1

        ", !0), - c = b.firstChild, - d = a.getSelection(); - d.collapse(c.lastChild, 2), - d.setStart(c.firstChild, 0), - (ba = 1 == ("" + d).length), - (b.innerHTML = "1
        "), - d.collapse(b, 2), - d.setStart(b.firstChild, 0), - (ca = 1 == ("" + d).length), - (b.innerHTML = "1

        1

        "), - d.collapse(b, 2), - d.setStart(b.firstChild, 0), - (da = 1 == ("" + d).length), - S.removeNode(b), - d.removeAllRanges(); - })(); - var fa, - ga = { - includeBlockContentTrailingSpace: !0, - includeSpaceBeforeBr: !0, - includeSpaceBeforeBlock: !0, - includePreLineTrailingSpace: !0, - ignoreCharacters: "", - }, - ha = { - includeBlockContentTrailingSpace: !ea, - includeSpaceBeforeBr: !ca, - includeSpaceBeforeBlock: !da, - includePreLineTrailingSpace: !0, - }, - ia = { en: { wordRegex: /[a-z0-9]+('[a-z0-9]+)*/gi, includeTrailingSpace: !1, tokenizer: c } }, - ja = { - caseSensitive: !1, - withinRange: null, - wholeWordsOnly: !1, - wrap: !1, - direction: "forward", - wordOptions: null, - characterOptions: null, - }, - ka = { wordOptions: null, characterOptions: null }, - la = { wordOptions: null, characterOptions: null, trim: !1, trimStart: !0, trimEnd: !0 }, - ma = { wordOptions: null, characterOptions: null, direction: "forward" }, - na = S.getComputedStyleProperty; - !(function () { - var a = document.createElement("table"), - b = W(document); - b.appendChild(a), (fa = "block" == na(a, "display")), b.removeChild(a); - })(); - var oa = { - table: "table", - caption: "table-caption", - colgroup: "table-column-group", - col: "table-column", - thead: "table-header-group", - tbody: "table-row-group", - tfoot: "table-footer-group", - tr: "table-row", - td: "table-cell", - th: "table-cell", - }; - w.prototype = { - get: function (a) { - return this.store.hasOwnProperty(a) ? this.store[a] : null; - }, - set: function (a, b) { - return (this.store[a] = b); - }, - }; - var pa = 0, - qa = 0, - ra = { - getPosition: function (a) { - var b = this.positions; - return b.get(a) || b.set(a, new z(this, a)); - }, - toString: function () { - return "[NodeWrapper(" + S.inspectNode(this.node) + ")]"; - }, - }; - y.prototype = ra; - var sa = "EMPTY", - ta = "NON_SPACE", - ua = "UNCOLLAPSIBLE_SPACE", - va = "COLLAPSIBLE_SPACE", - wa = "TRAILING_SPACE_BEFORE_BLOCK", - xa = "TRAILING_SPACE_IN_BLOCK", - ya = "TRAILING_SPACE_BEFORE_BR", - za = "PRE_LINE_TRAILING_SPACE_BEFORE_LINE_BREAK", - Aa = "TRAILING_LINE_BREAK_AFTER_BR", - Ba = "INCLUDED_TRAILING_LINE_BREAK_AFTER_BR"; - U(ra, { - isCharacterDataNode: x("isCharacterDataNode", S.isCharacterDataNode, "node"), - getNodeIndex: x("nodeIndex", S.getNodeIndex, "node"), - getLength: x("nodeLength", S.getNodeLength, "node"), - containsPositions: x("containsPositions", m, "node"), - isWhitespace: x("isWhitespace", s, "node"), - isCollapsedWhitespace: x("isCollapsedWhitespace", t, "node"), - getComputedDisplay: x("computedDisplay", i, "node"), - isCollapsed: x("collapsed", u, "node"), - isIgnored: x("ignored", v, "node"), - next: x("nextPos", q, "node"), - previous: x("previous", r, "node"), - getTextNodeInfo: x( - "textNodeInfo", - function (a) { - var b = null, - c = !1, - d = na(a.parentNode, "whiteSpace"), - e = "pre-line" == d; - return ( - e ? ((b = Y), (c = !0)) : ("normal" == d || "nowrap" == d) && ((b = X), (c = !0)), - { node: a, text: a.data, spaceRegex: b, collapseSpaces: c, preLine: e } - ); - }, - "node" - ), - hasInnerText: x( - "hasInnerText", - function (a, b) { - for ( - var c = this.session, - d = c.getPosition(a.parentNode, this.getNodeIndex() + 1), - e = c.getPosition(a, 0), - f = b ? d : e, - g = b ? e : d; - f !== g; - - ) { - if ((f.prepopulateChar(), f.isDefinitelyNonEmpty())) return !0; - f = b ? f.previousVisible() : f.nextVisible(); - } - return !1; - }, - "node" - ), - isRenderedBlock: x( - "isRenderedBlock", - function (a) { - for (var b = a.getElementsByTagName("br"), c = 0, d = b.length; d > c; ++c) if (!u(b[c])) return !0; - return this.hasInnerText(); - }, - "node" - ), - getTrailingSpace: x( - "trailingSpace", - function (a) { - if ("br" == a.tagName.toLowerCase()) return ""; - switch (this.getComputedDisplay()) { - case "inline": - for (var b = a.lastChild; b; ) { - if (!v(b)) return 1 == b.nodeType ? this.session.getNodeWrapper(b).getTrailingSpace() : ""; - b = b.previousSibling; - } - break; - case "inline-block": - case "inline-table": - case "none": - case "table-column": - case "table-column-group": - break; - case "table-cell": - return " "; - default: - return this.isRenderedBlock(!0) ? "\n" : ""; - } - return ""; - }, - "node" - ), - getLeadingSpace: x( - "leadingSpace", - function (a) { - switch (this.getComputedDisplay()) { - case "inline": - case "inline-block": - case "inline-table": - case "none": - case "table-column": - case "table-column-group": - case "table-cell": - break; - default: - return this.isRenderedBlock(!1) ? "\n" : ""; - } - return ""; - }, - "node" - ), - }); - var Ca = { - character: "", - characterType: sa, - isBr: !1, - prepopulateChar: function () { - var a = this; - if (!a.prepopulatedChar) { - var b = a.node, - c = a.offset, - d = "", - e = sa, - f = !1; - if (c > 0) - if (3 == b.nodeType) { - var g = b.data, - h = g.charAt(c - 1), - i = a.nodeWrapper.getTextNodeInfo(), - j = i.spaceRegex; - i.collapseSpaces - ? j.test(h) - ? (c > 1 && j.test(g.charAt(c - 2))) || - (i.preLine && "\n" === g.charAt(c) ? ((d = " "), (e = za)) : ((d = " "), (e = va))) - : ((d = h), (e = ta), (f = !0)) - : ((d = h), (e = ua), (f = !0)); - } else { - var k = b.childNodes[c - 1]; - if ( - (k && - 1 == k.nodeType && - !u(k) && - ("br" == k.tagName.toLowerCase() - ? ((d = "\n"), (a.isBr = !0), (e = va), (f = !1)) - : (a.checkForTrailingSpace = !0)), - !d) - ) { - var l = b.childNodes[c]; - l && 1 == l.nodeType && !u(l) && (a.checkForLeadingSpace = !0); - } - } - (a.prepopulatedChar = !0), (a.character = d), (a.characterType = e), (a.isCharInvariant = f); - } - }, - isDefinitelyNonEmpty: function () { - var a = this.characterType; - return a == ta || a == ua; - }, - resolveLeadingAndTrailingSpaces: function () { - if ((this.prepopulatedChar || this.prepopulateChar(), this.checkForTrailingSpace)) { - var a = this.session.getNodeWrapper(this.node.childNodes[this.offset - 1]).getTrailingSpace(); - a && ((this.isTrailingSpace = !0), (this.character = a), (this.characterType = va)), - (this.checkForTrailingSpace = !1); - } - if (this.checkForLeadingSpace) { - var b = this.session.getNodeWrapper(this.node.childNodes[this.offset]).getLeadingSpace(); - b && ((this.isLeadingSpace = !0), (this.character = b), (this.characterType = va)), - (this.checkForLeadingSpace = !1); - } - }, - getPrecedingUncollapsedPosition: function (a) { - for (var b, c = this; (c = c.previousVisible()); ) if (((b = c.getCharacter(a)), "" !== b)) return c; - return null; - }, - getCharacter: function (a) { - function b() { - return n || ((k = o.getPrecedingUncollapsedPosition(a)), (n = !0)), k; - } - this.resolveLeadingAndTrailingSpaces(); - var c, - d = this.character, - e = f(a.ignoreCharacters), - g = "" !== d && e.indexOf(d) > -1; - if (this.isCharInvariant) return (c = g ? "" : d); - var h = [ - "character", - a.includeSpaceBeforeBr, - a.includeBlockContentTrailingSpace, - a.includePreLineTrailingSpace, - e, - ].join("_"), - i = this.cache.get(h); - if (null !== i) return i; - var j, - k, - l = "", - m = this.characterType == va, - n = !1, - o = this; - return ( - m && - (this.type == Ba - ? (l = "\n") - : (" " == d && - (!b() || - k.isTrailingSpace || - "\n" == k.character || - (" " == k.character && k.characterType == va))) || - ("\n" == d && this.isLeadingSpace - ? b() && "\n" != k.character && (l = "\n") - : ((j = this.nextUncollapsed()), - j && - (j.isBr - ? (this.type = ya) - : j.isTrailingSpace && "\n" == j.character - ? (this.type = xa) - : j.isLeadingSpace && "\n" == j.character && (this.type = wa), - "\n" == j.character - ? (this.type != ya || a.includeSpaceBeforeBr) && - (this.type != wa || a.includeSpaceBeforeBlock) && - ((this.type == xa && j.isTrailingSpace && !a.includeBlockContentTrailingSpace) || - ((this.type != za || j.type != ta || a.includePreLineTrailingSpace) && - ("\n" == d - ? j.isTrailingSpace - ? this.isTrailingSpace || - (this.isBr && - ((j.type = Aa), - b() && k.isLeadingSpace && !k.isTrailingSpace && "\n" == k.character - ? (j.character = "") - : (j.type = Ba))) - : (l = "\n") - : " " == d && (l = " ")))) - : (l = d))))), - e.indexOf(l) > -1 && (l = ""), - this.cache.set(h, l), - l - ); - }, - equals: function (a) { - return !!a && this.node === a.node && this.offset === a.offset; - }, - inspect: A, - toString: function () { - return this.character; - }, - }; - (z.prototype = Ca), - U(Ca, { - next: x("nextPos", function (a) { - var b = a.nodeWrapper, - c = a.node, - d = a.offset, - e = b.session; - if (!c) return null; - var f, g, h; - return ( - d == b.getLength() - ? ((f = c.parentNode), (g = f ? b.getNodeIndex() + 1 : 0)) - : b.isCharacterDataNode() - ? ((f = c), (g = d + 1)) - : ((h = c.childNodes[d]), - e.getNodeWrapper(h).containsPositions() ? ((f = h), (g = 0)) : ((f = c), (g = d + 1))), - f ? e.getPosition(f, g) : null - ); - }), - previous: x("previous", function (a) { - var b, - c, - d, - e = a.nodeWrapper, - f = a.node, - g = a.offset, - h = e.session; - return ( - 0 == g - ? ((b = f.parentNode), (c = b ? e.getNodeIndex() : 0)) - : e.isCharacterDataNode() - ? ((b = f), (c = g - 1)) - : ((d = f.childNodes[g - 1]), - h.getNodeWrapper(d).containsPositions() ? ((b = d), (c = S.getNodeLength(d))) : ((b = f), (c = g - 1))), - b ? h.getPosition(b, c) : null - ); - }), - nextVisible: x("nextVisible", function (a) { - var b = a.next(); - if (!b) return null; - var c = b.nodeWrapper, - d = b.node, - e = b; - return c.isCollapsed() && (e = c.session.getPosition(d.parentNode, c.getNodeIndex() + 1)), e; - }), - nextUncollapsed: x("nextUncollapsed", function (a) { - for (var b = a; (b = b.nextVisible()); ) - if ((b.resolveLeadingAndTrailingSpaces(), "" !== b.character)) return b; - return null; - }), - previousVisible: x("previousVisible", function (a) { - var b = a.previous(); - if (!b) return null; - var c = b.nodeWrapper, - d = b.node, - e = b; - return c.isCollapsed() && (e = c.session.getPosition(d.parentNode, c.getNodeIndex())), e; - }), - }); - var Da = null, - Ea = (function () { - function a(a) { - var b = new w(); - return { - get: function (c) { - var d = b.get(c[a]); - if (d) for (var e, f = 0; (e = d[f++]); ) if (e.node === c) return e; - return null; - }, - set: function (c) { - var d = c.node[a], - e = b.get(d) || b.set(d, []); - e.push(c); - }, - }; - } - function b() { - this.initCaches(); - } - var c = T.isHostProperty(document.documentElement, "uniqueID"); - return ( - (b.prototype = { - initCaches: function () { - (this.elementCache = c - ? (function () { - var a = new w(); - return { - get: function (b) { - return a.get(b.uniqueID); - }, - set: function (b) { - a.set(b.node.uniqueID, b); - }, - }; - })() - : a("tagName")), - (this.textNodeCache = a("data")), - (this.otherNodeCache = a("nodeName")); - }, - getNodeWrapper: function (a) { - var b; - switch (a.nodeType) { - case 1: - b = this.elementCache; - break; - case 3: - b = this.textNodeCache; - break; - default: - b = this.otherNodeCache; - } - var c = b.get(a); - return c || ((c = new y(a, this)), b.set(c)), c; - }, - getPosition: function (a, b) { - return this.getNodeWrapper(a).getPosition(b); - }, - getRangeBoundaryPosition: function (a, b) { - var c = b ? "start" : "end"; - return this.getPosition(a[c + "Container"], a[c + "Offset"]); - }, - detach: function () { - this.elementCache = this.textNodeCache = this.otherNodeCache = null; - }, - }), - b - ); - })(); - U(S, { nextNode: q, previousNode: r }); - var Fa = Array.prototype.indexOf - ? function (a, b) { - return a.indexOf(b); - } - : function (a, b) { - for (var c = 0, d = a.length; d > c; ++c) if (a[c] === b) return c; - return -1; - }; - U(a.rangePrototype, { - moveStart: M(!0, !1), - moveEnd: M(!1, !1), - move: M(!0, !0), - trimStart: N(!0), - trimEnd: N(!1), - trim: L(function (a, b) { - var c = this.trimStart(b), - d = this.trimEnd(b); - return c || d; - }), - expand: L(function (a, b, c) { - var d = !1; - c = h(c, la); - var e = c.characterOptions; - if ((b || (b = Q), b == R)) { - var f, - g, - i = c.wordOptions, - j = a.getRangeBoundaryPosition(this, !0), - k = a.getRangeBoundaryPosition(this, !1), - l = F(j, e, i), - m = l.nextEndToken(), - n = m.chars[0].previousVisible(); - if (this.collapsed) f = m; - else { - var o = F(k, e, i); - f = o.previousStartToken(); - } - return ( - (g = f.chars[f.chars.length - 1]), - n.equals(j) || (this.setStart(n.node, n.offset), (d = !0)), - g && !g.equals(k) && (this.setEnd(g.node, g.offset), (d = !0)), - c.trim && (c.trimStart && (d = this.trimStart(e) || d), c.trimEnd && (d = this.trimEnd(e) || d)), - d - ); - } - return this.moveEnd(Q, 1, c); - }), - text: L(function (a, b) { - return this.collapsed ? "" : I(a, this, V(b, ga)).join(""); - }), - selectCharacters: L(function (a, b, c, d, e) { - var f = { characterOptions: e }; - b || (b = W(this.getDocument())), - this.selectNodeContents(b), - this.collapse(!0), - this.moveStart("character", c, f), - this.collapse(!0), - this.moveEnd("character", d - c, f); - }), - toCharacterRange: L(function (a, b, c) { - b || (b = W(this.getDocument())); - var d, - e, - f = b.parentNode, - g = S.getNodeIndex(b), - h = -1 == S.comparePoints(this.startContainer, this.endContainer, f, g), - i = this.cloneRange(); - return ( - h - ? (i.setStartAndEnd(this.startContainer, this.startOffset, f, g), (d = -i.text(c).length)) - : (i.setStartAndEnd(f, g, this.startContainer, this.startOffset), (d = i.text(c).length)), - (e = d + this.text(c).length), - { start: d, end: e } - ); - }), - findText: L(function (b, c, d) { - (d = h(d, ja)), d.wholeWordsOnly && (d.wordOptions.includeTrailingSpace = !1); - var e = aa(d.direction), - f = d.withinRange; - f || ((f = a.createRange()), f.selectNodeContents(this.getDocument())); - var g = c, - i = !1; - "string" == typeof g ? d.caseSensitive || (g = g.toLowerCase()) : (i = !0); - var j = b.getRangeBoundaryPosition(this, !e), - k = f.comparePoint(j.node, j.offset); - -1 === k ? (j = b.getRangeBoundaryPosition(f, !0)) : 1 === k && (j = b.getRangeBoundaryPosition(f, !1)); - for (var l, m = j, n = !1; ; ) - if ((l = K(m, g, i, f, d))) { - if (l.valid) - return this.setStartAndEnd(l.startPos.node, l.startPos.offset, l.endPos.node, l.endPos.offset), !0; - m = e ? l.startPos : l.endPos; - } else { - if (!d.wrap || n) return !1; - (f = f.cloneRange()), (m = b.getRangeBoundaryPosition(f, !e)), f.setBoundary(j.node, j.offset, e), (n = !0); - } - }), - pasteHtml: function (a) { - if ((this.deleteContents(), a)) { - var b = this.createContextualFragment(a), - c = b.lastChild; - this.insertNode(b), this.collapseAfter(c); - } - }, - }), - U(a.selectionPrototype, { - expand: L(function (a, b, c) { - this.changeEachRange(function (a) { - a.expand(b, c); - }); - }), - move: L(function (a, b, c, d) { - var e = 0; - if (this.focusNode) { - this.collapse(this.focusNode, this.focusOffset); - var f = this.getRangeAt(0); - d || (d = {}), - (d.characterOptions = V(d.characterOptions, ha)), - (e = f.move(b, c, d)), - this.setSingleRange(f); - } - return e; - }), - trimStart: O("trimStart"), - trimEnd: O("trimEnd"), - trim: O("trim"), - selectCharacters: L(function (b, c, d, e, f, g) { - var h = a.createRange(c); - h.selectCharacters(c, d, e, g), this.setSingleRange(h, f); - }), - saveCharacterRanges: L(function (a, b, c) { - for ( - var d = this.getAllRanges(), e = d.length, f = [], g = 1 == e && this.isBackward(), h = 0, i = d.length; - i > h; - ++h - ) - f[h] = { characterRange: d[h].toCharacterRange(b, c), backward: g, characterOptions: c }; - return f; - }), - restoreCharacterRanges: L(function (b, c, d) { - this.removeAllRanges(); - for (var e, f, g, h = 0, i = d.length; i > h; ++h) - (f = d[h]), - (g = f.characterRange), - (e = a.createRange(c)), - e.selectCharacters(c, g.start, g.end, f.characterOptions), - this.addRange(e, f.backward); - }), - text: L(function (a, b) { - for (var c = [], d = 0, e = this.rangeCount; e > d; ++d) c[d] = this.getRangeAt(d).text(b); - return c.join(""); - }), - }), - (a.innerText = function (b, c) { - var d = a.createRange(b); - d.selectNodeContents(b); - var e = d.text(c); - return e; - }), - (a.createWordIterator = function (a, b, c) { - var d = C(); - c = h(c, ma); - var e = d.getPosition(a, b), - f = F(e, c.characterOptions, c.wordOptions), - g = aa(c.direction); - return { - next: function () { - return g ? f.previousStartToken() : f.nextEndToken(); - }, - dispose: function () { - f.dispose(), (this.next = function () {}); - }, - }; - }), - (a.noMutation = function (a) { - var b = C(); - a(b), D(); - }), - (a.noMutation.createEntryPointFunction = L), - (a.textRange = { - isBlockNode: l, - isCollapsedWhitespaceNode: t, - createPosition: L(function (a, b, c) { - return a.getPosition(b, c); - }), - }); - }), - (wysihtml.browser = (function () { - function a(a) { - return +((/ipad|iphone|ipod/.test(a) && a.match(/ os (\d+).+? like mac os x/)) || [void 0, 0])[1]; - } - function b(a) { - return +(a.match(/android (\d+)/) || [void 0, 0])[1]; - } - function c(a, b) { - var c, - d = -1; - return ( - "Microsoft Internet Explorer" == navigator.appName - ? (c = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})")) - : "Netscape" == navigator.appName && - (navigator.userAgent.indexOf("Trident") > -1 - ? (c = new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})")) - : /Edge\/(\d+)./i.test(navigator.userAgent) && (c = /Edge\/(\d+)./i)), - c && null != c.exec(navigator.userAgent) && (d = parseFloat(RegExp.$1)), - -1 === d - ? !1 - : a - ? b - ? "<" === b - ? d > a - : ">" === b - ? a > d - : "<=" === b - ? d >= a - : ">=" === b - ? a >= d - : void 0 - : a === d - : !0 - ); - } - var d = navigator.userAgent, - e = document.createElement("div"), - f = -1 !== d.indexOf("Gecko") && -1 === d.indexOf("KHTML") && !c(), - g = -1 !== d.indexOf("AppleWebKit/") && !c(), - h = -1 !== d.indexOf("Chrome/") && !c(), - i = -1 !== d.indexOf("Opera/") && !c(); - return { - USER_AGENT: d, - supported: function () { - var c = this.USER_AGENT.toLowerCase(), - d = "contentEditable" in e, - f = document.execCommand && document.queryCommandSupported && document.queryCommandState, - g = document.querySelector && document.querySelectorAll, - h = - (this.isIos() && a(c) < 5) || - (this.isAndroid() && b(c) < 4) || - -1 !== c.indexOf("opera mobi") || - -1 !== c.indexOf("hpwos/"); - return d && f && g && !h; - }, - isTouchDevice: function () { - return this.supportsEvent("touchmove"); - }, - isIos: function () { - return /ipad|iphone|ipod/i.test(this.USER_AGENT); - }, - isAndroid: function () { - return -1 !== this.USER_AGENT.indexOf("Android"); - }, - supportsSandboxedIframes: function () { - return c(); - }, - throwsMixedContentWarningWhenIframeSrcIsEmpty: function () { - return !("querySelector" in document); - }, - displaysCaretInEmptyContentEditableCorrectly: function () { - return c(12, ">"); - }, - hasCurrentStyleProperty: function () { - return "currentStyle" in e; - }, - insertsLineBreaksOnReturn: function () { - return f; - }, - supportsPlaceholderAttributeOn: function (a) { - return "placeholder" in a; - }, - supportsEvent: function (a) { - return ( - "on" + a in e || - (function () { - return e.setAttribute("on" + a, "return;"), "function" == typeof e["on" + a]; - })() - ); - }, - supportsEventsInIframeCorrectly: function () { - return !i; - }, - supportsHTML5Tags: function (a) { - var b = a.createElement("div"), - c = "
        foo
        "; - return (b.innerHTML = c), b.innerHTML.toLowerCase() === c; - }, - supportsCommand: (function () { - var a = { formatBlock: c(10, "<="), insertUnorderedList: c(), insertOrderedList: c() }, - b = { insertHTML: f }; - return function (c, d) { - var e = a[d]; - if (!e) { - try { - return c.queryCommandSupported(d); - } catch (f) {} - try { - return c.queryCommandEnabled(d); - } catch (g) { - return !!b[d]; - } - } - return !1; - }; - })(), - doesAutoLinkingInContentEditable: function () { - return c(); - }, - canDisableAutoLinking: function () { - return this.supportsCommand(document, "AutoUrlDetect"); - }, - clearsContentEditableCorrectly: function () { - return f || i || g; - }, - supportsGetAttributeCorrectly: function () { - var a = document.createElement("td"); - return "1" != a.getAttribute("rowspan"); - }, - canSelectImagesInContentEditable: function () { - return f || c() || i; - }, - autoScrollsToCaret: function () { - return !g; - }, - autoClosesUnclosedTags: function () { - var a, - b, - c = e.cloneNode(!1); - return ( - (c.innerHTML = "

        "), - (b = c.innerHTML.toLowerCase()), - (a = "

        " === b || "

        " === b), - (this.autoClosesUnclosedTags = function () { - return a; - }), - a - ); - }, - supportsNativeGetElementsByClassName: function () { - return -1 !== String(document.getElementsByClassName).indexOf("[native code]"); - }, - supportsSelectionModify: function () { - return "getSelection" in window && "modify" in window.getSelection(); - }, - needsSpaceAfterLineBreak: function () { - return i; - }, - supportsSpeechApiOn: function (a) { - var b = d.match(/Chrome\/(\d+)/) || [void 0, 0]; - return b[1] >= 11 && ("onwebkitspeechchange" in a || "speech" in a); - }, - crashesWhenDefineProperty: function (a) { - return c(9) && ("XMLHttpRequest" === a || "XDomainRequest" === a); - }, - doesAsyncFocus: function () { - return c(12, ">"); - }, - hasProblemsSettingCaretAfterImg: function () { - return c(); - }, - hasLiDeletingProblem: function () { - return c(); - }, - hasUndoInContextMenu: function () { - return f || h || i; - }, - hasInsertNodeIssue: function () { - return i; - }, - hasIframeFocusIssue: function () { - return c(); - }, - createsNestedInvalidMarkupAfterPaste: function () { - return g; - }, - hasCaretBlockElementIssue: function () { - return g; - }, - supportsMutationEvents: function () { - return "MutationEvent" in window; - }, - supportsModernPaste: function () { - return !c(); - }, - fixStyleKey: function (a) { - return "cssFloat" === a ? ("styleFloat" in document.createElement("div").style ? "styleFloat" : "cssFloat") : a; - }, - usesControlRanges: function () { - return document.body && "createControlRange" in document.body; - }, - hasCaretAtLinkEndInsertionProblems: function () { - return g; - }, - }; - })()), - (wysihtml.lang.array = function (a) { - return { - contains: function (b) { - if (Array.isArray(b)) { - for (var c = b.length; c--; ) if (-1 !== wysihtml.lang.array(a).indexOf(b[c])) return !0; - return !1; - } - return -1 !== wysihtml.lang.array(a).indexOf(b); - }, - indexOf: function (b) { - if (a.indexOf) return a.indexOf(b); - for (var c = 0, d = a.length; d > c; c++) if (a[c] === b) return c; - return -1; - }, - without: function (b) { - b = wysihtml.lang.array(b); - for (var c = [], d = 0, e = a.length; e > d; d++) b.contains(a[d]) || c.push(a[d]); - return c; - }, - get: function () { - for (var b = 0, c = a.length, d = []; c > b; b++) d.push(a[b]); - return d; - }, - map: function (b, c) { - if (Array.prototype.map) return a.map(b, c); - for (var d = a.length >>> 0, e = new Array(d), f = 0; d > f; f++) e[f] = b.call(c, a[f], f, a); - return e; - }, - unique: function () { - for (var b = [], c = a.length, d = 0; c > d; ) wysihtml.lang.array(b).contains(a[d]) || b.push(a[d]), d++; - return b; - }, - }; - }), - (wysihtml.lang.Dispatcher = Base.extend({ - on: function (a, b) { - return (this.events = this.events || {}), (this.events[a] = this.events[a] || []), this.events[a].push(b), this; - }, - off: function (a, b) { - this.events = this.events || {}; - var c, - d, - e = 0; - if (a) { - for (c = this.events[a] || [], d = []; e < c.length; e++) c[e] !== b && b && d.push(c[e]); - this.events[a] = d; - } else this.events = {}; - return this; - }, - fire: function (a, b) { - this.events = this.events || {}; - for (var c = this.events[a] || [], d = 0; d < c.length; d++) c[d].call(this, b); - return this; - }, - observe: function () { - return this.on.apply(this, arguments); - }, - stopObserving: function () { - return this.off.apply(this, arguments); - }, - })), - (wysihtml.lang.object = function (a) { - return { - merge: function (b, c) { - for (var d in b) - c && - wysihtml.lang.object(b[d]).isPlainObject() && - ("undefined" == typeof a[d] || wysihtml.lang.object(a[d]).isPlainObject()) - ? "undefined" == typeof a[d] - ? (a[d] = wysihtml.lang.object(b[d]).clone(!0)) - : wysihtml.lang.object(a[d]).merge(wysihtml.lang.object(b[d]).clone(!0)) - : (a[d] = wysihtml.lang.object(b[d]).isPlainObject() ? wysihtml.lang.object(b[d]).clone(!0) : b[d]); - return this; - }, - difference: function (b) { - var c = {}; - for (var d in a) a.hasOwnProperty(d) && (b.hasOwnProperty(d) || (c[d] = a[d])); - for (var e in b) b.hasOwnProperty(e) && ((a.hasOwnProperty(e) && a[e] === b[e]) || (c[0] = a[0])); - return c; - }, - get: function () { - return a; - }, - clone: function (b) { - var c, - d = {}; - if (null === a || !wysihtml.lang.object(a).isPlainObject()) return a; - for (c in a) a.hasOwnProperty(c) && (b ? (d[c] = wysihtml.lang.object(a[c]).clone(b)) : (d[c] = a[c])); - return d; - }, - isArray: function () { - return "[object Array]" === Object.prototype.toString.call(a); - }, - isFunction: function () { - return "[object Function]" === Object.prototype.toString.call(a); - }, - isPlainObject: function () { - return ( - a && - "[object Object]" === Object.prototype.toString.call(a) && - !("Node" in window ? a instanceof Node : a instanceof Element || a instanceof Text) - ); - }, - isEmpty: function () { - for (var b in a) if (a.hasOwnProperty(b)) return !1; - return !0; - }, - }; - }), - (function () { - var a = /^\s+/, - b = /\s+$/, - c = /[&<>\t"]/g, - d = { "&": "&", "<": "<", ">": ">", '"': """, " ": "  " }; - wysihtml.lang.string = function (e) { - return ( - (e = String(e)), - { - trim: function () { - return e.replace(a, "").replace(b, ""); - }, - interpolate: function (a) { - for (var b in a) e = this.replace("#{" + b + "}").by(a[b]); - return e; - }, - replace: function (a) { - return { - by: function (b) { - return e.split(a).join(b); - }, - }; - }, - escapeHTML: function (a, b) { - var f = e.replace(c, function (a) { - return d[a]; - }); - return a && (f = f.replace(/(?:\r\n|\r|\n)/g, "
        ")), b && (f = f.replace(/ /gi, "  ")), f; - }, - } - ); - }; - })(), - (function (a) { - function b(a, b) { - return f(a, b) ? a : (a === a.ownerDocument.documentElement && (a = a.ownerDocument.body), g(a, b)); - } - function c(a) { - return a.replace(i, function (a, b) { - var c = (b.match(j) || [])[1] || "", - d = l[c]; - (b = b.replace(j, "")), b.split(d).length > b.split(c).length && ((b += c), (c = "")); - var e = b, - f = b; - return ( - b.length > k && (f = f.substr(0, k) + "..."), - "www." === e.substr(0, 4) && (e = "http://" + e), - '' + f + "" + c - ); - }); - } - function d(a) { - var b = a._wysihtml_tempElement; - return b || (b = a._wysihtml_tempElement = a.createElement("div")), b; - } - function e(b) { - var e = b.parentNode, - f = a.lang.string(b.data).escapeHTML(), - g = d(e.ownerDocument); - for (g.innerHTML = "" + c(f), g.removeChild(g.firstChild); g.firstChild; ) - e.insertBefore(g.firstChild, b); - e.removeChild(b); - } - function f(b, c) { - for (var d; b.parentNode; ) { - if (((b = b.parentNode), (d = b.nodeName), b.className && a.lang.array(b.className.split(" ")).contains(c))) - return !0; - if (h.contains(d)) return !0; - if ("body" === d) return !1; - } - return !1; - } - function g(b, c) { - if (!(h.contains(b.nodeName) || (b.className && a.lang.array(b.className.split(" ")).contains(c)))) { - if (b.nodeType === a.TEXT_NODE && b.data.match(i)) return void e(b); - for (var d = a.lang.array(b.childNodes).get(), f = d.length, j = 0; f > j; j++) g(d[j], c); - return b; - } - } - var h = a.lang.array(["CODE", "PRE", "A", "SCRIPT", "HEAD", "TITLE", "STYLE"]), - i = /((https?:\/\/|www\.)[^\s<]{3,})/gi, - j = /([^\w\/\-](,?))$/i, - k = 100, - l = { ")": "(", "]": "[", "}": "{" }; - (a.dom.autoLink = b), (a.dom.autoLink.URL_REG_EXP = i); - })(wysihtml), - (function (a) { - var b = a.dom; - (b.addClass = function (a, c) { - var d = a.classList; - return d ? d.add(c) : void (b.hasClass(a, c) || (a.className += " " + c)); - }), - (b.removeClass = function (a, b) { - var c = a.classList; - return c ? c.remove(b) : void (a.className = a.className.replace(new RegExp("(^|\\s+)" + b + "(\\s+|$)"), " ")); - }), - (b.hasClass = function (a, b) { - var c = a.classList; - if (c) return c.contains(b); - var d = a.className; - return d.length > 0 && (d == b || new RegExp("(^|\\s)" + b + "(\\s|$)").test(d)); - }); - })(wysihtml), - (wysihtml.dom.compareDocumentPosition = (function () { - var a = document.documentElement; - return a.compareDocumentPosition - ? function (a, b) { - return a.compareDocumentPosition(b); - } - : function (a, b) { - var c, d; - if (((c = 9 === a.nodeType ? a : a.ownerDocument), (d = 9 === b.nodeType ? b : b.ownerDocument), a === b)) - return 0; - if (a === b.ownerDocument) return 20; - if (a.ownerDocument === b) return 10; - if (c !== d) return 1; - if (2 === a.nodeType && a.childNodes && -1 !== wysihtml.lang.array(a.childNodes).indexOf(b)) return 20; - if (2 === b.nodeType && b.childNodes && -1 !== wysihtml.lang.array(b.childNodes).indexOf(a)) return 10; - for (var e = a, f = [], g = null; e; ) { - if (e == b) return 10; - f.push(e), (e = e.parentNode); - } - for (e = b, g = null; e; ) { - if (e == a) return 20; - var h = wysihtml.lang.array(f).indexOf(e); - if (-1 !== h) { - var i = f[h], - j = wysihtml.lang.array(i.childNodes).indexOf(f[h - 1]), - k = wysihtml.lang.array(i.childNodes).indexOf(g); - return j > k ? 2 : 4; - } - (g = e), (e = e.parentNode); - } - return 1; - }; - })()), - (wysihtml.dom.contains = (function () { - var a = document.documentElement; - return a.contains - ? function (a, b) { - if (b.nodeType !== wysihtml.ELEMENT_NODE) { - if (b.parentNode === a) return !0; - b = b.parentNode; - } - return a !== b && a.contains(b); - } - : a.compareDocumentPosition - ? function (a, b) { - return !!(16 & a.compareDocumentPosition(b)); - } - : void 0; - })()), - (function (a) { - var b = document; - a.dom.ContentEditableArea = Base.extend({ - getContentEditable: function () { - return this.element; - }, - getWindow: function () { - return this.element.ownerDocument.defaultView || this.element.ownerDocument.parentWindow; - }, - getDocument: function () { - return this.element.ownerDocument; - }, - constructor: function (b, c, d) { - (this.callback = b || a.EMPTY_FUNCTION), - (this.config = a.lang.object({}).merge(c).get()), - this.config.className || (this.config.className = "wysihtml-sandbox"), - d ? (this.element = this._bindElement(d)) : (this.element = this._createElement()); - }, - destroy: function () {}, - _createElement: function () { - var a = b.createElement("div"); - return (a.className = this.config.className), this._loadElement(a), a; - }, - _bindElement: function (a) { - return ( - (a.className = a.className ? a.className + " wysihtml-sandbox" : "wysihtml-sandbox"), - this._loadElement(a, !0), - a - ); - }, - _loadElement: function (a, b) { - var c = this; - if (!b) { - var d = this._getHtml(); - a.innerHTML = d; - } - (this.loaded = !0), - setTimeout(function () { - c.callback(c); - }, 0); - }, - _getHtml: function (a) { - return ""; - }, - }); - })(wysihtml), - (wysihtml.dom.convertToList = (function () { - function a(a, b) { - var c = a.createElement("li"); - return b.appendChild(c), c; - } - function b(a, b) { - return a.createElement(b); - } - function c(c, d, e) { - if ("UL" === c.nodeName || "OL" === c.nodeName || "MENU" === c.nodeName) return c; - var f, - g, - h, - i, - j, - k, - l, - m, - n, - o = c.ownerDocument, - p = b(o, d), - q = c.querySelectorAll("br"), - r = q.length; - for (n = 0; r > n; n++) - for (i = q[n]; (j = i.parentNode) && j !== c && j.lastChild === i; ) { - if ("block" === wysihtml.dom.getStyle("display").from(j)) { - j.removeChild(i); - break; - } - wysihtml.dom.insert(i).after(i.parentNode); - } - for (f = wysihtml.lang.array(c.childNodes).get(), g = f.length, n = 0; g > n; n++) - (m = m || a(o, p)), - (h = f[n]), - (k = "block" === wysihtml.dom.getStyle("display").from(h)), - (l = "BR" === h.nodeName), - !k || (e && wysihtml.dom.hasClass(h, e)) - ? l - ? (m = m.firstChild ? null : m) - : m.appendChild(h) - : ((m = m.firstChild ? a(o, p) : m), m.appendChild(h), (m = null)); - return 0 === f.length && a(o, p), c.parentNode.replaceChild(p, c), p; - } - return c; - })()), - (wysihtml.dom.copyAttributes = function (a) { - return { - from: function (b) { - return { - to: function c(d) { - for (var e, f = 0, g = a.length; g > f; f++) - (e = a[f]), "undefined" != typeof b[e] && "" !== b[e] && (d[e] = b[e]); - return { andTo: c }; - }, - }; - }, - }; - }), - (function (a) { - var b = ["-webkit-box-sizing", "-moz-box-sizing", "-ms-box-sizing", "box-sizing"], - c = function (b) { - return d(b) ? parseInt(a.getStyle("width").from(b), 10) < b.offsetWidth : !1; - }, - d = function (c) { - for (var d = 0, e = b.length; e > d; d++) if ("border-box" === a.getStyle(b[d]).from(c)) return b[d]; - }; - a.copyStyles = function (d) { - return { - from: function (e) { - c(e) && (d = wysihtml.lang.array(d).without(b)); - for (var f, g = "", h = d.length, i = 0; h > i; i++) (f = d[i]), (g += f + ":" + a.getStyle(f).from(e) + ";"); - return { - to: function j(b) { - return a.setStyles(g).on(b), { andTo: j }; - }, - }; - }, - }; - }; - })(wysihtml.dom), - (function (a) { - a.dom.delegate = function (a, b, c, d) { - var e = function (c) { - for ( - var e = c.target, f = 3 === e.nodeType ? e.parentNode : e, g = a.querySelectorAll(b), h = 0, i = g.length; - i > h; - h++ - ) - g[h].contains(f) && d.call(g[h], c); - }; - return ( - a.addEventListener(c, e, !1), - { - stop: function () { - a.removeEventListener(c, e, !1); - }, - } - ); - }; - })(wysihtml), - (function (a) { - function b(a, b) { - for (var c = [a], d = a; (b && d && d !== b) || (!b && d); ) c.unshift(d), (d = d.parentNode); - return c; - } - a.dom.domNode = function (c) { - var d = [a.ELEMENT_NODE, a.TEXT_NODE]; - return { - is: { - emptyTextNode: function (b) { - var d = b ? /^\s*$/g : /^[\r\n]*$/g; - return c && c.nodeType === a.TEXT_NODE && d.test(c.data); - }, - rangyBookmark: function () { - return c && 1 === c.nodeType && c.classList.contains("rangySelectionBoundary"); - }, - visible: function () { - var b = !/^\s*$/g.test(a.dom.getTextContent(c)); - return ( - b || - (1 === c.nodeType && - c.querySelector("img, br, hr, object, embed, canvas, input, textarea") && - (b = !0)), - b - ); - }, - lineBreak: function () { - return c && 1 === c.nodeType && "BR" === c.nodeName; - }, - block: function () { - return c && 1 === c.nodeType && "block" === c.ownerDocument.defaultView.getComputedStyle(c).display; - }, - voidElement: function () { - return a.dom.domNode(c).test({ query: a.VOID_ELEMENTS }); - }, - }, - prev: function (b) { - var e = c.previousSibling, - f = b && b.nodeTypes ? b.nodeTypes : d; - return e - ? a.dom.domNode(e).is.rangyBookmark() || - !a.lang.array(f).contains(e.nodeType) || - (b && b.ignoreBlankTexts && a.dom.domNode(e).is.emptyTextNode(!0)) - ? a.dom.domNode(e).prev(b) - : e - : null; - }, - next: function (b) { - var e = c.nextSibling, - f = b && b.nodeTypes ? b.nodeTypes : d; - return e - ? a.dom.domNode(e).is.rangyBookmark() || - !a.lang.array(f).contains(e.nodeType) || - (b && b.ignoreBlankTexts && a.dom.domNode(e).is.emptyTextNode(!0)) - ? a.dom.domNode(e).next(b) - : e - : null; - }, - commonAncestor: function (a, d) { - var e = b(c, d), - f = b(a, d); - if (e[0] != f[0]) return null; - for (var g = 0; g < e.length; g++) if (e[g] != f[g]) return e[g - 1]; - return null; - }, - lastLeafNode: function (b) { - var d; - if (1 !== c.nodeType) return c; - if (((d = c.lastChild), !d)) return c; - if (b && b.leafClasses) - for (var e = b.leafClasses.length; e--; ) if (a.dom.hasClass(c, b.leafClasses[e])) return c; - return a.dom.domNode(d).lastLeafNode(b); - }, - escapeParent: function (b, d) { - var e, - f, - g, - h = c; - if (!a.dom.contains(b, c)) throw new Error("Child is not a descendant of node."); - do { - for (e = h.parentNode, f = e.cloneNode(!1); e.lastChild && e.lastChild !== h; ) - f.insertBefore(e.lastChild, f.firstChild); - if ( - (e !== b && ((g = e.cloneNode(!1)), g.appendChild(h), (h = g)), - e.parentNode.insertBefore(h, e.nextSibling), - "" !== f.innerHTML) - ) - if (/^\s+$/.test(f.innerHTML)) - for (; f.lastChild; ) e.parentNode.insertBefore(f.lastChild, h.nextSibling); - else e.parentNode.insertBefore(f, h.nextSibling); - if ("" === e.innerHTML) e.parentNode.removeChild(e); - else if (/^\s+$/.test(e.innerHTML)) { - for (; e.firstChild; ) e.parentNode.insertBefore(e.firstChild, e); - e.parentNode.removeChild(e); - } - } while (e && e !== b); - d && h && (h.parentNode.insertBefore(d, h), d.appendChild(h)); - }, - transferContentTo: function (b, d) { - if (1 === c.nodeType) { - if (a.dom.domNode(b).is.voidElement() || 3 === b.nodeType) - for (; c.lastChild; ) b.parentNode.insertBefore(c.lastChild, b.nextSibling); - else for (; c.firstChild; ) b.appendChild(c.firstChild); - d && c.parentNode.removeChild(c); - } else - (3 === c.nodeType || 8 === c.nodeType) && - (a.dom.domNode(b).is.voidElement() ? b.parentNode.insertBefore(c, b.nextSibling) : b.appendChild(c)); - }, - test: function (b) { - var d; - if (!b) return !1; - if (1 !== c.nodeType) return !1; - if (b.query && !c.matches(b.query)) return !1; - if (b.nodeName && c.nodeName.toLowerCase() !== b.nodeName.toLowerCase()) return !1; - if (b.className && !c.classList.contains(b.className)) return !1; - if (b.classRegExp) { - var e = (c.className || "").match(b.classRegExp) || []; - if (0 === e.length) return !1; - } - if (b.styleProperty && b.styleProperty.length > 0) - for ( - var f = !1, g = Array.isArray(b.styleProperty) ? b.styleProperty : [b.styleProperty], h = 0, i = g.length; - i > h; - h++ - ) { - if (((d = a.browser.fixStyleKey(g[h])), c.style[d])) { - if (!b.styleValue) { - f = !0; - break; - } - if (b.styleValue instanceof RegExp) { - if (c.style[d].trim().match(b.styleValue).length > 0) { - f = !0; - break; - } - } else if (Array.isArray(b.styleValue)) { - if (b.styleValue.indexOf(c.style[d].trim())) { - f = !0; - break; - } - } else if (b.styleValue === c.style[d].trim().replace(/, /g, ",")) { - f = !0; - break; - } - } - if (!f) return !1; - } - if (b.attribute) { - var j = a.dom.getAttributes(c), - k = [], - l = !1; - Array.isArray(b.attribute) ? (k = b.attribute) : (k[b.attribute] = b.attributeValue); - for (var m in k) - if (k.hasOwnProperty(m)) - if ("undefined" == typeof k[m]) { - if ("undefined" != typeof j[m]) { - l = !0; - break; - } - } else if (j[m] === k[m]) { - l = !0; - break; - } - if (!l) return !1; - } - return !0; - }, - }; - }; - })(wysihtml), - (wysihtml.dom.getAsDom = (function () { - var a = function (a, b) { - var c = b.createElement("div"); - (c.style.display = "none"), b.body.appendChild(c); - try { - c.innerHTML = a; - } catch (d) {} - return b.body.removeChild(c), c; - }, - b = function (a) { - if (!a._wysihtml_supportsHTML5Tags) { - for (var b = 0, d = c.length; d > b; b++) a.createElement(c[b]); - a._wysihtml_supportsHTML5Tags = !0; - } - }, - c = [ - "abbr", - "article", - "aside", - "audio", - "bdi", - "canvas", - "command", - "datalist", - "details", - "figcaption", - "figure", - "footer", - "header", - "hgroup", - "keygen", - "mark", - "meter", - "nav", - "output", - "progress", - "rp", - "rt", - "ruby", - "svg", - "section", - "source", - "summary", - "time", - "track", - "video", - "wbr", - ]; - return function (c, d) { - d = d || document; - var e; - return ( - "object" == typeof c && c.nodeType - ? ((e = d.createElement("div")), e.appendChild(c)) - : wysihtml.browser.supportsHTML5Tags(d) - ? ((e = d.createElement("div")), (e.innerHTML = c)) - : (b(d), (e = a(c, d))), - e - ); - }; - })()), - (wysihtml.dom.getAttribute = function (a, b) { - var c = !wysihtml.browser.supportsGetAttributeCorrectly(); - b = b.toLowerCase(); - var d = a.nodeName; - if ("IMG" == d && "src" == b && wysihtml.dom.isLoadedImage(a) === !0) return a.src; - if (c && "outerHTML" in a) { - var e = a.outerHTML.toLowerCase(), - f = -1 != e.indexOf(" " + b + "="); - return f ? a.getAttribute(b) : null; - } - return a.getAttribute(b); - }), - (wysihtml.dom.getAttributes = function (a) { - var b, - c = !wysihtml.browser.supportsGetAttributeCorrectly(), - d = a.nodeName, - e = []; - for (b in a.attributes) - ((a.attributes.hasOwnProperty && a.attributes.hasOwnProperty(b)) || - (!a.attributes.hasOwnProperty && Object.prototype.hasOwnProperty.call(a.attributes, b))) && - a.attributes[b].specified && - ("IMG" == d && "src" == a.attributes[b].name.toLowerCase() && wysihtml.dom.isLoadedImage(a) === !0 - ? (e.src = a.src) - : wysihtml.lang.array(["rowspan", "colspan"]).contains(a.attributes[b].name.toLowerCase()) && c - ? 1 !== a.attributes[b].value && (e[a.attributes[b].name] = a.attributes[b].value) - : (e[a.attributes[b].name] = a.attributes[b].value)); - return e; - }), - (wysihtml.dom.getParentElement = (function () { - return function (a, b, c, d) { - for (c = c || 50; c-- && a && "BODY" !== a.nodeName && (!d || a !== d); ) { - if (wysihtml.dom.domNode(a).test(b)) return a; - a = a.parentNode; - } - return null; - }; - })()), - (wysihtml.dom.getPastedHtml = function (a) { - var b; - return ( - wysihtml.browser.supportsModernPaste() && - a.clipboardData && - (wysihtml.lang.array(a.clipboardData.types).contains("text/html") - ? (b = a.clipboardData.getData("text/html")) - : wysihtml.lang.array(a.clipboardData.types).contains("text/plain") && - (b = wysihtml.lang.string(a.clipboardData.getData("text/plain")).escapeHTML(!0, !0))), - b - ); - }), - (wysihtml.dom.getPastedHtmlWithDiv = function (a, b) { - var c = a.selection.getBookmark(), - d = a.element.ownerDocument, - e = d.createElement("DIV"), - f = a.getScrollPos(); - d.body.appendChild(e), - (e.style.width = "1px"), - (e.style.height = "1px"), - (e.style.overflow = "hidden"), - (e.style.position = "absolute"), - (e.style.top = f.y + "px"), - (e.style.left = f.x + "px"), - e.setAttribute("contenteditable", "true"), - e.focus(), - setTimeout(function () { - var d; - a.selection.setBookmark(c), - (d = e.innerHTML), - d && /^$/i.test(d.trim()) && (d = !1), - b(d), - e.parentNode.removeChild(e); - }, 0); - }), - (wysihtml.dom.getStyle = (function () { - function a(a) { - return a.replace(c, function (a) { - return a.charAt(1).toUpperCase(); - }); - } - var b = { float: "styleFloat" in document.createElement("div").style ? "styleFloat" : "cssFloat" }, - c = /\-[a-z]/g; - return function (c) { - return { - from: function (d) { - if (d.nodeType === wysihtml.ELEMENT_NODE) { - var e = d.ownerDocument, - f = b[c] || a(c), - g = d.style, - h = d.currentStyle, - i = g[f]; - if (i) return i; - if (h) - try { - return h[f]; - } catch (j) {} - var k, - l, - m = e.defaultView || e.parentWindow, - n = ("height" === c || "width" === c) && "TEXTAREA" === d.nodeName; - return m.getComputedStyle - ? (n && ((k = g.overflow), (g.overflow = "hidden")), - (l = m.getComputedStyle(d, null).getPropertyValue(c)), - n && (g.overflow = k || ""), - l) - : void 0; - } - }, - }; - }; - })()), - (wysihtml.dom.getTextNodes = function (a, b) { - var c = []; - for (a = a.firstChild; a; a = a.nextSibling) - 3 == a.nodeType - ? (b && /^\s*$/.test(a.innerText || a.textContent)) || c.push(a) - : (c = c.concat(wysihtml.dom.getTextNodes(a, b))); - return c; - }), - (function (a) { - function b(a) { - return a._wysihtml_identifier || (a._wysihtml_identifier = d++); - } - var c = {}, - d = 1; - a.dom.hasElementWithClassName = function (d, e) { - if (!a.browser.supportsNativeGetElementsByClassName()) return !!d.querySelector("." + e); - var f = b(d) + ":" + e, - g = c[f]; - return g || (g = c[f] = d.getElementsByClassName(e)), g.length > 0; - }; - })(wysihtml), - (wysihtml.dom.hasElementWithTagName = (function () { - function a(a) { - return a._wysihtml_identifier || (a._wysihtml_identifier = c++); - } - var b = {}, - c = 1; - return function (c, d) { - var e = a(c) + ":" + d, - f = b[e]; - return f || (f = b[e] = c.getElementsByTagName(d)), f.length > 0; - }; - })()), - (wysihtml.dom.insert = function (a) { - return { - after: function (b) { - b.parentNode.insertBefore(a, b.nextSibling); - }, - before: function (b) { - b.parentNode.insertBefore(a, b); - }, - into: function (b) { - b.appendChild(a); - }, - }; - }), - (wysihtml.dom.insertCSS = function (a) { - return ( - (a = a.join("\n")), - { - into: function (b) { - var c = b.createElement("style"); - (c.type = "text/css"), c.styleSheet ? (c.styleSheet.cssText = a) : c.appendChild(b.createTextNode(a)); - var d = b.querySelector("head link"); - if (d) return void d.parentNode.insertBefore(c, d); - var e = b.querySelector("head"); - e && e.appendChild(c); - }, - } - ); - }), - (wysihtml.dom.isLoadedImage = function (a) { - try { - return a.complete && !a.mozMatchesSelector(":-moz-broken"); - } catch (b) { - if (a.complete && "complete" === a.readyState) return !0; - } - }), - (function (a) { - a.dom.lineBreaks = function (b) { - function c(a) { - return "BR" === a.nodeName; - } - function d(b) { - return c(b) ? !0 : "block" === a.dom.getStyle("display").from(b) ? !0 : !1; - } - return { - add: function (c) { - var e = b.ownerDocument, - f = a.dom.domNode(b).next({ ignoreBlankTexts: !0 }), - g = a.dom.domNode(b).prev({ ignoreBlankTexts: !0 }); - f && !d(f) && a.dom.insert(e.createElement("br")).after(b), - g && !d(g) && a.dom.insert(e.createElement("br")).before(b); - }, - remove: function (d) { - var e = a.dom.domNode(b).next({ ignoreBlankTexts: !0 }), - f = a.dom.domNode(b).prev({ ignoreBlankTexts: !0 }); - e && c(e) && e.parentNode.removeChild(e), f && c(f) && f.parentNode.removeChild(f); - }, - }; - }; - })(wysihtml), - (wysihtml.dom.observe = function (a, b, c) { - b = "string" == typeof b ? [b] : b; - for (var d, e, f = 0, g = b.length; g > f; f++) - (e = b[f]), - a.addEventListener - ? a.addEventListener(e, c, !1) - : ((d = function (b) { - "target" in b || (b.target = b.srcElement), - (b.preventDefault = - b.preventDefault || - function () { - this.returnValue = !1; - }), - (b.stopPropagation = - b.stopPropagation || - function () { - this.cancelBubble = !0; - }), - c.call(a, b); - }), - a.attachEvent("on" + e, d)); - return { - stop: function () { - for (var e, f = 0, g = b.length; g > f; f++) - (e = b[f]), a.removeEventListener ? a.removeEventListener(e, c, !1) : a.detachEvent("on" + e, d); - }, - }; - }), - (wysihtml.dom.parse = function (a, b) { - function c(a, b) { - wysihtml.lang.object(t).merge(s).merge(b.rules).get(); - var c, - f, - g, - h = b.context || a.ownerDocument || document, - i = h.createDocumentFragment(), - j = "string" == typeof a, - k = !1; - for ( - b.clearInternals === !0 && (k = !0), c = j ? wysihtml.dom.getAsDom(a, h) : a, t.selectors && e(c, t.selectors); - c.firstChild; - - ) - (g = c.firstChild), - (f = d(g, b.cleanUp, k, b.uneditableClass)), - f && i.appendChild(f), - g !== f && c.removeChild(g); - if (b.unjoinNbsps) - for (var l = wysihtml.dom.getTextNodes(i), m = l.length; m--; ) - l[m].nodeValue = l[m].nodeValue.replace(/([\S\u00A0])\u00A0/gi, "$1 "); - return (c.innerHTML = ""), c.appendChild(i), j ? wysihtml.quirks.getCorrectInnerHTML(c) : c; - } - function d(a, b, c, e) { - var f, - g, - h, - i, - j = a.nodeType, - k = a.childNodes, - l = k.length, - m = p[j], - n = 0; - if (e && 1 === j && wysihtml.dom.hasClass(a, e)) return a; - if (((g = m && m(a, c)), !g)) { - if (g === !1) { - for (f = a.ownerDocument.createDocumentFragment(), n = l; n--; ) - k[n] && ((h = d(k[n], b, c, e)), h && (k[n] === h && n--, f.insertBefore(h, f.firstChild))); - return ( - (i = wysihtml.dom.getStyle("display").from(a)), - "" === i && (i = wysihtml.lang.array(u).contains(a.tagName) ? "block" : ""), - wysihtml.lang.array(["block", "flex", "table"]).contains(i) && - f.appendChild(a.ownerDocument.createElement("br")), - wysihtml.lang - .array([ - "div", - "pre", - "p", - "table", - "td", - "th", - "ul", - "ol", - "li", - "dd", - "dl", - "footer", - "header", - "section", - "h1", - "h2", - "h3", - "h4", - "h5", - "h6", - ]) - .contains(a.nodeName.toLowerCase()) && - a.parentNode.lastChild !== a && - ((a.nextSibling && 3 === a.nextSibling.nodeType && /^\s/.test(a.nextSibling.nodeValue)) || - f.appendChild(a.ownerDocument.createTextNode(" "))), - f.normalize && f.normalize(), - f - ); - } - return null; - } - for (n = 0; l > n; n++) k[n] && ((h = d(k[n], b, c, e)), h && (k[n] === h && n--, g.appendChild(h))); - if ( - b && - g.nodeName.toLowerCase() === q && - (!g.childNodes.length || - (/^\s*$/gi.test(g.innerHTML) && - (c || ("_wysihtml-temp-placeholder" !== a.className && "rangySelectionBoundary" !== a.className))) || - !g.attributes.length) - ) { - for (f = g.ownerDocument.createDocumentFragment(); g.firstChild; ) f.appendChild(g.firstChild); - return f.normalize && f.normalize(), f; - } - return g.normalize && g.normalize(), g; - } - function e(a, b) { - var c, d, e; - for (c in b) - if (b.hasOwnProperty(c)) { - wysihtml.lang.object(b[c]).isFunction() ? (d = b[c]) : "string" == typeof b[c] && z[b[c]] && (d = z[b[c]]), - (e = a.querySelectorAll(c)); - for (var f = e.length; f--; ) d(e[f]); - } - } - function f(a, b) { - var c, - d, - e, - f = t.tags, - h = a.nodeName.toLowerCase(), - j = a.scopeName; - if (a._wysihtml) return null; - if (((a._wysihtml = 1), "wysihtml-temp" === a.className)) return null; - if ( - (j && "HTML" != j && (h = j + ":" + h), - "outerHTML" in a && - (wysihtml.browser.autoClosesUnclosedTags() || - "P" !== a.nodeName || - "

        " === a.outerHTML.slice(-4).toLowerCase() || - (h = "div")), - h in f) - ) { - if (((c = f[h]), !c || c.remove)) return null; - if (c.unwrap) return !1; - c = "string" == typeof c ? { rename_tag: c } : c; - } else { - if (!a.firstChild) return null; - c = { rename_tag: q }; - } - if (c.one_of_type && !g(a, t, c.one_of_type, b)) { - if (!c.remove_action) return null; - if ("unwrap" === c.remove_action) return !1; - if ("rename" !== c.remove_action) return null; - e = c.remove_action_rename_to || q; - } - return ( - (d = a.ownerDocument.createElement(e || c.rename_tag || h)), - m(a, d, c, b), - i(a, d, c), - (a = null), - d.normalize && d.normalize(), - d - ); - } - function g(a, b, c, d) { - var e, f; - if ( - "SPAN" === a.nodeName && - !d && - ("_wysihtml-temp-placeholder" === a.className || "rangySelectionBoundary" === a.className) - ) - return !0; - for (f in c) - if ( - c.hasOwnProperty(f) && - b.type_definitions && - b.type_definitions[f] && - ((e = b.type_definitions[f]), h(a, e)) - ) - return !0; - return !1; - } - function h(a, b) { - var c, - d, - e, - f, - g, - h = a.getAttribute("class"), - i = a.getAttribute("style"); - if (b.methods) for (var j in b.methods) if (b.methods.hasOwnProperty(j) && y[j] && y[j](a)) return !0; - if (h && b.classes) { - (h = h.replace(/^\s+/g, "").replace(/\s+$/g, "").split(r)), (c = h.length); - for (var k = 0; c > k; k++) if (b.classes[h[k]]) return !0; - } - if (i && b.styles) { - i = i.split(";"); - for (d in b.styles) - if (b.styles.hasOwnProperty(d)) - for (var l = i.length; l--; ) - if ( - ((g = i[l].split(":")), - g[0].replace(/\s/g, "").toLowerCase() === d && - (b.styles[d] === !0 || - 1 === b.styles[d] || - wysihtml.lang.array(b.styles[d]).contains(g[1].replace(/\s/g, "").toLowerCase()))) - ) - return !0; - } - if (b.attrs) - for (e in b.attrs) - if ( - b.attrs.hasOwnProperty(e) && - ((f = wysihtml.dom.getAttribute(a, e)), "string" == typeof f && f.search(b.attrs[e]) > -1) - ) - return !0; - return !1; - } - function i(a, b, c) { - var d, e; - if (c && c.keep_styles) - for (d in c.keep_styles) - if (c.keep_styles.hasOwnProperty(d)) { - if ( - ((e = "float" === d ? a.style.styleFloat || a.style.cssFloat : a.style[d]), - c.keep_styles[d] instanceof RegExp && !c.keep_styles[d].test(e)) - ) - continue; - "float" === d - ? (b.style[a.style.styleFloat ? "styleFloat" : "cssFloat"] = e) - : a.style[d] && (b.style[d] = e); - } - } - function j(a, b) { - var c = []; - for (var d in b) b.hasOwnProperty(d) && 0 === d.indexOf(a) && c.push(d); - return c; - } - function k(a, b, c, d) { - var e, - f = wysihtml.lang.object(c).isFunction() ? c : v[c]; - return f && ((e = f(b, d)), "string" == typeof e) ? e : !1; - } - function l(a, b) { - var c, - d, - e, - f = wysihtml.lang.object(t.attributes || {}).clone(), - g = wysihtml.lang - .object(f) - .merge(wysihtml.lang.object(b || {}).clone()) - .get(), - h = {}, - i = wysihtml.dom.getAttributes(a); - for (c in g) - if (/\*$/.test(c)) { - e = j(c.slice(0, -1), i); - for (var l = 0, m = e.length; m > l; l++) (d = k(e[l], i[e[l]], g[c], a.nodeName)), d !== !1 && (h[e[l]] = d); - } else (d = k(c, i[c], g[c], a.nodeName)), d !== !1 && (h[c] = d); - return h; - } - function m(a, b, c, d) { - var e, - f, - g, - h, - i, - j = {}, - k = c.set_class, - m = c.add_class, - n = c.add_style, - o = c.set_attributes, - p = t.classes, - q = 0, - s = [], - u = [], - v = [], - y = []; - if ( - (o && (j = wysihtml.lang.object(o).clone()), - (j = wysihtml.lang.object(j).merge(l(a, c.check_attributes)).get()), - k && s.push(k), - m) - ) - for (h in m) (i = x[m[h]]), i && ((g = i(wysihtml.dom.getAttribute(a, h))), "string" == typeof g && s.push(g)); - if (n) - for (h in n) - (i = w[n[h]]), - i && ((newStyle = i(wysihtml.dom.getAttribute(a, h))), "string" == typeof newStyle && u.push(newStyle)); - if ("string" == typeof p && "any" === p) - if (a.getAttribute("class")) - if (t.classes_blacklist) { - for (y = a.getAttribute("class"), y && (s = s.concat(y.split(r))), e = s.length; e > q; q++) - (f = s[q]), t.classes_blacklist[f] || v.push(f); - v.length && (j["class"] = wysihtml.lang.array(v).unique().join(" ")); - } else j["class"] = a.getAttribute("class"); - else s && s.length > 0 && (j["class"] = wysihtml.lang.array(s).unique().join(" ")); - else { - for ( - d || - ((p["_wysihtml-temp-placeholder"] = 1), - (p._rangySelectionBoundary = 1), - (p["wysiwyg-tmp-selected-cell"] = 1)), - y = a.getAttribute("class"), - y && (s = s.concat(y.split(r))), - e = s.length; - e > q; - q++ - ) - (f = s[q]), p[f] && v.push(f); - v.length && (j["class"] = wysihtml.lang.array(v).unique().join(" ")); - } - j["class"] && - d && - ((j["class"] = j["class"].replace("wysiwyg-tmp-selected-cell", "")), - /^\s*$/g.test(j["class"]) && delete j["class"]), - u.length && (j.style = wysihtml.lang.array(u).unique().join(" ")); - for (h in j) - try { - b.setAttribute(h, j[h]); - } catch (z) {} - j.src && - ("undefined" != typeof j.width && b.setAttribute("width", j.width), - "undefined" != typeof j.height && b.setAttribute("height", j.height)); - } - function n(a) { - var b = a.nextSibling; - if (!b || b.nodeType !== wysihtml.TEXT_NODE) { - var c = a.data.replace(wysihtml.INVISIBLE_SPACE_REG_EXP, ""); - return a.ownerDocument.createTextNode(c); - } - b.data = - a.data.replace(wysihtml.INVISIBLE_SPACE_REG_EXP, "") + b.data.replace(wysihtml.INVISIBLE_SPACE_REG_EXP, ""); - } - function o(a) { - return t.comments ? a.ownerDocument.createComment(a.nodeValue) : void 0; - } - var p = { 1: f, 3: n, 8: o }, - q = "span", - r = /\s+/, - s = { tags: {}, classes: {} }, - t = {}, - u = [ - "ADDRESS", - "BLOCKQUOTE", - "CENTER", - "DIR", - "DIV", - "DL", - "FIELDSET", - "FORM", - "H1", - "H2", - "H3", - "H4", - "H5", - "H6", - "ISINDEX", - "MENU", - "NOFRAMES", - "NOSCRIPT", - "OL", - "P", - "PRE", - "TABLE", - "UL", - ], - v = { - url: (function () { - var a = /^https?:\/\//i; - return function (b) { - return b && b.match(a) - ? b.replace(a, function (a) { - return a.toLowerCase(); - }) - : null; - }; - })(), - src: (function () { - var a = /^(\/|https?:\/\/)/i; - return function (b) { - return b && b.match(a) - ? b.replace(a, function (a) { - return a.toLowerCase(); - }) - : null; - }; - })(), - href: (function () { - var a = /^(#|\/|https?:\/\/|mailto:|tel:)/i; - return function (b) { - return b && b.match(a) - ? b.replace(a, function (a) { - return a.toLowerCase(); - }) - : null; - }; - })(), - alt: (function () { - var a = /[^ a-z0-9_\-]/gi; - return function (b, c) { - return b ? b.replace(a, "") : "IMG" === c ? "" : null; - }; - })(), - numbers: (function () { - var a = /\D/g; - return function (b) { - return (b = (b || "").replace(a, "")), b || null; - }; - })(), - dimension: (function () { - var a = /\D*(\d+)(\.\d+)?\s?(%)?\D*/; - return function (b) { - return (b = (b || "").replace(a, "$1$2$3")), b || null; - }; - })(), - any: (function () { - return function (a) { - return a ? a : null; - }; - })(), - }, - w = { - align_text: (function () { - var a = { left: "text-align: left;", right: "text-align: right;", center: "text-align: center;" }; - return function (b) { - return a[String(b).toLowerCase()]; - }; - })(), - }, - x = { - align_img: (function () { - var a = { left: "wysiwyg-float-left", right: "wysiwyg-float-right" }; - return function (b) { - return a[String(b).toLowerCase()]; - }; - })(), - align_text: (function () { - var a = { - left: "wysiwyg-text-align-left", - right: "wysiwyg-text-align-right", - center: "wysiwyg-text-align-center", - justify: "wysiwyg-text-align-justify", - }; - return function (b) { - return a[String(b).toLowerCase()]; - }; - })(), - clear_br: (function () { - var a = { - left: "wysiwyg-clear-left", - right: "wysiwyg-clear-right", - both: "wysiwyg-clear-both", - all: "wysiwyg-clear-both", - }; - return function (b) { - return a[String(b).toLowerCase()]; - }; - })(), - size_font: (function () { - var a = { - 1: "wysiwyg-font-size-xx-small", - 2: "wysiwyg-font-size-small", - 3: "wysiwyg-font-size-medium", - 4: "wysiwyg-font-size-large", - 5: "wysiwyg-font-size-x-large", - 6: "wysiwyg-font-size-xx-large", - 7: "wysiwyg-font-size-xx-large", - "-": "wysiwyg-font-size-smaller", - "+": "wysiwyg-font-size-larger", - }; - return function (b) { - return a[String(b).charAt(0)]; - }; - })(), - }, - y = { - has_visible_contet: (function () { - var a, - b = [ - "img", - "video", - "picture", - "br", - "script", - "noscript", - "style", - "table", - "iframe", - "object", - "embed", - "audio", - "svg", - "input", - "button", - "select", - "textarea", - "canvas", - ]; - return function (c) { - if (((a = (c.innerText || c.textContent).replace(/\s/g, "")), a && a.length > 0)) return !0; - for (var d = b.length; d--; ) if (c.querySelector(b[d])) return !0; - return c.offsetWidth && c.offsetWidth > 0 && c.offsetHeight && c.offsetHeight > 0 ? !0 : !1; - }; - })(), - }, - z = { - unwrap: function (a) { - wysihtml.dom.unwrap(a); - }, - remove: function (a) { - a.parentNode.removeChild(a); - }, - }; - return c(a, b); - }), - (wysihtml.dom.query = function (a, b) { - var c, - d = []; - a.nodeType && (a = [a]); - for (var e = 0, f = a.length; f > e; e++) - if ((c = a[e].querySelectorAll(b))) for (var g = c.length; g--; d.unshift(c[g])); - return d; - }), - (wysihtml.dom.removeEmptyTextNodes = function (a) { - for (var b, c = wysihtml.lang.array(a.childNodes).get(), d = c.length, e = 0; d > e; e++) - (b = c[e]), b.nodeType === wysihtml.TEXT_NODE && /^[\n\r]*$/.test(b.data) && b.parentNode.removeChild(b); - }), - (wysihtml.dom.removeInvisibleSpaces = function (a) { - for (var b = wysihtml.dom.getTextNodes(a), c = b.length; c--; ) - b[c].nodeValue = b[c].nodeValue.replace(wysihtml.INVISIBLE_SPACE_REG_EXP, ""); - }), - (wysihtml.dom.renameElement = function (a, b) { - for (var c, d = a.ownerDocument.createElement(b); (c = a.firstChild); ) d.appendChild(c); - return ( - wysihtml.dom.copyAttributes(["align", "className"]).from(a).to(d), - a.parentNode && a.parentNode.replaceChild(d, a), - d - ); - }), - (wysihtml.dom.replaceWithChildNodes = function (a) { - if (a.parentNode) { - for (; a.firstChild; ) a.parentNode.insertBefore(a.firstChild, a); - a.parentNode.removeChild(a); - } - }), - (function (a) { - function b(b) { - return "block" === a.getStyle("display").from(b); - } - function c(a) { - return "BR" === a.nodeName; - } - function d(a) { - var b = a.ownerDocument.createElement("br"); - a.appendChild(b); - } - function e(a, e) { - if (a.nodeName.match(/^(MENU|UL|OL)$/)) { - var f, - g, - h, - i, - j, - k, - l, - m = a.ownerDocument, - n = m.createDocumentFragment(), - o = wysihtml.dom.domNode(a).prev({ ignoreBlankTexts: !0 }), - p = wysihtml.dom.domNode(a).next({ ignoreBlankTexts: !0 }), - q = a.lastElementChild || a.lastChild; - if (e) - for (!o || b(o) || c(o) || d(n); (k = a.firstElementChild || a.firstChild); ) { - for (g = k.lastChild, l = k === q; (f = k.firstChild); ) - (h = f === g), (i = (!l || (p && !b(p))) && h && !b(f) && !c(f)), n.appendChild(f), i && d(n); - k.parentNode.removeChild(k); - } - else - for (; (k = a.firstElementChild || a.firstChild); ) { - if (k.querySelector && k.querySelector("div, p, ul, ol, menu, blockquote, h1, h2, h3, h4, h5, h6")) - for (; (f = k.firstChild); ) n.appendChild(f); - else { - for (j = m.createElement("p"); (f = k.firstChild); ) j.appendChild(f); - n.appendChild(j); - } - k.parentNode.removeChild(k); - } - a.parentNode.replaceChild(n, a); - } - } - a.resolveList = e; - })(wysihtml.dom), - (function (a) { - var b = document, - c = [ - "parent", - "top", - "opener", - "frameElement", - "frames", - "localStorage", - "globalStorage", - "sessionStorage", - "indexedDB", - ], - d = [ - "open", - "close", - "openDialog", - "showModalDialog", - "alert", - "confirm", - "prompt", - "openDatabase", - "postMessage", - "XMLHttpRequest", - "XDomainRequest", - ], - e = ["referrer", "write", "open", "close"]; - a.dom.Sandbox = Base.extend({ - constructor: function (b, c) { - (this.callback = b || a.EMPTY_FUNCTION), - (this.config = a.lang.object({}).merge(c).get()), - this.config.className || (this.config.className = "wysihtml-sandbox"), - (this.editableArea = this._createIframe()); - }, - insertInto: function (a) { - "string" == typeof a && (a = b.getElementById(a)), a.appendChild(this.editableArea); - }, - getIframe: function () { - return this.editableArea; - }, - getWindow: function () { - this._readyError(); - }, - getDocument: function () { - this._readyError(); - }, - destroy: function () { - var a = this.getIframe(); - a.parentNode.removeChild(a); - }, - _readyError: function () { - throw new Error("wysihtml.Sandbox: Sandbox iframe isn't loaded yet"); - }, - _createIframe: function () { - var c = this, - d = b.createElement("iframe"); - return ( - (d.className = this.config.className), - a.dom - .setAttributes({ - security: "restricted", - allowtransparency: "true", - frameborder: 0, - width: 0, - height: 0, - marginwidth: 0, - marginheight: 0, - }) - .on(d), - a.browser.throwsMixedContentWarningWhenIframeSrcIsEmpty() && (d.src = "javascript:''"), - (d.onload = function () { - (d.onreadystatechange = d.onload = null), c._onLoadIframe(d); - }), - (d.onreadystatechange = function () { - /loaded|complete/.test(d.readyState) && ((d.onreadystatechange = d.onload = null), c._onLoadIframe(d)); - }), - d - ); - }, - _onLoadIframe: function (f) { - if (a.dom.contains(b.documentElement, f)) { - var g = this, - h = f.contentWindow, - i = f.contentWindow.document, - j = b.characterSet || b.charset || "utf-8", - k = this._getHtml({ charset: j, stylesheets: this.config.stylesheets }); - if ( - (i.open("text/html", "replace"), - i.write(k), - i.close(), - (this.getWindow = function () { - return f.contentWindow; - }), - (this.getDocument = function () { - return f.contentWindow.document; - }), - (h.onerror = function (a, b, c) { - throw new Error("wysihtml.Sandbox: " + a, b, c); - }), - !a.browser.supportsSandboxedIframes()) - ) { - var l, m; - for (l = 0, m = c.length; m > l; l++) this._unset(h, c[l]); - for (l = 0, m = d.length; m > l; l++) this._unset(h, d[l], a.EMPTY_FUNCTION); - for (l = 0, m = e.length; m > l; l++) this._unset(i, e[l]); - this._unset(i, "cookie", "", !0); - } - a.polyfills && a.polyfills(h, i).apply(), - (this.loaded = !0), - setTimeout(function () { - g.callback(g); - }, 0); - } - }, - _getHtml: function (b) { - var c, - d = b.stylesheets, - e = "", - f = 0; - if ((d = "string" == typeof d ? [d] : d)) - for (c = d.length; c > f; f++) e += ''; - return ( - (b.stylesheets = e), - a.lang - .string('#{stylesheets}') - .interpolate(b) - ); - }, - _unset: function (b, c, d, e) { - try { - b[c] = d; - } catch (f) {} - try { - b.__defineGetter__(c, function () { - return d; - }); - } catch (f) {} - if (e) - try { - b.__defineSetter__(c, function () {}); - } catch (f) {} - if (!a.browser.crashesWhenDefineProperty(c)) - try { - var g = { - get: function () { - return d; - }, - }; - e && (g.set = function () {}), Object.defineProperty(b, c, g); - } catch (f) {} - }, - }); - })(wysihtml), - (function () { - var a = { className: "class" }; - wysihtml.dom.setAttributes = function (b) { - return { - on: function (c) { - for (var d in b) c.setAttribute(a[d] || d, b[d]); - }, - }; - }; - })(), - (wysihtml.dom.setStyles = function (a) { - return { - on: function (b) { - var c = b.style; - if ("string" == typeof a) return void (c.cssText += ";" + a); - for (var d in a) "float" === d ? ((c.cssFloat = a[d]), (c.styleFloat = a[d])) : (c[d] = a[d]); - }, - }; - }), - (function (a) { - a.simulatePlaceholder = function (b, c, d, e) { - var f = e || "wysihtml-placeholder", - g = function () { - var b = c.element.offsetWidth > 0 && c.element.offsetHeight > 0; - c.hasPlaceholderSet() && - (c.clear(), - c.element.focus(), - b && - setTimeout(function () { - var a = c.selection.getSelection(); - (a.focusNode && a.anchorNode) || c.selection.selectNode(c.element.firstChild || c.element); - }, 0)), - (c.placeholderSet = !1), - a.removeClass(c.element, f); - }, - h = function () { - c.isEmpty() && !c.placeholderSet && ((c.placeholderSet = !0), c.setValue(d, !1), a.addClass(c.element, f)); - }; - b - .on("set_placeholder", h) - .on("unset_placeholder", g) - .on("focus:composer", g) - .on("paste:composer", g) - .on("blur:composer", h), - h(); - }; - })(wysihtml.dom), - (function (a) { - var b = document.documentElement; - "textContent" in b - ? ((a.setTextContent = function (a, b) { - a.textContent = b; - }), - (a.getTextContent = function (a) { - return a.textContent; - })) - : "innerText" in b - ? ((a.setTextContent = function (a, b) { - a.innerText = b; - }), - (a.getTextContent = function (a) { - return a.innerText; - })) - : ((a.setTextContent = function (a, b) { - a.nodeValue = b; - }), - (a.getTextContent = function (a) { - return a.nodeValue; - })); - })(wysihtml.dom), - (wysihtml.dom.unwrap = function (a) { - var b = []; - if (a.parentNode) { - for (; a.lastChild; ) b.unshift(a.lastChild), wysihtml.dom.insert(a.lastChild).after(a); - a.parentNode.removeChild(a); - } - return b; - }), - (wysihtml.quirks.cleanPastedHTML = (function () { - var a = function (a) { - var b = wysihtml.lang.string(a).trim(), - c = b.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); - return new RegExp("^((?!^" + c + "$).)*$", "i"); - }, - b = function (b, c) { - var d, - e, - f = wysihtml.lang.object(b).clone(!0); - for (d in f.tags) - if (f.tags.hasOwnProperty(d) && f.tags[d].keep_styles) - for (e in f.tags[d].keep_styles) - f.tags[d].keep_styles.hasOwnProperty(e) && c[e] && (f.tags[d].keep_styles[e] = a(c[e])); - return f; - }, - c = function (a, b) { - var c; - if (!a) return null; - for (var d = 0, e = a.length; e > d; d++) - if ((a[d].condition || (c = a[d].set), a[d].condition && a[d].condition.test(b))) return a[d].set; - return c; - }; - return function (a, d) { - var e, - f = { - color: wysihtml.dom.getStyle("color").from(d.referenceNode), - fontSize: wysihtml.dom.getStyle("font-size").from(d.referenceNode), - }, - g = b(c(d.rules, a) || {}, f); - return (e = wysihtml.dom.parse(a, { - rules: g, - cleanUp: !0, - context: d.referenceNode.ownerDocument, - uneditableClass: d.uneditableClass, - clearInternals: !0, - unjoinNbsps: !0, - })); - }; - })()), - (wysihtml.quirks.ensureProperClearing = (function () { - var a = function () { - var a = this; - setTimeout(function () { - var b = a.innerHTML.toLowerCase(); - ("

         

        " == b || "

         

         

        " == b) && (a.innerHTML = ""); - }, 0); - }; - return function (b) { - wysihtml.dom.observe(b.element, ["cut", "keydown"], a); - }; - })()), - (function (a) { - var b = "%7E"; - a.quirks.getCorrectInnerHTML = function (c) { - var d = c.innerHTML; - if (-1 === d.indexOf(b)) return d; - var e, - f, - g, - h, - i = c.querySelectorAll("[href*='~'], [src*='~']"); - for (h = 0, g = i.length; g > h; h++) - (e = i[h].href || i[h].src), (f = a.lang.string(e).replace("~").by(b)), (d = a.lang.string(d).replace(f).by(e)); - return d; - }; - })(wysihtml), - (function (a) { - var b = "wysihtml-quirks-redraw"; - a.quirks.redraw = function (c) { - a.dom.addClass(c, b), a.dom.removeClass(c, b); - try { - var d = c.ownerDocument; - d.execCommand("italic", !1, null), d.execCommand("italic", !1, null); - } catch (e) {} - }; - })(wysihtml), - (function (a) { - function b(a) { - var b, c; - for (b in d) if (d.hasOwnProperty(b) && ((c = d[b]), c.regex.test(a))) return c; - } - function c(a) { - var c = b(a); - return c ? c.name : void 0; - } - var d = { - rgba: { regex: /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([\d\.]+)\s*\)/i, name: "rgba" }, - rgb: { regex: /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i, name: "rgb" }, - hex6: { regex: /^#([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])/i, name: "hex", radix: 16 }, - hex3: { regex: /^#([0-9a-f])([0-9a-f])([0-9a-f])/i, name: "hex", radix: 16 }, - }, - e = function (a) { - return new RegExp("(^|\\s|;)" + a + "\\s*:\\s*[^;$]+", "gi"); - }; - a.quirks.styleParser = { - getColorParseMethod: b, - getColorFormat: c, - parseColor: function (c, f) { - var g, - h, - i, - j, - k, - l = c; - if (f) { - if (((g = e(f)), !(h = c.match(g)))) return !1; - (h = h.pop().split(":")[1]), (l = a.lang.string(h).trim()); - } - return (i = b(l)) && (j = l.match(i.regex)) - ? ((k = i.radix || 10), - i === d.hex3 - ? (j.shift(), - j.push(1), - a.lang.array(j).map(function (a, b) { - return 3 > b ? parseInt(a, k) * k + parseInt(a, k) : parseFloat(a); - })) - : (j.shift(), - j[3] || j.push(1), - a.lang.array(j).map(function (a, b) { - return 3 > b ? parseInt(a, k) : parseFloat(a); - }))) - : !1; - }, - unparseColor: function (a, b) { - var c = 16; - return "hex" === b - ? (a[0].toString(c) + a[1].toString(c) + a[2].toString(c)).toUpperCase() - : "hash" === b - ? "#" + (a[0].toString(c) + a[1].toString(c) + a[2].toString(c)).toUpperCase() - : "rgb" === b - ? "rgb(" + a[0] + "," + a[1] + "," + a[2] + ")" - : "rgba" === b - ? "rgba(" + a[0] + "," + a[1] + "," + a[2] + "," + a[3] + ")" - : "csv" === b - ? a[0] + "," + a[1] + "," + a[2] + "," + a[3] - : a[3] && 1 !== a[3] - ? "rgba(" + a[0] + "," + a[1] + "," + a[2] + "," + a[3] + ")" - : "rgb(" + a[0] + "," + a[1] + "," + a[2] + ")"; - }, - parseFontSize: function (b) { - var c = b.match(e("font-size")); - return c ? a.lang.string(c[c.length - 1].split(":")[1]).trim() : !1; - }, - }; - })(wysihtml), - (function (a) { - function b(a) { - var b = 0; - if (a.parentNode) - do (b += a.offsetTop || 0), (a = a.offsetParent); - while (a); - return b; - } - function c(a, b) { - for (var c = 0; b !== a; ) if ((c++, (b = b.parentNode), !b)) throw new Error("not a descendant of ancestor!"); - return c; - } - function d(a, b) { - return 3 === a.nodeType ? a : a.childNodes[b] || a; - } - function e(b) { - var c = document.createElement("span"), - d = function (a) { - b.removeEventListener("mouseup", d), - b.removeEventListener("keydown", d), - b.removeEventListener("touchstart", d), - b.removeEventListener("focus", d), - b.removeEventListener("blur", d), - b.removeEventListener("paste", e), - b.removeEventListener("drop", e), - b.removeEventListener("beforepaste", e), - c && c.parentNode && c.parentNode.removeChild(c); - }, - e = function (a) { - c && c.parentNode && setTimeout(d, 0); - }; - return ( - c.appendChild(b.ownerDocument.createTextNode(a.INVISIBLE_SPACE)), - (c.className = "_wysihtml-temp-caret-fix"), - (c.style.display = "block"), - (c.style.minWidth = "1px"), - (c.style.height = "0px"), - b.addEventListener("mouseup", d), - b.addEventListener("keydown", d), - b.addEventListener("touchstart", d), - b.addEventListener("focus", d), - b.addEventListener("blur", d), - b.addEventListener("paste", e), - b.addEventListener("drop", e), - b.addEventListener("beforepaste", e), - c - ); - } - function f(a) { - if (!a.canSurroundContents()) - for ( - var b = a.commonAncestorContainer, d = c(b, a.startContainer), e = c(b, a.endContainer); - !a.canSurroundContents(); - - ) - d > e - ? (a.setStartBefore(a.startContainer), (d = c(b, a.startContainer))) - : (a.setEndAfter(a.endContainer), (e = c(b, a.endContainer))); - } - var g = a.dom; - a.Selection = Base.extend({ - constructor: function (a, b, c) { - rangy.init(), - (this.editor = a), - (this.composer = a.composer), - (this.doc = this.composer.doc), - (this.win = this.composer.win), - (this.contain = b), - (this.unselectableClass = c || !1); - }, - getBookmark: function () { - var a = this.getRange(); - return a && a.cloneRange(); - }, - setBookmark: function (a) { - a && this.setSelection(a); - }, - setBefore: function (a) { - var b = rangy.createRange(this.doc); - return b.setStartBefore(a), b.setEndBefore(a), this.setSelection(b); - }, - createTemporaryCaretSpaceAfter: function (b) { - var c = this.doc.createElement("span"), - d = this.doc.createTextNode(a.INVISIBLE_SPACE), - e = function (b) { - var d; - this.contain.removeEventListener("mouseup", e), - this.contain.removeEventListener("keydown", g), - this.contain.removeEventListener("touchstart", e), - this.contain.removeEventListener("focus", e), - this.contain.removeEventListener("blur", e), - this.contain.removeEventListener("paste", f), - this.contain.removeEventListener("drop", f), - this.contain.removeEventListener("beforepaste", f), - c && - c.parentNode && - ((c.innerHTML = c.innerHTML.replace(a.INVISIBLE_SPACE_REG_EXP, "")), - /[^\s]+/.test(c.innerHTML) - ? ((d = c.lastChild), a.dom.unwrap(c), this.setAfter(d)) - : c.parentNode.removeChild(c)); - }.bind(this), - f = function (a) { - c && c.parentNode && setTimeout(e, 0); - }, - g = function (a) { - 8 === a.which || 91 === a.which || 17 === a.which || (86 === a.which && (a.ctrlKey || a.metaKey)) || e(); - }; - return ( - (c.className = "_wysihtml-temp-caret-fix"), - (c.style.position = "absolute"), - (c.style.display = "block"), - (c.style.minWidth = "1px"), - (c.style.zIndex = "99999"), - c.appendChild(d), - b.parentNode.insertBefore(c, b.nextSibling), - this.setBefore(d), - this.contain.addEventListener("mouseup", e), - this.contain.addEventListener("keydown", g), - this.contain.addEventListener("touchstart", e), - this.contain.addEventListener("focus", e), - this.contain.addEventListener("blur", e), - this.contain.addEventListener("paste", f), - this.contain.addEventListener("drop", f), - this.contain.addEventListener("beforepaste", f), - c - ); - }, - setAfter: function (b, c, d) { - var e, - f = this.win, - g = rangy.createRange(this.doc), - h = function () { - var d = b.parentNode, - g = d ? d.childNodes[d.childNodes.length - 1] : null; - if (!e || (g === b && 1 === b.nodeType && "block" === f.getComputedStyle(b).display)) - if (c) { - var h = this.doc.createTextNode(a.INVISIBLE_SPACE); - b.parentNode.insertBefore(h, b.nextSibling), - this.selectNode(h), - setTimeout(function () { - h && h.parentNode && h.parentNode.removeChild(h); - }, 0); - } else this.createTemporaryCaretSpaceAfter(b); - }.bind(this); - if ( - (g.setStartAfter(b), - g.setEndAfter(b), - document.activeElement && document.activeElement === this.composer.element) - ) - (e = this.setSelection(g)), h(), d && d(e); - else { - var i = this.composer.getScrollPos(); - this.composer.element.focus(), - this.composer.setScrollPos(i), - setTimeout( - function () { - (e = this.setSelection(g)), h(), d && d(e); - }.bind(this), - 0 - ); - } - }, - selectNode: function (b, c) { - var d = rangy.createRange(this.doc), - e = b.nodeType === a.ELEMENT_NODE, - f = "canHaveHTML" in b ? b.canHaveHTML : "IMG" !== b.nodeName, - h = e ? b.innerHTML : b.data, - i = "" === h || h === a.INVISIBLE_SPACE, - j = g.getStyle("display").from(b), - k = "block" === j || "list-item" === j; - if (i && e && f && !c) - try { - b.innerHTML = a.INVISIBLE_SPACE; - } catch (l) {} - f ? d.selectNodeContents(b) : d.selectNode(b), - f && i && e ? d.collapse(k) : f && i && (d.setStartAfter(b), d.setEndAfter(b)), - this.setSelection(d); - }, - getSelectedNode: function (a) { - var b, c; - return a && - this.doc.selection && - "Control" === this.doc.selection.type && - ((c = this.doc.selection.createRange()), c && c.length) - ? c.item(0) - : ((b = this.getSelection(this.doc)), - b.focusNode === b.anchorNode - ? b.focusNode - : ((c = this.getRange(this.doc)), c ? c.commonAncestorContainer : this.doc.body)); - }, - fixSelBorders: function () { - var a = this.getRange(); - f(a), this.setSelection(a); - }, - getSelectedOwnNodes: function (a) { - for (var b = this.getOwnRanges(), c = [], d = 0, e = b.length; e > d; d++) - c.push(b[d].commonAncestorContainer || this.doc.body); - return c; - }, - findNodesInSelection: function (b) { - for (var c, d = this.getOwnRanges(), e = [], f = 0, g = d.length; g > f; f++) - (c = d[f].getNodes([1], function (c) { - return a.lang.array(b).contains(c.nodeName); - })), - (e = e.concat(c)); - return e; - }, - filterElements: function (a) { - for (var b, c = this.getOwnRanges(), d = [], e = 0, f = c.length; f > e; e++) - (b = c[e].getNodes([1], function (b) { - return a(b, c[e]); - })), - (d = d.concat(b)); - return d; - }, - containsUneditable: function () { - for (var a = this.getOwnUneditables(), b = this.getSelection(), c = 0, d = a.length; d > c; c++) - if (b.containsNode(a[c])) return !0; - return !1; - }, - deleteContents: function () { - var a = this.getRange(); - this.deleteRangeContents(a), this.setSelection(a); - }, - deleteRangeContents: function (b) { - var c, d, e, f; - if (this.unselectableClass) { - (c = a.dom.getParentElement(b.startContainer, { query: "." + this.unselectableClass }, !1, this.contain)) && - b.setStartBefore(c), - (d = a.dom.getParentElement(b.endContainer, { query: "." + this.unselectableClass }, !1, this.contain)) && - b.setEndAfter(d), - (e = b.getNodes( - [1], - function (b) { - return a.dom.hasClass(b, this.unselectableClass); - }.bind(this) - )); - for (var g = e.length; g--; ) - try { - (f = new CustomEvent("wysihtml:uneditable:delete")), e[g].dispatchEvent(f); - } catch (h) {} - } - b.deleteContents(); - }, - getCaretNode: function () { - var a = this.getSelection(); - return a && a.anchorNode ? d(a.anchorNode, a.anchorOffset) : null; - }, - getPreviousNode: function (b, c) { - var e; - if (!b) { - var f = this.getSelection(); - b = f && f.anchorNode ? d(f.anchorNode, f.anchorOffset) : null; - } - if (b === this.contain) return !1; - var g, - h = b.previousSibling; - return h === this.contain - ? !1 - : (h && 3 !== h.nodeType && 1 !== h.nodeType - ? (h = this.getPreviousNode(h, c)) - : h && 3 === h.nodeType && /^\s*$/.test(h.textContent) - ? (h = this.getPreviousNode(h, c)) - : c && h && 1 === h.nodeType - ? ((e = a.dom.getStyle("display").from(h)), - a.lang.array(["BR", "HR", "IMG"]).contains(h.nodeName) || - a.lang.array(["block", "inline-block", "flex", "list-item", "table"]).contains(e) || - !/^[\s]*$/.test(h.innerHTML) || - (h = this.getPreviousNode(h, c))) - : h || b === this.contain || ((g = b.parentNode), g !== this.contain && (h = this.getPreviousNode(g, c))), - h !== this.contain ? h : !1); - }, - getNodesNearCaret: function () { - if (!this.isCollapsed()) throw "Selection must be caret when using selection.getNodesNearCaret()"; - var a, - b, - c, - d, - e = this.getOwnRanges(); - return e && e.length > 0 - ? (1 === e[0].startContainer.nodeType - ? ((a = e[0].startContainer.childNodes[e[0].startOffset - 1]), - a || 0 !== e[0].startOffset - ? a && ((b = a.previousSibling), (c = a.nextSibling)) - : (c = e[0].startContainer.childNodes[0])) - : (0 === e[0].startOffset && e[0].startContainer.previousSibling - ? ((a = e[0].startContainer.previousSibling), 3 === a.nodeType && (d = a.data.length)) - : ((a = e[0].startContainer), (d = e[0].startOffset)), - (b = a.previousSibling), - (c = a.nextSibling)), - { caretNode: a, prevNode: b, nextNode: c, textOffset: d }) - : null; - }, - getSelectionParentsByTag: function (b) { - for (var c, d = this.getSelectedOwnNodes(), e = [], f = 0, g = d.length; g > f; f++) - (c = - d[f].nodeName && "LI" === d[f].nodeName - ? d[f] - : a.dom.getParentElement(d[f], { query: "li" }, !1, this.contain)), - c && e.push(c); - return e.length ? e : null; - }, - getRangeToNodeEnd: function () { - if (this.isCollapsed()) { - var a, - b, - c, - d = this.getRange(); - if (d) - return ( - (a = d.startContainer), - (b = d.startOffset), - (c = rangy.createRange(this.doc)), - c.selectNodeContents(a), - c.setStart(a, b), - c - ); - } - }, - getRangeToNodeBeginning: function () { - if (this.isCollapsed()) { - var a = this.getRange(), - b = a.startContainer, - c = a.startOffset, - d = rangy.createRange(this.doc); - return d.selectNodeContents(b), d.setEnd(b, c), d; - } - }, - caretIsInTheEndOfNode: function (a) { - var b, - c, - d, - e, - f = (rangy.createRange(this.doc), this.getSelection(), this.getRangeToNodeEnd()); - return f - ? ((b = f.cloneContents()), - (c = b.textContent), - /^\s*$/.test(c) - ? a - ? ((d = this.getRangeToNodeBeginning().cloneContents()), - (e = d.textContent), - !/[\u00A0 ][\s\uFEFF]*$/.test(e)) - : !0 - : !1) - : !1; - }, - caretIsFirstInSelection: function (b) { - var c = rangy.createRange(this.doc), - e = this.getSelection(), - f = this.getRange(), - g = d(f.startContainer, f.startOffset); - if (g) { - if (g.nodeType === a.TEXT_NODE) { - if (!g.parentNode) return !1; - if (!this.isCollapsed() || (g.parentNode.firstChild !== g && !a.dom.domNode(g.previousSibling).is.block())) - return !1; - var h = this.win.getComputedStyle(g.parentNode).whiteSpace; - return "pre" === h || "pre-wrap" === h - ? 0 === f.startOffset - : /^\s*$/.test(g.data.substr(0, f.startOffset)); - } - return b && a.dom.domNode(g).is.lineBreak() - ? !0 - : (c.selectNodeContents(this.getRange().commonAncestorContainer), - c.collapse(!0), - this.isCollapsed() && - (c.startContainer === e.anchorNode || c.endContainer === e.anchorNode) && - c.startOffset === e.anchorOffset); - } - }, - caretIsInTheBeginnig: function (b) { - var c = this.getSelection(), - d = c.anchorNode, - e = c.anchorOffset; - return b && d - ? 0 === e && - ((d.nodeName && d.nodeName === b.toUpperCase()) || a.dom.getParentElement(d.parentNode, { query: b }, 1)) - : d - ? 0 === e && !this.getPreviousNode(d, !0) - : void 0; - }, - getBeforeSelection: function (b) { - var c, - d, - e = this.getSelection(), - f = e.isBackwards() ? e.focusNode : e.anchorNode, - g = e.isBackwards() ? e.focusOffset : e.anchorOffset, - h = this.createRange(); - if ( - (f && 3 === f.nodeType && /^\s*$/.test(f.data.slice(0, g)) && (g = 0), - (d = a.dom.getParentElement(f, { query: "._wysihtml-temp-caret-fix" }, 1)), - d && ((f = d.parentNode), (g = Array.prototype.indexOf.call(f.childNodes, d))), - f) - ) { - if (g > 0) - return 3 === f.nodeType - ? (h.setStart(f, 0), h.setEnd(f, g), { type: "text", range: h, offset: g, node: f }) - : (h.setStartBefore(f.childNodes[0]), - (c = f.childNodes[g - 1]), - h.setEndAfter(c), - { type: "element", range: h, offset: g, node: c }); - if ((h.setStartAndEnd(f, 0), b)) { - var i = this.getPreviousNode(f, !0), - j = null; - if ( - (i && - (j = - 1 === i.nodeType && a.dom.hasClass(i, this.unselectableClass) ? i : a.dom.domNode(i).lastLeafNode()), - j) - ) - return { type: "leafnode", range: h, offset: g, node: j }; - } - return { type: "none", range: h, offset: g, node: f }; - } - return null; - }, - executeAndRestoreRangy: function (a, b) { - var c = rangy.saveSelection(this.win); - if (c) - try { - a(); - } catch (d) { - setTimeout(function () { - throw d; - }, 0); - } - else a(); - rangy.restoreSelection(c); - }, - executeAndRestore: function (b, c) { - var d, - e, - f, - h, - i, - j, - k, - l, - m = this.doc.body, - n = c && m.scrollTop, - o = c && m.scrollLeft, - p = "_wysihtml-temp-placeholder", - q = '' + a.INVISIBLE_SPACE + "", - r = this.getRange(!0); - if (!r) return void b(m, m); - r.collapsed || - ((k = r.cloneRange()), (j = k.createContextualFragment(q)), k.collapse(!1), k.insertNode(j), k.detach()), - (i = r.createContextualFragment(q)), - r.insertNode(i), - j && ((d = this.contain.querySelectorAll("." + p)), r.setStartBefore(d[0]), r.setEndAfter(d[d.length - 1])), - this.setSelection(r); - try { - b(r.startContainer, r.endContainer); - } catch (s) { - setTimeout(function () { - throw s; - }, 0); - } - if (((d = this.contain.querySelectorAll("." + p)), d && d.length)) { - (l = rangy.createRange(this.doc)), - (f = d[0].nextSibling), - d.length > 1 && (h = d[d.length - 1].previousSibling), - h && f - ? (l.setStartBefore(f), l.setEndAfter(h)) - : ((e = this.doc.createTextNode(a.INVISIBLE_SPACE)), - g.insert(e).after(d[0]), - l.setStartBefore(e), - l.setEndAfter(e)), - this.setSelection(l); - for (var t = d.length; t--; ) d[t].parentNode.removeChild(d[t]); - } else this.contain.focus(); - c && ((m.scrollTop = n), (m.scrollLeft = o)); - try { - d.parentNode.removeChild(d); - } catch (u) {} - }, - set: function (a, b) { - var c = rangy.createRange(this.doc); - c.setStart(a, b || 0), this.setSelection(c); - }, - insertHTML: function (a) { - var b, - c, - d = this.getRange(), - e = this.doc.createElement("DIV"), - f = this.doc.createDocumentFragment(); - if (d) { - for (d.deleteContents(), e.innerHTML = a, b = e.lastChild; e.firstChild; ) f.appendChild(e.firstChild); - for ( - d.insertNode(f), c = this.contain.lastChild; - c && 3 === c.nodeType && c.previousSibling && /^\s*$/.test(c.data); - - ) - c = c.previousSibling; - b && - (c && b === c && 1 === b.nodeType && this.contain.appendChild(this.doc.createElement("br")), - this.setAfter(b)); - } - }, - insertNode: function (a) { - var b = this.getRange(); - b && (b.deleteContents(), b.insertNode(a)); - }, - canAppendChild: function (a) { - var b, - c, - d = [ - "area", - "base", - "br", - "col", - "command", - "embed", - "hr", - "img", - "input", - "keygen", - "link", - "meta", - "param", - "source", - "track", - "wbr", - ], - e = this.getRange(); - return (b = a || e.startContainer), b && (c = (b.tagName || b.nodeName).toLowerCase()), -1 === d.indexOf(c); - }, - splitElementAtCaret: function (b, c) { - var d, - e, - f, - g, - h, - i = this.getSelection(); - if (i.rangeCount > 0) { - (d = i.getRangeAt(0).cloneRange()), d.setEndAfter(b), (e = d.extractContents()), (h = e.childNodes); - for (var j = h.length; j--; ) a.dom.domNode(h[j]).is.visible() || e.removeChild(h[j]); - b.parentNode.insertBefore(e, b.nextSibling), - c - ? ((f = c.firstChild || c), - (g = c.lastChild || c), - b.parentNode.insertBefore(c, b.nextSibling), - f && g && (d.setStartBefore(f), d.setEndAfter(g), this.setSelection(d))) - : (d.setStartAfter(b), d.setEndAfter(b)), - a.dom.domNode(b).is.visible() || - ("" === a.dom.getTextContent(b) - ? b.parentNode.removeChild(b) - : b.parentNode.replaceChild(this.doc.createTextNode(" "), b)); - } - }, - surround: function (a) { - var b, - c = this.getOwnRanges(), - d = []; - if (0 == c.length) return d; - for (var e = c.length; e--; ) { - (b = this.doc.createElement(a.nodeName)), - d.push(b), - a.className && (b.className = a.className), - a.cssStyle && b.setAttribute("style", a.cssStyle); - try { - c[e].surroundContents(b), this.selectNode(b); - } catch (f) { - b.appendChild(c[e].extractContents()), c[e].insertNode(b); - } - } - return d; - }, - scrollIntoView: function () { - var c, - d = this.doc, - e = 5, - f = d.documentElement.scrollHeight > d.documentElement.offsetHeight, - g = (d._wysihtmlScrollIntoViewElement = - d._wysihtmlScrollIntoViewElement || - (function () { - var b = d.createElement("span"); - return (b.innerHTML = a.INVISIBLE_SPACE), b; - })()); - f && - (this.insertNode(g), - (c = b(g)), - g.parentNode.removeChild(g), - c >= d.body.scrollTop + d.documentElement.offsetHeight - e && (d.body.scrollTop = c)); - }, - selectLine: function () { - var b = rangy.createRange(); - a.browser.supportsSelectionModify() - ? this._selectLine_W3C() - : b.nativeRange && b.nativeRange.getBoundingClientRect && this._selectLineUniversal(); - }, - includeRangyRangeHelpers: function () { - var a = this.getSelection(), - b = a.getRangeAt(0), - c = function (a) { - return a && 1 === a.nodeType && a.classList.contains("rangySelectionBoundary"); - }, - d = function (a) { - return 1 === a.nodeType ? (a.childNodes && a.childNodes.length) || 0 : (a.data && a.data.length) || 0; - }, - e = 1 === a.anchorNode.nodeType ? a.anchorNode.childNodes[a.anchorOffset] : a.anchorNode, - f = 1 === a.focusNode.nodeType ? a.focusNode.childNodes[a.focusOffset] : a.focusNode; - f && a.focusOffset === d(f) && f.nextSibling && c(f.nextSibling) && b.setEndAfter(f.nextSibling), - e && 0 === a.anchorOffset && e.previousSibling && c(e.previousSibling) && b.setStartBefore(e.previousSibling), - b.select(); - }, - _selectLine_W3C: function () { - var a = this.win.getSelection(), - b = [a.anchorNode, a.anchorOffset, a.focusNode, a.focusOffset]; - a.modify("move", "left", "lineboundary"), - a.modify("extend", "right", "lineboundary"), - a.anchorNode === b[0] && a.anchorOffset === b[1] && a.focusNode === b[2] && a.focusOffset === b[3] - ? this._selectLineUniversal() - : this.includeRangyRangeHelpers(); - }, - toLineBoundary: function (b, c) { - if (((c = "undefined" == typeof c ? !1 : c), a.browser.supportsSelectionModify())) { - var d = this.win.getSelection(); - d.modify("extend", b, "lineboundary"), - c && ("left" === b ? d.collapseToStart() : "right" === b && d.collapseToEnd()); - } - }, - getRangeRect: function (a) { - var b, - c = (this.doc.createTextNode("i"), this.doc.createTextNode("i")); - return ( - a.collapsed - ? (a.insertNode(c), a.selectNode(c), (b = a.nativeRange.getBoundingClientRect()), a.deleteContents()) - : (b = a.nativeRange.getBoundingClientRect()), - b - ); - }, - _selectLineUniversal: function () { - var b, - c, - d, - e, - f, - g, - h = this.getSelection(), - i = h.getRangeAt(0), - j = 0, - k = this, - l = function (b) { - return ( - b && - 1 === b.nodeType && - ("block" === k.win.getComputedStyle(b).display || a.lang.array(["BR", "HR"]).contains(b.nodeName)) - ); - }, - m = function (a) { - var b = a; - if (b) - for ( - ; - b && - ((1 === b.nodeType && b.classList.contains("rangySelectionBoundary")) || - (3 === b.nodeType && /^\s*$/.test(b.data))); - - ) - b = b.previousSibling; - return b; - }; - (c = i.cloneRange()), - (d = i.cloneRange()), - i.collapsed && - (3 === i.startContainer.nodeType && i.startOffset < i.startContainer.data.length - ? i.moveEnd("character", 1) - : 1 === i.startContainer.nodeType && - i.startContainer.childNodes[i.startOffset] && - 3 === i.startContainer.childNodes[i.startOffset].nodeType && - i.startContainer.childNodes[i.startOffset].data.length > 0 - ? i.moveEnd("character", 1) - : i.startOffset > 0 && - (3 === i.startContainer.nodeType || - (1 === i.startContainer.nodeType && !l(m(i.startContainer.childNodes[i.startOffset - 1])))) && - i.moveStart("character", -1)), - i.collapsed || i.insertNode(this.doc.createTextNode(a.INVISIBLE_SPACE)), - (b = i.nativeRange.getBoundingClientRect()); - do - (e = i.moveStart("character", -1)), - (f = i.nativeRange.getBoundingClientRect()), - (f && Math.floor(f.top) === Math.floor(b.top)) || (i.moveStart("character", 1), (g = !0)), - j++; - while (0 !== e && !g && 2e3 > j); - if ( - ((j = 0), - (g = !1), - (b = i.nativeRange.getBoundingClientRect()), - i.endContainer !== this.contain || - (this.contain.lastChild && this.contain.childNodes[i.endOffset] !== this.contain.lastChild)) - ) - do - (e = i.moveEnd("character", 1)), - (f = i.nativeRange.getBoundingClientRect()), - (f && Math.floor(f.bottom) === Math.floor(b.bottom)) || - (i.moveEnd("character", -1), - i.endContainer && - 1 === i.endContainer.nodeType && - i.endContainer.childNodes[i.endOffset] && - 1 === i.endContainer.childNodes[i.endOffset].nodeType && - "BR" === i.endContainer.childNodes[i.endOffset].nodeName && - i.endContainer.childNodes[i.endOffset].previousSibling && - (1 === i.endContainer.childNodes[i.endOffset].previousSibling.nodeType - ? i.setEnd( - i.endContainer.childNodes[i.endOffset].previousSibling, - i.endContainer.childNodes[i.endOffset].previousSibling.childNodes.length - ) - : 3 === i.endContainer.childNodes[i.endOffset].previousSibling.nodeType && - i.setEnd( - i.endContainer.childNodes[i.endOffset].previousSibling, - i.endContainer.childNodes[i.endOffset].previousSibling.data.length - )), - (g = !0)), - j++; - while (0 !== e && !g && 2e3 > j); - i.select(), this.includeRangyRangeHelpers(); - }, - getText: function () { - var a = this.getSelection(); - return a ? a.toString() : ""; - }, - getNodes: function (a, b) { - var c = this.getRange(); - return c ? c.getNodes(Array.isArray(a) ? a : [a], b) : []; - }, - getOwnNodes: function (a, b, c) { - for (var d = this.getOwnRanges(), e = [], f = 0, g = d.length; g > f; f++) - d[f] && (c && d[f].splitBoundaries(), (e = e.concat(d[f].getNodes(Array.isArray(a) ? a : [a], b)))); - return e; - }, - fixRangeOverflow: function (a) { - if (this.contain && this.contain.firstChild && a) { - var b = a.compareNode(this.contain); - if (2 !== b) - 1 === b && a.setStartBefore(this.contain.firstChild), - 0 === b && a.setEndAfter(this.contain.lastChild), - 3 === b && (a.setStartBefore(this.contain.firstChild), a.setEndAfter(this.contain.lastChild)); - else if (this._detectInlineRangeProblems(a)) { - var c = a.endContainer.previousElementSibling; - c && a.setEnd(c, this._endOffsetForNode(c)); - } - } - }, - _endOffsetForNode: function (a) { - var b = document.createRange(); - return b.selectNodeContents(a), b.endOffset; - }, - _detectInlineRangeProblems: function (a) { - var b = g.compareDocumentPosition(a.startContainer, a.endContainer); - return 0 == a.endOffset && 4 & b; - }, - getRange: function (a) { - var b = this.getSelection(), - c = b && b.rangeCount && b.getRangeAt(0); - return a !== !0 && this.fixRangeOverflow(c), c; - }, - getOwnUneditables: function () { - var b = g.query(this.contain, "." + this.unselectableClass), - c = g.query(b, "." + this.unselectableClass); - return a.lang.array(b).without(c); - }, - getOwnRanges: function () { - var a, - b = [], - c = this.getRange(); - if ((c && b.push(c), this.unselectableClass && this.contain && c)) { - var d, - e = this.getOwnUneditables(); - if (e.length > 0) - for (var f = 0, g = e.length; g > f; f++) { - a = []; - for (var h = 0, i = b.length; i > h; h++) { - if (b[h]) - switch (b[h].compareNode(e[f])) { - case 2: - break; - case 3: - (d = b[h].cloneRange()), - d.setEndBefore(e[f]), - a.push(d), - (d = b[h].cloneRange()), - d.setStartAfter(e[f]), - a.push(d); - break; - default: - a.push(b[h]); - } - b = a; - } - } - } - return b; - }, - getSelection: function () { - return rangy.getSelection(this.win); - }, - setSelection: function (a) { - var b = rangy.getSelection(this.win); - return b.setSingleRange(a), b && b.anchorNode && b.focusNode ? b : null; - }, - selectAll: function () { - var b, - c = this.createRange(), - d = this.composer, - f = this, - g = e(this.composer.element), - h = e(this.composer.element), - i = function () { - c.setStart(d.element, 0), c.setEnd(d.element, d.element.childNodes.length), (b = f.setSelection(c)); - }, - j = function () { - return ( - !b || - (b.nativeSelection && - b.nativeSelection.type && - ("Caret" === b.nativeSelection.type || "None" === b.nativeSelection.type)) - ); - }; - a.dom.removeInvisibleSpaces(this.composer.element), - i(), - this.composer.element.firstChild && - j() && - (this.composer.element.appendChild(g), - i(), - j() && - (g.parentNode.removeChild(g), - this.composer.element.insertBefore(h, this.composer.element.firstChild), - i(), - j() && (this.composer.element.appendChild(g), i()))); - }, - createRange: function () { - return rangy.createRange(this.doc); - }, - isCollapsed: function () { - return this.getSelection().isCollapsed; - }, - getHtml: function () { - return this.getSelection().toHtml(); - }, - getPlainText: function () { - return this.getSelection().toString(); - }, - isEndToEndInNode: function (b) { - var c = this.getRange(), - d = c.commonAncestorContainer, - e = c.startContainer, - f = c.endContainer; - if ( - (d.nodeType === a.TEXT_NODE && (d = d.parentNode), - e.nodeType === a.TEXT_NODE && !/^\s*$/.test(e.data.substr(c.startOffset))) - ) - return !1; - if (f.nodeType === a.TEXT_NODE && !/^\s*$/.test(f.data.substr(c.endOffset))) return !1; - for (; e && e !== d; ) { - if (e.nodeType !== a.TEXT_NODE && !a.dom.contains(d, e)) return !1; - if (a.dom.domNode(e).prev({ ignoreBlankTexts: !0 })) return !1; - e = e.parentNode; - } - for (; f && f !== d; ) { - if (f.nodeType !== a.TEXT_NODE && !a.dom.contains(d, f)) return !1; - if (a.dom.domNode(f).next({ ignoreBlankTexts: !0 })) return !1; - f = f.parentNode; - } - return a.lang.array(b).contains(d.nodeName) ? d : !1; - }, - isInThisEditable: function () { - var b = this.getSelection(), - c = b.focusNode, - d = b.anchorNode; - return ( - c && 1 !== c.nodeType && (c = c.parentNode), - d && 1 !== d.nodeType && (d = d.parentNode), - d && - c && - (a.dom.contains(this.composer.element, c) || this.composer.element === c) && - (a.dom.contains(this.composer.element, d) || this.composer.element === d) - ); - }, - deselect: function () { - var a = this.getSelection(); - a && a.removeAllRanges(); - }, - }); - })(wysihtml), - (wysihtml.Commands = Base.extend({ - constructor: function (a) { - (this.editor = a), (this.composer = a.composer), (this.doc = this.composer.doc); - }, - support: function (a) { - return wysihtml.browser.supportsCommand(this.doc, a); - }, - exec: function (a, b) { - var c = wysihtml.commands[a], - d = wysihtml.lang.array(arguments).get(), - e = c && c.exec, - f = null; - if ( - (this.composer.hasPlaceholderSet() && - !wysihtml.lang.array(["styleWithCSS", "enableObjectResizing", "enableInlineTableEditing"]).contains(a) && - ((this.composer.element.innerHTML = ""), this.composer.selection.selectNode(this.composer.element)), - this.editor.fire("beforecommand:composer"), - e) - ) - d.unshift(this.composer), (f = e.apply(c, d)); - else - try { - f = this.doc.execCommand(a, !1, b); - } catch (g) {} - return this.editor.fire("aftercommand:composer"), f; - }, - remove: function (a, b) { - var c = wysihtml.commands[a], - d = wysihtml.lang.array(arguments).get(), - e = c && c.remove; - return e ? (d.unshift(this.composer), e.apply(c, d)) : void 0; - }, - state: function (a, b) { - var c = wysihtml.commands[a], - d = wysihtml.lang.array(arguments).get(), - e = c && c.state; - if (e) return d.unshift(this.composer), e.apply(c, d); - try { - return this.doc.queryCommandState(a); - } catch (f) { - return !1; - } - }, - stateValue: function (a) { - var b = wysihtml.commands[a], - c = wysihtml.lang.array(arguments).get(), - d = b && b.stateValue; - return d ? (c.unshift(this.composer), d.apply(b, c)) : !1; - }, - })), - (function (a) { - function b(b) { - return a.lang.object({}).merge(c).merge({ attribute: b }).get(); - } - var c = { nodeName: "A", toggle: !1 }; - a.commands.createLink = { - exec: function (c, d, e) { - var f = b(e); - if (c.selection.isCollapsed() && !this.state(c, d)) { - var g = c.doc.createTextNode(f.attribute.href); - c.selection.insertNode(g), c.selection.selectNode(g); - } - a.commands.formatInline.exec(c, d, f); - }, - state: function (b, d) { - return a.commands.formatInline.state(b, d, c); - }, - }; - })(wysihtml), - (function (a) { - function b(a) { - return { - nodeName: a.nodeName || null, - className: a.classRegExp ? null : a.className || null, - classRegExp: a.classRegExp || null, - styleProperty: a.styleProperty || null, - }; - } - function c(a, b) { - return 3 === a.nodeType ? a : a.childNodes[b] || a; - } - function d(a) { - return a && 1 === a.nodeType && "BR" === a.nodeName; - } - function e(a, b) { - return a && 1 === a.nodeType && "block" === b.win.getComputedStyle(a).display; - } - function f(a) { - return a && 1 === a.nodeType && a.classList.contains("rangySelectionBoundary"); - } - function g(a, b) { - return d(a) || e(a, b); - } - function h(b, c) { - a.dom.removeInvisibleSpaces(b.element); - for ( - var d, - e = b.element, - f = e.querySelectorAll(E), - g = - b.config.classNames.uneditableContainer + - [""].concat(E.split(",")).join(", " + b.config.classNames.uneditableContainer + " "), - h = e.querySelectorAll(g), - i = a.lang.array(f).without(h), - j = i.length; - j--; - - ) - "" !== i[j].innerHTML.replace(/[\uFEFF]/g, "") || - (0 !== c.length && i[j] === c[c.length - 1]) || - ((d = a.lang.array(c).indexOf(i[j])), d > -1 && c.splice(d, 1), i[j].parentNode.removeChild(i[j])); - return c; - } - function i(a) { - return a.config.useLineBreaks ? "DIV" : "P"; - } - function j(a, b, c) { - for (var d = a, e = null; d && b && d !== b; ) - 1 === d.nodeType && d.matches(c ? E : D) && (e = d), (d = d.parentNode); - return e; - } - function k(a, b) { - for (var c, d, e, f = a, g = null; f && b && f !== b; ) - 1 === f.nodeType && - f.matches(F) && - ((d = f), null === g ? ((g = f.cloneNode(!1)), (c = g)) : ((e = f.cloneNode(!1)), e.appendChild(g), (g = e))), - (f = f.parentNode); - return { parent: d, outerNode: g, innerNode: c }; - } - function l(b, c, d) { - return ( - b || ((b = d.doc.createElement(c.nodeName || i(d))), b.appendChild(d.doc.createTextNode(a.INVISIBLE_SPACE))), - c.nodeName && b.nodeName !== c.nodeName && (b = C.renameElement(b, c.nodeName)), - c.classRegExp && (b.className = b.className.replace(c.classRegExp, "")), - c.className && b.classList.add(c.className), - c.styleProperty && - "undefined" != typeof c.styleValue && - (b.style[a.browser.fixStyleKey(c.styleProperty)] = c.styleValue), - b - ); - } - function m(b, c, d) { - var e, - f = b.previousSibling, - g = b.nextSibling, - h = !1; - c.styleProperty && (b.style[a.browser.fixStyleKey(c.styleProperty)] = ""), - c.className && b.classList.remove(c.className), - c.classRegExp && (b.className = b.className.replace(c.classRegExp, "")), - null !== b.getAttribute("class") && "" === b.getAttribute("class").trim() && b.removeAttribute("class"), - c.nodeName && - b.nodeName.toLowerCase() === c.nodeName.toLowerCase() && - ((e = b.getAttribute("style")), - e && "" !== e.trim() ? (b = C.renameElement(b, i(d))) : (C.unwrap(b), (h = !0))), - null !== b.getAttribute("style") && "" === b.getAttribute("style").trim() && b.removeAttribute("style"), - h && u(f, g, d); - } - function n(b) { - for (var c, d, e = b.querySelectorAll(E) || [], f = e.length; f--; ) - (c = a.dom.domNode(e[f]).next({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - (d = a.dom.domNode(e[f]).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - c && - 1 !== c.nodeType && - "BR" !== c.nodeName && - "" !== (e[f].innerHTML || e[f].nodeValue || "").trim() && - e[f].parentNode.insertBefore(e[f].ownerDocument.createElement("BR"), c), - c && - 1 !== c.nodeType && - "BR" !== c.nodeName && - "" !== (e[f].innerHTML || e[f].nodeValue || "").trim() && - e[f].parentNode.insertBefore(e[f].ownerDocument.createElement("BR"), c), - a.dom.unwrap(e[f]); - } - function o(a, b) { - var c, - d = a.startContainer, - e = a.endContainer; - return d && 1 === d.nodeType && d === e - ? void ( - d.firstChild === d.lastChild && - 1 === a.endOffset && - d !== b.element && - "LI" !== d.nodeName && - "TD" !== d.nodeName && - (a.setStartBefore(d), a.setEndAfter(e)) - ) - : d && 1 === d.nodeType && 3 === e.nodeType - ? void ( - d.firstChild === e && - a.endOffset === e.data.length && - d !== b.element && - "LI" !== d.nodeName && - "TD" !== d.nodeName && - a.setEndAfter(d) - ) - : e && 1 === e.nodeType && 3 === d.nodeType - ? void ( - e.firstChild === d && - 0 === a.startOffset && - e !== b.element && - "LI" !== e.nodeName && - "TD" !== e.nodeName && - a.setStartBefore(e) - ) - : d && 3 === d.nodeType && d === e && 1 === d.parentNode.childNodes.length - ? void ( - a.endOffset == e.data.length && - 0 === a.startOffset && - ((c = d.parentNode), - c !== b.element && "LI" !== c.nodeName && "TD" !== c.nodeName && (a.setStartBefore(c), a.setEndAfter(c))) - ) - : void 0; - } - function p(b) { - for (var c, d, e, f, g, h, i = [], j = 0, k = b.length; k > j; j++) - if ( - (1 === b[j].startContainer.nodeType && - b[j].startContainer.matches("ul, ol") && - b[j].setStart(b[j].startContainer.childNodes[b[j].startOffset], 0), - 1 === b[j].endContainer.nodeType && - b[j].endContainer.matches("ul, ol") && - ((h = b[j].endContainer.childNodes[Math.max(b[j].endOffset - 1, 0)]), - h.childNodes && b[j].setEnd(h, h.childNodes.length)), - (c = b[j].getNodes([1], function (a) { - return "LI" === a.nodeName; - })), - c.length > 0) - ) { - for (d = 0, e = c.length; e > d; d++) - (g = b[j].compareNode(c[d])), - (g === b[j].NODE_AFTER || g === b[j].NODE_INSIDE) && - ((f = b[j].cloneRange()), - (h = a.dom.domNode(c[d]).prev({ nodeTypes: [1] })), - h - ? f.setEnd(h, h.childNodes.length) - : c[d].closest("ul, ol") - ? f.setEndBefore(c[d].closest("ul, ol")) - : f.setEndBefore(c[d]), - i.push(f), - b[j].setStart(c[d], 0)), - (g === b[j].NODE_BEFORE || g === b[j].NODE_INSIDE) && - ((f = b[j].cloneRange()), - f.setEnd(c[d], c[d].childNodes.length), - i.push(f), - (h = a.dom.domNode(c[d]).next({ nodeTypes: [1] })), - h - ? b[j].setStart(h, 0) - : c[d].closest("ul, ol") - ? b[j].setStartAfter(c[d].closest("ul, ol")) - : b[j].setStartAfter(c[d])); - i.push(b[j]); - } else i.push(b[j]); - return i; - } - function q(b, c, d) { - var e = b ? a.lang.object(b).clone(!0) : null; - return e && (e.nodeName = e.nodeName || c || i(d)), e; - } - function r(b, c, d, e) { - var f, - h, - i, - l, - m, - n = c.startContainer, - e = e || j(n, d.element, !0); - if (e) - (h = b.firstChild), - (i = b.lastChild), - d.selection.splitElementAtCaret(e, b), - (m = a.dom.domNode(i).next({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - (l = a.dom.domNode(h).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - h && !g(h, d) && l && !g(l, d) && h.parentNode.insertBefore(d.doc.createElement("br"), h), - i && !g(i, d) && m && !g(m, d) && m.parentNode.insertBefore(d.doc.createElement("br"), m); - else if (((f = k(n, d.element)), f.outerNode && f.innerNode && f.parent)) { - if (1 === b.childNodes.length) { - for (; b.firstChild.firstChild; ) f.innerNode.appendChild(b.firstChild.firstChild); - b.firstChild.appendChild(f.outerNode); - } - d.selection.splitElementAtCaret(f.parent, b); - } else { - var o = b.firstChild, - p = b.lastChild; - c.insertNode(b), c.setStartBefore(o), c.setEndAfter(p); - } - } - function s(b, d, e) { - for ( - var f, - h, - i = b.cloneRange(), - j = c(i.startContainer, i.startOffset).previousSibling, - k = c(i.endContainer, i.endOffset).nextSibling, - l = i.extractContents(), - m = e.doc.createDocumentFragment(), - o = !0; - l.firstChild; - - ) { - if (1 === l.firstChild.nodeType && l.firstChild.matches(E)) { - n(l.firstChild), - (f = a.dom.unwrap(l.firstChild)), - f.length > 0 && - ((m.lastChild && (1 !== m.lastChild.nodeType || !g(m.lastChild, e))) || - (!m.lastChild && j && (1 !== j.nodeType || g(j, e)))) && - m.appendChild(e.doc.createElement("BR")); - for (var p = 0, q = f.length; q > p; p++) m.appendChild(f[p]); - f.length > 0 && - ((1 === m.lastChild.nodeType && g(m.lastChild, e)) || - ((k || m.lastChild !== l.lastChild) && m.appendChild(e.doc.createElement("BR")))); - } else m.appendChild(l.firstChild); - o = !1; - } - return (h = a.lang.array(m.childNodes).get()), r(m, i, e), h; - } - function t(b, c, e) { - var f = b && a.dom.domNode(b).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 }); - d(c) && c.parentNode.removeChild(c), - !d(b) || - (f && 1 === f.nodeType && "block" === e.win.getComputedStyle(f).display) || - b.parentNode.removeChild(b); - } - function u(a, b, c) { - var e; - a && f(a) && (a = a.previousSibling), - b && f(b) && (b = b.nextSibling), - (e = a && a.previousSibling), - a && - (1 !== a.nodeType || ("block" !== c.win.getComputedStyle(a).display && !d(a))) && - a.parentNode && - a.parentNode.insertBefore(c.doc.createElement("br"), a.nextSibling), - b && - (1 !== b.nodeType || "block" !== c.win.getComputedStyle(b).display) && - b.parentNode && - b.parentNode.insertBefore(c.doc.createElement("br"), b); - } - function v(d, e, f, g) { - var h, - i, - k = e ? b(e) : null, - m = d.cloneRange(), - o = m.startContainer, - p = c(m.startContainer, m.startOffset), - s = c(m.endContainer, m.endOffset), - u = - m.startContainer !== p || 3 !== p.nodeType || G(p, m.startOffset) - ? a.dom.domNode(p).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 }) - : p, - v = - (1 === m.endContainer.nodeType && - m.endContainer.childNodes[m.endOffset] === s && - (1 === s.nodeType || (!H(s, m.endOffset) && !a.dom.domNode(s).is.rangyBookmark()))) || - (m.endContainer === s && 3 === s.nodeType && !H(s, m.endOffset)) - ? s - : a.dom.domNode(s).next({ nodeTypes: [1, 3], ignoreBlankTexts: !0 }), - w = m.extractContents(), - x = g.doc.createDocumentFragment(), - y = k ? a.dom.getParentElement(o, k, null, g.element) : null, - z = !f || !e || ("BLOCKQUOTE" === e.nodeName && "BLOCKQUOTE" === f), - A = y || j(o, g.element, z); - if ( - (a.dom.domNode(v).is.rangyBookmark() && ((s = v), (v = s.nextSibling)), I(w), e && "BLOCKQUOTE" === e.nodeName) - ) { - var B = l(null, e, g); - B.appendChild(w), x.appendChild(B), (i = [B]); - } else { - if (w.firstChild) - for (; w.firstChild; ) - if (1 == w.firstChild.nodeType && w.firstChild.matches(E)) - l(w.firstChild, e, g), w.firstChild.matches(D) && n(w.firstChild), x.appendChild(w.firstChild); - else { - for ( - h = l(null, q(e, f, g), g); - w.firstChild && (1 !== w.firstChild.nodeType || !w.firstChild.matches(E)); - - ) - 1 == w.firstChild.nodeType && h.matches(D) && n(w.firstChild), h.appendChild(w.firstChild); - x.appendChild(h); - } - else x.appendChild(l(null, e, g)); - i = a.lang.array(x.childNodes).get(); - } - return ( - r(x, m, g, A), - t(u, v, g), - i.length > 0 && - ("undefined" == typeof i[i.length - 1].lastChild || - a.dom.domNode(i[i.length - 1].lastChild).is.rangyBookmark()) && - i[i.length - 1].appendChild(g.doc.createElement("br")), - i - ); - } - function w(b, c) { - var d = a.dom.getParentElement(b, { query: E }, null, c.element); - return d ? d.nodeName : null; - } - function x(b, c) { - var d, - e = a.dom.getParentElement( - b.selection.getOwnRanges()[0].startContainer, - { query: D + ", " + (c ? c.toLowerCase() : "div") }, - null, - b.element - ); - e - ? ((d = b.selection.createRange()), d.selectNode(e), b.selection.setSelection(d)) - : b.isEmpty() || b.selection.selectLine(); - } - function y(a, b) { - var c = b.selection.createRange(), - d = a[a.length - 1], - e = 1 === d.nodeType && d.childNodes ? 0 | d.childNodes.length : d.length || 0; - c.setStart(a[0], 0), c.setEnd(d, e), c.select(); - } - function z(a, b, c) { - var d, - e = b.selection.getOwnRanges(), - f = []; - e = p(e); - for (var g = e.length; g--; ) - o(e[g], b), - (d = w(e[g].startContainer, b)), - (f = "remove" === a ? f.concat(s(e[g], d, b)) : f.concat(v(e[g], c, d, b))); - return f; - } - function A(a) { - return "string" == typeof a && (a = { nodeName: a.toUpperCase() }), a; - } - function B(b) { - var c; - return b.selection.isCollapsed() && - ((c = b.selection.getNodesNearCaret()), - c && - c.caretNode && - (a.dom.domNode(c.caretNode).is.lineBreak() || - (3 === c.caretNode.nodeType && - 0 === c.textOffset && - (!c.prevNode || a.dom.domNode(c.prevNode).is.lineBreak())) || - (1 === c.caretNode.nodeType && - c.caretNode.classList.contains("rangySelectionBoundary") && - (!c.prevNode || a.dom.domNode(c.prevNode).is.lineBreak() || a.dom.domNode(c.prevNode).is.block()) && - (!c.nextNode || a.dom.domNode(c.nextNode).is.lineBreak() || a.dom.domNode(c.nextNode).is.block())))) - ? !0 - : !1; - } - var C = a.dom, - D = "h1, h2, h3, h4, h5, h6, p, pre", - E = "h1, h2, h3, h4, h5, h6, p, pre, div, blockquote", - F = - "b, big, i, small, tt, abbr, acronym, cite, code, dfn, em, kbd, strong, samp, var, a, bdo, br, q, span, sub, sup, button, label, textarea, input, select, u", - G = function (a, b) { - var c = a.data ? a.data.slice(0, b) : ""; - return /^\s*$/.test(c); - }, - H = function (a, b) { - var c = a.data ? a.data.slice(b) : ""; - return /^\s*$/.test(c); - }, - I = function (a) { - if (a) { - for ( - ; - a.firstChild && - 3 === a.firstChild.nodeType && - /^\s*$/.test(a.firstChild.data) && - a.lastChild !== a.firstChild; - - ) - a.removeChild(a.firstChild); - for ( - ; - a.lastChild && 3 === a.lastChild.nodeType && /^\s*$/.test(a.lastChild.data) && a.lastChild !== a.firstChild; - - ) - a.removeChild(a.lastChild); - a.firstChild && - 1 === a.firstChild.nodeType && - "BR" === a.firstChild.nodeName && - a.lastChild !== a.firstChild && - a.removeChild(a.firstChild), - a.lastChild && - 1 === a.lastChild.nodeType && - "BR" === a.lastChild.nodeName && - a.lastChild !== a.firstChild && - a.removeChild(a.lastChild); - } - }; - a.commands.formatBlock = { - exec: function (a, b, c) { - c = A(c); - var d, - e, - f = []; - if ((c && c.toggle && (e = this.state(a, b, c)), e)) { - d = rangy.saveSelection(a.win); - for (var g = 0, i = e.length; i > g; g++) m(e[g], c, a); - } else - a.selection.isCollapsed() && - ((d = rangy.saveSelection(a.win)), - B(a) ? a.selection.selectLine() : x(a, c && c.nodeName ? c.nodeName.toUpperCase() : void 0)), - (f = c ? z("apply", a, c) : z("remove", a)); - (f = h(a, f)), d ? rangy.restoreSelection(d) : y(f, a); - }, - remove: function (a, b, c) { - c = A(c); - var d, e; - a.selection.isCollapsed() && - ((e = rangy.saveSelection(a.win)), x(a, c && c.nodeName ? c.nodeName.toUpperCase() : void 0)), - (d = z("remove", a)), - (d = h(a, d)), - e ? rangy.restoreSelection(e) : y(d, a); - }, - state: function (b, c, d) { - d = A(d); - for ( - var e, - f = b.selection.filterElements( - function (b) { - return a.dom.domNode(b).test(d || { query: E }); - }.bind(this) - ), - g = b.selection.getSelectedOwnNodes(), - h = 0, - i = g.length; - i > h; - h++ - ) - (e = C.getParentElement(g[h], d || { query: E }, null, b.element)), e && -1 === f.indexOf(e) && f.push(e); - return 0 === f.length ? !1 : f; - }, - }; - })(wysihtml), - (function (a) { - function b(a) { - return /^\s*$/.test(a.className); - } - function c(a) { - return !a.getAttribute("style") || /^\s*$/.test(a.getAttribute("style")); - } - function d(b) { - var c = a.dom.getAttributes(b); - return a.lang.object(c).isEmpty(); - } - function e(b, c) { - var d, e, f, g; - return 1 !== b.nodeType || 1 !== c.nodeType - ? !1 - : b.nodeName !== c.nodeName - ? !1 - : ((d = b.className.trim().replace(/\s+/g, " ").split(" ")), - (e = c.className.trim().replace(/\s+/g, " ").split(" ")), - a.lang.array(d).without(e).length > 0 - ? !1 - : ((f = a.dom.getAttributes(b)), - (g = a.dom.getAttributes(c)), - f.length === g.length && a.lang.object(a.lang.object(f).difference(g)).isEmpty() ? !0 : !1)); - } - function f(b, c) { - var d = (c && c.nodeName) || F, - e = b.ownerDocument.createElement(d); - if ( - (c.classRegExp && (e.className = e.className.replace(c.classRegExp, "")), - c.className && e.classList.add(c.className), - c.styleProperty && - "undefined" != typeof c.styleValue && - (e.style[a.browser.fixStyleKey(c.styleProperty)] = c.styleValue), - c.attribute) - ) - if ("object" == typeof c.attribute) - for (var f in c.attribute) c.attribute.hasOwnProperty(f) && e.setAttribute(f, c.attribute[f]); - else "undefined" != typeof c.attributeValue && e.setAttribute(c.attribute, c.attributeValue); - return e; - } - function g(a, b) { - for (var c in a) if (a.hasOwnProperty(c) && (void 0 === typeof b[c] || b[c] !== a[c])) return !1; - return !0; - } - function h(b, c, d) { - var e, - f = a.dom.getAttributes(b), - h = g(c, f); - a.lang.object(f).difference(c); - if (h && d !== !1) for (e in c) c.hasOwnProperty(e) && b.removeAttribute(e); - else for (e in c) c.hasOwnProperty(e) && b.setAttribute(e, c[e]); - } - function i(e, f) { - var g, i, j; - f.className && - (f.toggle !== !1 && e.classList.contains(f.className) - ? e.classList.remove(f.className) - : (f.classRegExp && (e.className = e.className.replace(f.classRegExp, "")), e.classList.add(f.className)), - b(e) && e.removeAttribute("class")), - f.styleProperty && - (f.toggle !== !1 && - e.style[a.browser.fixStyleKey(f.styleProperty)].trim().replace(/, /g, ",") === f.styleValue - ? (e.style[a.browser.fixStyleKey(f.styleProperty)] = "") - : (e.style[a.browser.fixStyleKey(f.styleProperty)] = f.styleValue)), - c(e) && e.removeAttribute("style"), - f.attribute && - ("object" == typeof f.attribute ? (g = f.attribute) : ((g = {}), (g[f.attribute] = f.attributeValue || "")), - h(e, g, f.toggle)), - (i = f.nodeName ? H[f.nodeName.toLowerCase()] || f.nodeName.toLowerCase() : null), - (j = i ? a.dom.domNode(e).test({ query: i }) : !1), - (!f.nodeName || f.nodeName === F || j) && - ((f.toggle !== !1 && j) || (!f.nodeName && e.nodeName === F)) && - b(e) && - c(e) && - d(e) && - a.dom.unwrap(e); - } - function j(b, c) { - var d = []; - return ( - b.isCollapsed() || - (d = d.concat( - b.getOwnNodes( - [3], - function (b) { - return !a.dom.domNode(b).is.emptyTextNode(); - }, - c - ) - )), - d - ); - } - function k(a, b, c, d) { - var e = a, - f = d ? b : l(b); - do { - if (1 === e.nodeType && m(e, f)) return e; - e = e.parentNode; - } while (e && e !== c); - return null; - } - function l(a) { - return { - nodeName: a.nodeName || null, - className: a.classRegExp ? null : a.className || null, - classRegExp: a.classRegExp || null, - styleProperty: a.styleProperty || null, - }; - } - function m(b, c) { - var d; - if (c.nodeName) { - var e = H[c.nodeName.toLowerCase()] || c.nodeName.toLowerCase(); - return a.dom.domNode(b).test({ query: e }); - } - return (d = a.lang.object(c).clone()), (d.query = G), a.dom.domNode(b).test(d); - } - function n(b, c) { - var d = document.documentElement || document.body, - e = d.scrollTop, - f = d.scrollLeft; - rangy.getSelection(b.win); - rangy.getSelection(b.win).removeAllRanges(); - try { - rangy.getSelection(b.win).addRange(c); - } catch (g) {} - (b.doc.activeElement && a.dom.contains(b.element, b.doc.activeElement)) || - (b.element.focus(), (d.scrollTop = e), (d.scrollLeft = f), rangy.getSelection(b.win).addRange(c)); - } - function o(a, b) { - var c = rangy.createRange(b.doc), - d = a[a.length - 1]; - a[0] && d && (c.setStart(a[0], 0), c.setEnd(d, d.length), n(b, c)); - } - function p(a, b, c, d) { - var e = rangy.createRange(a.doc); - b && (e.setStart(b, c), e.setEnd(b, "undefined" != typeof d ? d : c), n(a, e)); - } - function q(a, b, c) { - var d, - e, - f, - g = j(a.selection), - h = [], - i = !1; - if (a.selection.isInThisEditable()) { - if (0 === g.length && a.selection.isCollapsed()) { - if (((f = a.selection.getSelection().anchorNode), !f)) return { nodes: [], partial: !1 }; - 3 === f.nodeType && (g = [f]); - } - g.length || ((e = a.selection.getOwnRanges()[0]), e && (g = [e.endContainer])); - for (var l = 0, m = g.length; m > l; l++) (d = k(g[l], b, a.element, c)), d ? h.push(d) : (i = !0); - } - return { nodes: h, partial: i }; - } - function r(a) { - var b, c, d, e; - return a && ((b = a.anchorNode), (c = a.anchorOffset), b && 3 === b.nodeType && c > 0 && c < b.data.length) - ? ((d = b.data[c - 1]), (e = b.data[c]), /\w/.test(d) && /\w/.test(e)) - : !1; - } - function s(b) { - var c, - d, - e, - f, - g, - h, - i = []; - if ( - b && - ((c = b.anchorNode), - (d = g = h = b.anchorOffset), - (e = c.ownerDocument), - (f = rangy.createRange(e)), - c && 3 === c.nodeType) - ) { - for (; g > 0 && /\w/.test(c.data[g - 1]); ) g--; - for (; h < c.data.length && /\w/.test(c.data[h]); ) h++; - return ( - f.setStartAndEnd(c, g, h), - f.splitBoundaries(), - (i = f.getNodes([3], function (b) { - return !a.dom.domNode(b).is.emptyTextNode(); - })), - { wordOffset: d - g, range: f, textNode: i[0] } - ); - } - return !1; - } - function t(a, b) { - for (; b.firstChild; ) a.appendChild(b.firstChild); - b.parentNode.removeChild(b); - } - function u(a) { - for (var b = a.length; b--; ) - a[b] && - a[b].parentNode && - (a[b].nextSibling && e(a[b], a[b].nextSibling) && t(a[b], a[b].nextSibling), - a[b].previousSibling && e(a[b], a[b].previousSibling) && t(a[b].previousSibling, a[b])); - } - function v(a, b, c) { - b.length > 0 && o(b, a), u(q(a, c).nodes), b.length > 0 && o(b, a); - } - function w(a, b, c, d) { - p(a, b, c), u(q(a, d).nodes), p(a, b, c); - } - function x(a, b) { - var c = f(a, b); - a.parentNode.insertBefore(c, a), c.appendChild(a); - } - function y(b, c, d) { - var e, - f = c.element, - g = k(b, d, f); - g && ((e = g.cloneNode(!1)), a.dom.domNode(b).escapeParent(g, e), i(e, d)); - } - function z(b, c, d) { - var e = c.element, - f = k(b, d, e); - f && a.dom.domNode(b).escapeParent(f); - } - function A(a, b, c) { - var d = f(a.endContainer, c); - a.surroundContents(d), b.selection.selectNode(d); - } - function B(b, c, d, e) { - var f, - g, - h, - j, - l = q(b, e, !0), - m = b.selection.getSelection(); - if (c.length) { - if (l.partial || e.toggle === !1) - for (j = c.length; j--; ) k(c[j], e, b.element) && y(c[j], b, e), k(c[j], e, b.element) || x(c[j], e); - else for (j = c.length; j--; ) y(c[j], b, e); - v(b, c, e); - } else if (e.toggle !== !1) - if (r(m)) (f = s(m)), (g = f.textNode), y(f.textNode, b, e), w(b, f.textNode, f.wordOffset, e); - else { - (g = b.doc.createTextNode(a.INVISIBLE_SPACE)), - (h = d.nodes[0].cloneNode(!1)), - h.appendChild(g), - b.selection.splitElementAtCaret(d.nodes[0], h), - i(h, e), - v(b, [g], e); - var n = b.selection.getSelection(); - if (n.anchorNode && n.focusNode) - try { - n.collapseToEnd(); - } catch (o) {} - } - else for (j = d.nodes.length; j--; ) i(d.nodes[j], e); - } - function C(b, c, d, e) { - var f, - g, - h, - i = b.selection.getSelection(); - if (c.length) { - for (h = c.length; h--; ) z(c[h], b, e); - v(b, c, e); - } else { - for (f = i.anchorNode, g = i.anchorOffset, h = d.nodes.length; h--; ) a.dom.unwrap(d.nodes[h]); - w(b, f, g, e); - } - } - function D(a, b, c) { - var d, - e, - f = a.selection.getSelection(); - if (b.length) { - for (e = b.length; e--; ) x(b[e], c); - v(a, b, c); - } else if (r(f)) (d = s(f)), x(d.textNode, c), w(a, d.textNode, d.wordOffset, c); - else { - var g = a.selection.getOwnRanges()[0]; - g && A(g, a, c); - } - } - function E(a) { - return (a = "string" == typeof a ? { nodeName: a } : a), a.nodeName && (a.nodeName = a.nodeName.toUpperCase()), a; - } - var F = "SPAN", - G = - "b, big, i, small, tt, abbr, acronym, cite, code, dfn, em, kbd, strong, samp, var, a, bdo, br, q, span, sub, sup, button, label, textarea, input, select, u", - H = { b: "b, strong", strong: "b, strong", em: "em, i", i: "em, i" }; - a.commands.formatInline = { - exec: function (a, b, c) { - (c = E(c)), a.element.normalize(); - var d = j(a.selection, !0), - e = q(a, c); - e.nodes.length > 0 ? B(a, d, e, c) : D(a, d, c), a.element.normalize(); - }, - remove: function (a, b, c) { - (c = E(c)), a.element.normalize(); - var d = j(a.selection, !0), - e = q(a, c); - e.nodes.length > 0 && C(a, d, e, c), a.element.normalize(); - }, - state: function (a, b, c) { - c = E(c); - var d = q(a, c, !0).nodes; - return 0 === d.length ? !1 : d; - }, - }; - })(wysihtml), - (function (a) { - a.commands.indentList = { - exec: function (a, b, c) { - var d = a.selection.getSelectionParentsByTag("LI"); - return d ? this.tryToPushLiLevel(d, a.selection) : !1; - }, - state: function (a, b) { - return !1; - }, - tryToPushLiLevel: function (b, c) { - var d, - e, - f, - g, - h, - i = !1; - return ( - c.executeAndRestoreRangy(function () { - for (var c = b.length; c--; ) - (g = b[c]), - (d = "OL" === g.parentNode.nodeName ? "OL" : "UL"), - (e = g.ownerDocument.createElement(d)), - (f = a.dom.domNode(g).prev({ nodeTypes: [a.ELEMENT_NODE] })), - (h = f ? f.querySelector("ul, ol") : null), - f && (h ? h.appendChild(g) : (e.appendChild(g), f.appendChild(e)), (i = !0)); - }), - i - ); - }, - }; - })(wysihtml), - (function (a) { - a.commands.insertHTML = { - exec: function (a, b, c) { - a.selection.insertHTML(c); - }, - state: function () { - return !1; - }, - }; - })(wysihtml), - (function (a) { - var b = "
        " + (a.browser.needsSpaceAfterLineBreak() ? " " : ""); - a.commands.insertLineBreak = { - exec: function (a, c) { - a.selection.insertHTML(b); - }, - state: function () { - return !1; - }, - }; - })(wysihtml), - (wysihtml.commands.insertList = (function (a) { - var b = function (a, b) { - if (a && a.nodeName) { - "string" == typeof b && (b = [b]); - for (var c = b.length; c--; ) if (a.nodeName === b[c]) return !0; - } - return !1; - }, - c = function (c, d, e) { - var f = { el: null, other: !1 }; - if (c) { - var g = a.dom.getParentElement(c, { query: "li" }, !1, e.element), - h = "UL" === d ? "OL" : "UL"; - b(c, d) - ? (f.el = c) - : b(c, h) - ? (f = { el: c, other: !0 }) - : g && - (b(g.parentNode, d) - ? (f.el = g.parentNode) - : b(g.parentNode, h) && (f = { el: g.parentNode, other: !0 })); - } - return f.el && !e.element.contains(f.el) && (f.el = null), f; - }, - d = function (b, c, d) { - var e, - g, - h = "UL" === c ? "OL" : "UL"; - d.selection.executeAndRestoreRangy(function () { - if (((e = f(h, d)), e.length)) for (var i = e.length; i--; ) a.dom.renameElement(e[i], c.toLowerCase()); - else { - g = f(["OL", "UL"], d); - for (var j = g.length; j--; ) a.dom.resolveList(g[j], d.config.useLineBreaks); - 0 === g.length && a.dom.resolveList(b, d.config.useLineBreaks); - } - }); - }, - e = function (b, c, d) { - var e = "UL" === c ? "OL" : "UL"; - d.selection.executeAndRestoreRangy(function () { - for (var g = [b].concat(f(e, d)), h = g.length; h--; ) a.dom.renameElement(g[h], c.toLowerCase()); - }); - }, - f = function (a, c) { - for (var d = c.selection.getOwnRanges(), e = [], f = d.length; f--; ) - e = e.concat( - d[f].getNodes([1], function (c) { - return b(c, a); - }) - ); - return e; - }, - g = function (b, c) { - var d, - e, - f = rangy.saveSelection(c.win), - g = "_wysihtml-temp-" + new Date().getTime(); - c.commands.exec("formatBlock", { nodeName: "div", className: g }); - var h = c.element.querySelector("." + g); - (h.innerHTML = h.innerHTML.replace(a.INVISIBLE_SPACE_REG_EXP, "")), - h && - ((d = /^(\s|(
        ))+$/i.test(h.innerHTML)), - (e = a.dom.convertToList(h, b.toLowerCase(), c.parent.config.classNames.uneditableContainer)), - f && rangy.restoreSelection(f), - d && c.selection.selectNode(e.querySelector("li"), !0)); - }; - return { - exec: function (b, f, h) { - var i, - j, - k = b.doc, - l = "OL" === h ? "insertOrderedList" : "insertUnorderedList", - m = b.selection.getSelection(), - n = - 1 === m.anchorNode.nodeType && m.anchorNode.firstChild - ? m.anchorNode.childNodes[m.anchorOffset] - : m.anchorNode, - o = - 1 === m.focusNode.nodeType && m.focusNode.firstChild - ? m.focusNode.childNodes[m.focusOffset] || m.focusNode.lastChild - : m.focusNode; - m.isBackwards() && (n = [o, (o = n)][0]), - a.dom.domNode(o).is.emptyTextNode(!0) && - o && - (o = a.dom.domNode(o).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - a.dom.domNode(n).is.emptyTextNode(!0) && - n && - (n = a.dom.domNode(n).next({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - (i = n && o ? (n === o ? n : a.dom.domNode(n).commonAncestor(o, b.element)) : b.selection.getSelectedNode()), - (j = c(i, h, b)), - j.el - ? j.other - ? e(j.el, h, b) - : d(j.el, h, b) - : b.commands.support(l) - ? k.execCommand(l, !1, null) - : g(h, b); - }, - state: function (a, b, d) { - var e = a.selection.getSelectedNode(), - f = c(e, d, a); - return f.el && !f.other ? f.el : !1; - }, - }; - })(wysihtml)), - (function (a) { - a.commands.outdentList = { - exec: function (a, b, c) { - var d = a.selection.getSelectionParentsByTag("LI"); - return d ? this.tryToPullLiLevel(d, a) : !1; - }, - state: function (a, b) { - return !1; - }, - tryToPullLiLevel: function (b, c) { - var d, - e, - f, - g, - h, - i = !1, - j = this; - return ( - c.selection.executeAndRestoreRangy(function () { - for (var k = b.length; k--; ) - if (((g = b[k]), g.parentNode && ((d = g.parentNode), "OL" === d.tagName || "UL" === d.tagName))) { - if ( - ((i = !0), - (e = a.dom.getParentElement(d.parentNode, { query: "ol, ul" }, !1, c.element)), - (f = a.dom.getParentElement(d.parentNode, { query: "li" }, !1, c.element)), - e && f) - ) - g.nextSibling && ((h = j.getAfterList(d, g)), g.appendChild(h)), e.insertBefore(g, f.nextSibling); - else { - g.nextSibling && ((h = j.getAfterList(d, g)), g.appendChild(h)); - for (var l = g.childNodes.length; l--; ) d.parentNode.insertBefore(g.childNodes[l], d.nextSibling); - d.parentNode.insertBefore(document.createElement("br"), d.nextSibling), g.parentNode.removeChild(g); - } - 0 === d.childNodes.length && d.parentNode.removeChild(d); - } - }), - i - ); - }, - getAfterList: function (a, b) { - for (var c = a.nodeName, d = document.createElement(c); b.nextSibling; ) d.appendChild(b.nextSibling); - return d; - }, - }; - })(wysihtml), - (function (a) { - a.commands.redo = { - exec: function (a) { - return a.undoManager.redo(); - }, - state: function (a) { - return !1; - }, - }; - })(wysihtml), - (function (a) { - var b = { nodeName: "A" }; - a.commands.removeLink = { - exec: function (c, d) { - a.commands.formatInline.remove(c, d, b); - }, - state: function (c, d) { - return a.commands.formatInline.state(c, d, b); - }, - }; - })(wysihtml), - (function (a) { - a.commands.undo = { - exec: function (a) { - return a.undoManager.undo(); - }, - state: function (a) { - return !1; - }, - }; - })(wysihtml), - (function (a) { - var b = 90, - c = 89, - d = 8, - e = 46, - f = 25, - g = "data-wysihtml-selection-node", - h = "data-wysihtml-selection-offset", - i = - ('' + a.INVISIBLE_SPACE + "", - '' + a.INVISIBLE_SPACE + "", - a.dom); - a.UndoManager = a.lang.Dispatcher.extend({ - constructor: function (a) { - (this.editor = a), - (this.composer = a.composer), - (this.element = this.composer.element), - (this.position = 0), - (this.historyStr = []), - (this.historyDom = []), - this.transact(), - this._observe(); - }, - _observe: function () { - var a, - f = this; - this.composer.sandbox.getDocument(); - i.observe(this.element, "keydown", function (a) { - if (!a.altKey && (a.ctrlKey || a.metaKey)) { - var d = a.keyCode, - e = d === b && !a.shiftKey, - g = (d === b && a.shiftKey) || d === c; - e ? (f.undo(), a.preventDefault()) : g && (f.redo(), a.preventDefault()); - } - }), - i.observe(this.element, "keydown", function (b) { - var c = b.keyCode; - c !== a && ((a = c), (c === d || c === e) && f.transact()); - }), - this.editor - .on("newword:composer", function () { - f.transact(); - }) - .on("beforecommand:composer", function () { - f.transact(); - }); - }, - transact: function () { - var b, - c, - d, - e, - i, - j = this.historyStr[this.position - 1], - k = this.composer.getValue(!1, !1), - l = this.element.offsetWidth > 0 && this.element.offsetHeight > 0; - if (k !== j) { - var m = (this.historyStr.length = this.historyDom.length = this.position); - m > f && (this.historyStr.shift(), this.historyDom.shift(), this.position--), - this.position++, - l && - ((b = this.composer.selection.getRange()), - (c = b && b.startContainer ? b.startContainer : this.element), - (d = b && b.startOffset ? b.startOffset : 0), - c.nodeType === a.ELEMENT_NODE ? (e = c) : ((e = c.parentNode), (i = this.getChildNodeIndex(e, c))), - e.setAttribute(h, d), - "undefined" != typeof i && e.setAttribute(g, i)); - var n = this.element.cloneNode(!!k); - this.historyDom.push(n), this.historyStr.push(k), e && (e.removeAttribute(h), e.removeAttribute(g)); - } - }, - undo: function () { - this.transact(), - this.undoPossible() && (this.set(this.historyDom[--this.position - 1]), this.editor.fire("undo:composer")); - }, - redo: function () { - this.redoPossible() && (this.set(this.historyDom[++this.position - 1]), this.editor.fire("redo:composer")); - }, - undoPossible: function () { - return this.position > 1; - }, - redoPossible: function () { - return this.position < this.historyStr.length; - }, - set: function (a) { - this.element.innerHTML = ""; - for (var b = 0, c = a.childNodes, d = a.childNodes.length; d > b; b++) - this.element.appendChild(c[b].cloneNode(!0)); - var e, f, i; - a.hasAttribute(h) - ? ((e = a.getAttribute(h)), (i = a.getAttribute(g)), (f = this.element)) - : ((f = this.element.querySelector("[" + h + "]") || this.element), - (e = f.getAttribute(h)), - (i = f.getAttribute(g)), - f.removeAttribute(h), - f.removeAttribute(g)), - null !== i && (f = this.getChildNodeByIndex(f, +i)), - this.composer.selection.set(f, e); - }, - getChildNodeIndex: function (a, b) { - for (var c = 0, d = a.childNodes, e = d.length; e > c; c++) if (d[c] === b) return c; - }, - getChildNodeByIndex: function (a, b) { - return a.childNodes[b]; - }, - }); - })(wysihtml), - (wysihtml.views.View = Base.extend({ - constructor: function (a, b, c) { - (this.parent = a), (this.element = b), (this.config = c), this.config.noTextarea || this._observeViewChange(); - }, - _observeViewChange: function () { - var a = this; - this.parent.on("beforeload", function () { - a.parent.on("change_view", function (b) { - b === a.name - ? ((a.parent.currentView = a), - a.show(), - setTimeout(function () { - a.focus(); - }, 0)) - : a.hide(); - }); - }); - }, - focus: function () { - if ( - !this.element || - !this.element.ownerDocument || - this.element.ownerDocument.querySelector(":focus") !== this.element - ) - try { - this.element && this.element.focus(); - } catch (a) {} - }, - hide: function () { - this.element.style.display = "none"; - }, - show: function () { - this.element.style.display = ""; - }, - disable: function () { - this.element.setAttribute("disabled", "disabled"); - }, - enable: function () { - this.element.removeAttribute("disabled"); - }, - })), - (function (a) { - var b = a.dom, - c = a.browser; - a.views.Composer = a.views.View.extend({ - name: "composer", - constructor: function (a, b, c) { - this.base(a, b, c), - this.config.noTextarea ? (this.editableArea = b) : (this.textarea = this.parent.textarea), - this.config.contentEditableMode ? this._initContentEditableArea() : this._initSandbox(); - }, - clear: function () { - this.element.innerHTML = c.displaysCaretInEmptyContentEditableCorrectly() ? "" : "
        "; - }, - getValue: function (b, c) { - var d = this.isEmpty() ? "" : a.quirks.getCorrectInnerHTML(this.element); - return b !== !1 && (d = this.parent.parse(d, c === !1 ? !1 : !0)), d; - }, - setValue: function (a, b) { - b !== !1 && (a = this.parent.parse(a)); - try { - this.element.innerHTML = a; - } catch (c) { - this.element.innerText = a; - } - }, - cleanUp: function (a) { - var b; - this.selection && this.selection.isInThisEditable() && (b = rangy.saveSelection(this.win)), - this.parent.parse(this.element, void 0, a), - b && rangy.restoreSelection(b); - }, - show: function () { - (this.editableArea.style.display = this._displayStyle || ""), - this.config.noTextarea || this.textarea.element.disabled || (this.disable(), this.enable()); - }, - hide: function () { - (this._displayStyle = b.getStyle("display").from(this.editableArea)), - "none" === this._displayStyle && (this._displayStyle = null), - (this.editableArea.style.display = "none"); - }, - disable: function () { - this.parent.fire("disable:composer"), this.element.removeAttribute("contentEditable"); - }, - enable: function () { - this.parent.fire("enable:composer"), this.element.setAttribute("contentEditable", "true"); - }, - focus: function (b) { - a.browser.doesAsyncFocus() && this.hasPlaceholderSet() && this.clear(), this.base(); - var c = this.element.lastChild; - b && - c && - this.selection && - ("BR" === c.nodeName - ? this.selection.setBefore(this.element.lastChild) - : this.selection.setAfter(this.element.lastChild)); - }, - getScrollPos: function () { - if (this.doc && this.win) { - var a = {}; - return ( - "undefined" != typeof this.win.pageYOffset - ? (a.y = this.win.pageYOffset) - : (a.y = (this.doc.documentElement || this.doc.body.parentNode || this.doc.body).scrollTop), - "undefined" != typeof this.win.pageXOffset - ? (a.x = this.win.pageXOffset) - : (a.x = (this.doc.documentElement || this.doc.body.parentNode || this.doc.body).scrollLeft), - a - ); - } - }, - setScrollPos: function (a) { - a && "undefined" != typeof a.x && "undefined" != typeof a.y && this.win.scrollTo(a.x, a.y); - }, - getTextContent: function () { - return b.getTextContent(this.element); - }, - hasPlaceholderSet: function () { - return ( - this.getTextContent() == - (this.config.noTextarea - ? this.editableArea.getAttribute("data-placeholder") - : this.textarea.element.getAttribute("placeholder")) && this.placeholderSet - ); - }, - isEmpty: function () { - var a = this.element.innerHTML.toLowerCase(); - return ( - /^(\s|
        |<\/br>|

        |<\/p>)*$/i.test(a) || - "" === a || - "
        " === a || - "

        " === a || - "


        " === a || - this.hasPlaceholderSet() - ); - }, - _initContentEditableArea: function () { - var a = this; - this.config.noTextarea - ? (this.sandbox = new b.ContentEditableArea( - function () { - a._create(); - }, - { className: this.config.classNames.sandbox }, - this.editableArea - )) - : ((this.sandbox = new b.ContentEditableArea( - function () { - a._create(); - }, - { className: this.config.classNames.sandbox } - )), - (this.editableArea = this.sandbox.getContentEditable()), - b.insert(this.editableArea).after(this.textarea.element), - this._createWysiwygFormField()); - }, - _initSandbox: function () { - var a = this; - (this.sandbox = new b.Sandbox( - function () { - a._create(); - }, - { stylesheets: this.config.stylesheets, className: this.config.classNames.sandbox } - )), - (this.editableArea = this.sandbox.getIframe()); - var c = this.textarea.element; - b.insert(this.editableArea).after(c), this._createWysiwygFormField(); - }, - _createWysiwygFormField: function () { - if (this.textarea.element.form) { - var a = document.createElement("input"); - (a.type = "hidden"), (a.name = "_wysihtml_mode"), (a.value = 1), b.insert(a).after(this.textarea.element); - } - }, - _create: function () { - var d = this; - (this.doc = this.sandbox.getDocument()), - (this.win = this.sandbox.getWindow()), - (this.element = this.config.contentEditableMode ? this.sandbox.getContentEditable() : this.doc.body), - this.config.noTextarea - ? this.cleanUp() - : ((this.textarea = this.parent.textarea), (this.element.innerHTML = this.textarea.getValue(!0, !1))), - (this.selection = new a.Selection(this.parent, this.element, this.config.classNames.uneditableContainer)), - (this.commands = new a.Commands(this.parent)), - this.config.noTextarea || - b - .copyAttributes(["className", "spellcheck", "title", "lang", "dir", "accessKey"]) - .from(this.textarea.element) - .to(this.element), - this._initAutoLinking(), - b.addClass(this.element, this.config.classNames.composer), - this.config.style && !this.config.contentEditableMode && this.style(), - this.observe(); - var e = this.config.name; - e && (b.addClass(this.element, e), this.config.contentEditableMode || b.addClass(this.editableArea, e)), - this.enable(), - !this.config.noTextarea && this.textarea.element.disabled && this.disable(); - var f = - "string" == typeof this.config.placeholder - ? this.config.placeholder - : this.config.noTextarea - ? this.editableArea.getAttribute("data-placeholder") - : this.textarea.element.getAttribute("placeholder"); - f && b.simulatePlaceholder(this.parent, this, f, this.config.classNames.placeholder), - this.commands.exec("styleWithCSS", !1), - this._initObjectResizing(), - this._initUndoManager(), - this._initLineBreaking(), - this.config.noTextarea || - (!this.textarea.element.hasAttribute("autofocus") && - document.querySelector(":focus") != this.textarea.element) || - c.isIos() || - setTimeout(function () { - d.focus(!0); - }, 100), - c.clearsContentEditableCorrectly() || a.quirks.ensureProperClearing(this), - this.initSync && this.config.sync && this.initSync(), - this.config.noTextarea || this.textarea.hide(), - this.parent.fire("beforeload").fire("load"); - }, - _initAutoLinking: function () { - var d = this, - e = c.canDisableAutoLinking(), - f = c.doesAutoLinkingInContentEditable(); - if ((e && this.commands.exec("AutoUrlDetect", !1, !1), this.config.autoLink)) { - (!f || (f && e)) && - (this.parent.on("newword:composer", function () { - if (b.getTextContent(d.element).match(b.autoLink.URL_REG_EXP)) { - for ( - var c = d.selection.getSelectedNode(), - e = d.element.querySelectorAll("." + d.config.classNames.uneditableContainer), - f = !1, - g = e.length; - g--; - - ) - a.dom.contains(e[g], c) && (f = !0); - f || b.autoLink(c, [d.config.classNames.uneditableContainer]); - } - }), - b.observe(this.element, "blur", function () { - b.autoLink(d.element, [d.config.classNames.uneditableContainer]); - })); - var g = this.sandbox.getDocument().getElementsByTagName("a"), - h = b.autoLink.URL_REG_EXP, - i = function (c) { - var d = a.lang.string(b.getTextContent(c)).trim(); - return "www." === d.substr(0, 4) && (d = "http://" + d), d; - }; - b.observe(this.element, "keydown", function (a) { - if (g.length) { - var c, - e = d.selection.getSelectedNode(a.target.ownerDocument), - f = b.getParentElement(e, { query: "a" }, 4); - f && - ((c = i(f)), - setTimeout(function () { - var a = i(f); - a !== c && a.match(h) && f.setAttribute("href", a); - }, 0)); - } - }); - } - }, - _initObjectResizing: function () { - if ((this.commands.exec("enableObjectResizing", !0), c.supportsEvent("resizeend"))) { - var d = ["width", "height"], - e = d.length, - f = this.element; - b.observe(f, "resizeend", function (b) { - var c, - g = b.target || b.srcElement, - h = g.style, - i = 0; - if ("IMG" === g.nodeName) { - for (; e > i; i++) (c = d[i]), h[c] && (g.setAttribute(c, parseInt(h[c], 10)), (h[c] = "")); - a.quirks.redraw(f); - } - }); - } - }, - _initUndoManager: function () { - this.undoManager = new a.UndoManager(this.parent); - }, - _initLineBreaking: function () { - function d(a) { - var c = b.getParentElement(a, { query: "p, div" }, 2); - c && - b.contains(e.element, c) && - e.selection.executeAndRestoreRangy(function () { - e.config.useLineBreaks - ? ((!c.firstChild || - (c.firstChild === c.lastChild && - 1 === c.firstChild.nodeType && - c.firstChild.classList.contains("rangySelectionBoundary"))) && - c.appendChild(e.doc.createElement("br")), - b.replaceWithChildNodes(c)) - : "P" !== c.nodeName && b.renameElement(c, "p"); - }); - } - var e = this, - f = "li, p, h1, h2, h3, h4, h5, h6", - g = "ul, ol, menu"; - this.config.useLineBreaks || - b.observe(this.element, ["focus"], function () { - e.isEmpty() && - setTimeout(function () { - var a = e.doc.createElement("P"); - (e.element.innerHTML = ""), - e.element.appendChild(a), - c.displaysCaretInEmptyContentEditableCorrectly() - ? e.selection.selectNode(a, !0) - : ((a.innerHTML = "
        "), e.selection.setBefore(a.firstChild)); - }, 0); - }), - b.observe(this.element, "keydown", function (c) { - var h = c.keyCode; - if (!(c.shiftKey || c.ctrlKey || c.defaultPrevented || (h !== a.ENTER_KEY && h !== a.BACKSPACE_KEY))) { - var i = b.getParentElement(e.selection.getSelectedNode(), { query: f }, 4); - return i - ? void setTimeout(function () { - var c, - f = e.selection.getSelectedNode(); - if ("LI" === i.nodeName) { - if (!f) return; - (c = b.getParentElement(f, { query: g }, 2)), c || d(f); - } - h === a.ENTER_KEY && i.nodeName.match(/^H[1-6]$/) && d(f); - }, 0) - : void ( - e.config.useLineBreaks && - h === a.ENTER_KEY && - !a.browser.insertsLineBreaksOnReturn() && - (c.preventDefault(), e.commands.exec("insertLineBreak")) - ); - } - }); - }, - }); - })(wysihtml), - (function (a) { - var b = a.dom, - c = document, - d = window, - e = c.createElement("div"), - f = [ - "background-color", - "color", - "cursor", - "font-family", - "font-size", - "font-style", - "font-variant", - "font-weight", - "line-height", - "letter-spacing", - "text-align", - "text-decoration", - "text-indent", - "text-rendering", - "word-break", - "word-wrap", - "word-spacing", - ], - g = [ - "background-color", - "border-collapse", - "border-bottom-color", - "border-bottom-style", - "border-bottom-width", - "border-left-color", - "border-left-style", - "border-left-width", - "border-right-color", - "border-right-style", - "border-right-width", - "border-top-color", - "border-top-style", - "border-top-width", - "clear", - "display", - "float", - "margin-bottom", - "margin-left", - "margin-right", - "margin-top", - "outline-color", - "outline-offset", - "outline-width", - "outline-style", - "padding-left", - "padding-right", - "padding-top", - "padding-bottom", - "position", - "top", - "left", - "right", - "bottom", - "z-index", - "vertical-align", - "text-align", - "-webkit-box-sizing", - "-moz-box-sizing", - "-ms-box-sizing", - "box-sizing", - "-webkit-box-shadow", - "-moz-box-shadow", - "-ms-box-shadow", - "box-shadow", - "-webkit-border-top-right-radius", - "-moz-border-radius-topright", - "border-top-right-radius", - "-webkit-border-bottom-right-radius", - "-moz-border-radius-bottomright", - "border-bottom-right-radius", - "-webkit-border-bottom-left-radius", - "-moz-border-radius-bottomleft", - "border-bottom-left-radius", - "-webkit-border-top-left-radius", - "-moz-border-radius-topleft", - "border-top-left-radius", - "width", - "height", - ], - h = [ - "html { height: 100%; }", - "body { height: 100%; padding: 1px 0 0 0; margin: -1px 0 0 0; }", - "body > p:first-child { margin-top: 0; }", - "._wysihtml-temp { display: none; }", - a.browser.isGecko - ? "body.placeholder { color: graytext !important; }" - : "body.placeholder { color: #a9a9a9 !important; }", - "img:-moz-broken { -moz-force-broken-image-icon: 1; height: 24px; width: 24px; }", - ], - i = function (a) { - if (a.setActive) - try { - a.setActive(); - } catch (e) {} - else { - var f = a.style, - g = c.documentElement.scrollTop || c.body.scrollTop, - h = c.documentElement.scrollLeft || c.body.scrollLeft, - i = { position: f.position, top: f.top, left: f.left, WebkitUserSelect: f.WebkitUserSelect }; - b.setStyles({ position: "absolute", top: "-99999px", left: "-99999px", WebkitUserSelect: "none" }).on(a), - a.focus(), - b.setStyles(i).on(a), - d.scrollTo && d.scrollTo(h, g); - } - }; - a.views.Composer.prototype.style = function () { - var d, - j = this, - k = c.querySelector(":focus"), - l = this.textarea.element, - m = l.hasAttribute("placeholder"), - n = m && l.getAttribute("placeholder"), - o = l.style.display, - p = l.disabled; - (this.focusStylesHost = e.cloneNode(!1)), - (this.blurStylesHost = e.cloneNode(!1)), - (this.disabledStylesHost = e.cloneNode(!1)), - m && l.removeAttribute("placeholder"), - l === k && l.blur(), - (l.disabled = !1), - (l.style.display = d = "none"), - ((l.getAttribute("rows") && "auto" === b.getStyle("height").from(l)) || - (l.getAttribute("cols") && "auto" === b.getStyle("width").from(l))) && - (l.style.display = d = o), - b.copyStyles(g).from(l).to(this.editableArea).andTo(this.blurStylesHost), - b.copyStyles(f).from(l).to(this.element).andTo(this.blurStylesHost), - b.insertCSS(h).into(this.element.ownerDocument), - (l.disabled = !0), - b.copyStyles(g).from(l).to(this.disabledStylesHost), - b.copyStyles(f).from(l).to(this.disabledStylesHost), - (l.disabled = p), - (l.style.display = o), - i(l), - (l.style.display = d), - b.copyStyles(g).from(l).to(this.focusStylesHost), - b.copyStyles(f).from(l).to(this.focusStylesHost), - (l.style.display = o), - b.copyStyles(["display"]).from(l).to(this.editableArea); - var q = a.lang.array(g).without(["display"]); - return ( - k ? i(k) : l.blur(), - m && l.setAttribute("placeholder", n), - this.parent.on("focus:composer", function () { - b.copyStyles(q).from(j.focusStylesHost).to(j.editableArea), - b.copyStyles(f).from(j.focusStylesHost).to(j.element); - }), - this.parent.on("blur:composer", function () { - b.copyStyles(q).from(j.blurStylesHost).to(j.editableArea), - b.copyStyles(f).from(j.blurStylesHost).to(j.element); - }), - this.parent.observe("disable:composer", function () { - b.copyStyles(q).from(j.disabledStylesHost).to(j.editableArea), - b.copyStyles(f).from(j.disabledStylesHost).to(j.element); - }), - this.parent.observe("enable:composer", function () { - b.copyStyles(q).from(j.blurStylesHost).to(j.editableArea), - b.copyStyles(f).from(j.blurStylesHost).to(j.element); - }), - this - ); - }; - })(wysihtml), - (function (a) { - var b = a.dom, - c = b.domNode, - d = a.browser, - e = { 66: "bold", 73: "italic", 85: "underline" }, - f = { - addListeners: function (a, b, c) { - for (var d = 0, e = b.length; e > d; d++) a.addEventListener(b[d], c, !1); - }, - removeListeners: function (a, b, c) { - for (var d = 0, e = b.length; e > d; d++) a.removeEventListener(b[d], c, !1); - }, - fixLastBrDeletionInTable: function (b, c) { - if (b.selection.caretIsInTheEndOfNode()) { - var d = b.selection.getSelection(), - e = d.anchorNode; - if (e && 1 === e.nodeType && (a.dom.getParentElement(e, { query: "td, th" }, !1, b.element) || c)) { - var f = e.childNodes[d.anchorOffset]; - if (f && (1 === f.nodeType) & ("BR" === f.nodeName)) return f.parentNode.removeChild(f), !0; - } - } - return !1; - }, - handleUneditableDeletion: function (a) { - var b = a.selection.getBeforeSelection(!0); - if ( - b && - ("element" === b.type || "leafnode" === b.type) && - 1 === b.node.nodeType && - b.node.classList.contains(a.config.classNames.uneditableContainer) - ) { - if (f.fixLastBrDeletionInTable(a, !0)) return !0; - try { - var c = new CustomEvent("wysihtml:uneditable:delete", { bubbles: !0, cancelable: !1 }); - b.node.dispatchEvent(c); - } catch (d) {} - return b.node.parentNode.removeChild(b.node), !0; - } - return !1; - }, - fixDeleteInTheBeginningOfBlock: function (b) { - var d = b.selection, - e = d.getPreviousNode(); - if ( - d.caretIsFirstInSelection(a.browser.usesControlRanges()) && - e && - 1 === e.nodeType && - a.dom.domNode(e).is.block() && - !c(e).test({ query: "ol, ul, table, tr, dl" }) - ) { - if (/^\s*$/.test(e.textContent || e.innerText)) return e.parentNode.removeChild(e), !0; - if (e.lastChild) { - var f = e.lastChild, - g = d.getSelectedNode(), - h = c(e).commonAncestor(g, b.element), - i = a.dom.getParentElement( - g, - { query: "h1, h2, h3, h4, h5, h6, p, pre, div, blockquote" }, - !1, - h || b.element - ); - if (i) return c(i).transferContentTo(e, !0), d.setAfter(f), !0; - if (a.browser.usesControlRanges()) - return (g = d.getCaretNode()), c(g).transferContentTo(e, !0), d.setAfter(f), !0; - } - } - return !1; - }, - fixDeleteInTheBeginningOfLi: function (b) { - if (a.browser.hasLiDeletingProblem()) { - var d, - e, - d, - f, - g = b.selection.getSelection(), - h = g.anchorNode, - i = b.selection.caretIsFirstInSelection(); - if ( - (3 === h.nodeType && - 0 === g.anchorOffset && - h === h.parentNode.firstChild && - ((h = h.parentNode), (i = !0)), - i && - h && - 1 === h.nodeType && - "LI" === h.nodeName && - ((d = c(h).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), - d || - !h.parentNode || - ("UL" !== h.parentNode.nodeName && "OL" !== h.parentNode.nodeName) || - ((d = c(h.parentNode).prev({ nodeTypes: [1, 3], ignoreBlankTexts: !0 })), (f = h.parentNode)), - d)) - ) - return ( - (e = h.firstChild), - c(h).transferContentTo(d, !0), - f && 0 === f.children.length && f.remove(), - e - ? b.selection.setBefore(e) - : d && - (1 === d.nodeType - ? d.lastChild - ? b.selection.setAfter(d.lastChild) - : b.selection.selectNode(d) - : b.selection.setAfter(d)), - !0 - ); - } - return !1; - }, - fixDeleteInTheBeginningOfControlSelection: function (a) { - var b, - d = a.selection, - e = d.getPreviousNode(), - f = d.getSelectedNode(); - return d.caretIsFirstInSelection() - ? (3 === f.nodeType && (f = f.parentNode), - (b = f.firstChild), - c(f).transferContentTo(e, !0), - b && a.selection.setBefore(b), - !0) - : !1; - }, - doLineBreaksModeEnterWithCaret: function (d) { - var e, - f, - g = "p, pre, div, blockquote", - h = !1; - if ( - ((e = d.selection.getNodesNearCaret()), - e && - ((e.caretNode || e.nextNode) && - ((f = b.getParentElement(e.caretNode || e.nextNode, { query: g }, 2)), f === d.element && (f = void 0)), - f && e.caretNode)) - ) - if (c(e.caretNode).is.lineBreak()) { - if (d.config.doubleLineBreakEscapesBlock) { - (h = !0), - e.caretNode.parentNode.removeChild(e.caretNode), - c(e.nextNode).is.lineBreak() && e.nextNode.parentNode.removeChild(e.nextNode); - var i = d.doc.createElement("br"); - c(e.nextNode).is.lineBreak() && e.nextNode === f.lastChild - ? f.parentNode.insertBefore(i, f.nextSibling) - : d.selection.splitElementAtCaret(f, i), - e.nextNode && - 3 === e.nextNode.nodeType && - (e.nextNode.data = e.nextNode.data.replace(/^ *[\r\n]+/, "")), - d.selection.setBefore(i); - } - } else if ( - 3 === e.caretNode.nodeType && - a.browser.hasCaretBlockElementIssue() && - e.textOffset === e.caretNode.data.length && - !e.nextNode - ) { - h = !0; - var j = d.doc.createElement("br"), - k = d.doc.createElement("br"), - l = d.doc.createDocumentFragment(); - l.appendChild(j), l.appendChild(k), d.selection.insertNode(l), d.selection.setBefore(k); - } - return h; - }, - }, - g = function (b, c) { - var d = c.selection; - c.element; - if (d.isCollapsed()) { - if (c.isEmpty() && !c.config.useLineBreaks) return void b.preventDefault(); - if (f.handleUneditableDeletion(c)) return void b.preventDefault(); - if (f.fixDeleteInTheBeginningOfLi(c)) return void b.preventDefault(); - if (f.fixDeleteInTheBeginningOfBlock(c)) return void b.preventDefault(); - if (f.fixLastBrDeletionInTable(c)) return void b.preventDefault(); - if (a.browser.usesControlRanges() && f.fixDeleteInTheBeginningOfControlSelection(c)) - return void b.preventDefault(); - } else d.containsUneditable() && (b.preventDefault(), d.deleteContents()); - }, - h = function (a, b) { - if (b.config.useLineBreaks && !a.shiftKey && !a.ctrlKey) { - b.selection.isCollapsed() && f.doLineBreaksModeEnterWithCaret(b) && a.preventDefault(); - } - if (d.hasCaretAtLinkEndInsertionProblems() && b.selection.caretIsInTheEndOfNode()) { - var c = b.selection.getSelectedNode(!0), - e = c && 3 === c.nodeType ? c.parentNode : c; - e && e.closest("a") && 3 === c.nodeType && c === e.lastChild && b.selection.setAfter(e); - } - }, - i = function (a, b, c) { - if (a.selection.isCollapsed()) { - if (a.selection.caretIsInTheBeginnig("li")) - if (c) { - if (a.commands.exec("outdentList")) return; - } else if (a.commands.exec("indentList")) return; - } else a.selection.deleteContents(); - a.commands.exec("insertHTML", " "); - }, - j = function (a) { - this.domNodeRemovedInterval && clearInterval(domNodeRemovedInterval), this.parent.fire("destroy:composer"); - }, - k = function (a) { - this.parent.fire("beforeinteraction", a).fire("beforeinteraction:composer", a), - setTimeout( - function () { - this.parent.fire("interaction", a).fire("interaction:composer", a); - }.bind(this), - 0 - ); - }, - l = function (a) { - this.parent.fire("focus", a).fire("focus:composer", a), - setTimeout( - function () { - this.focusState = this.getValue(!1, !1); - }.bind(this), - 0 - ); - }, - m = function (a) { - if (this.focusState !== this.getValue(!1, !1)) { - var b = a; - "function" == typeof Object.create && (b = Object.create(a, { type: { value: "change" } })), - this.parent.fire("change", b).fire("change:composer", b); - } - this.parent.fire("blur", a).fire("blur:composer", a); - }, - n = function (a) { - this.parent.fire(a.type, a).fire(a.type + ":composer", a), - "paste" === a.type && - setTimeout( - function () { - this.parent.fire("newword:composer"); - }.bind(this), - 0 - ); - }, - o = function (b) { - this.config.copyedFromMarking && - (a.browser.supportsModernPaste() && - (b.clipboardData.setData("text/html", this.config.copyedFromMarking + this.selection.getHtml()), - b.clipboardData.setData("text/plain", this.selection.getPlainText()), - b.preventDefault()), - this.parent.fire(b.type, b).fire(b.type + ":composer", b)); - }, - p = function (b) { - var c = b.keyCode; - (c === a.SPACE_KEY || c === a.ENTER_KEY) && this.parent.fire("newword:composer"); - }, - q = function (b) { - if (!d.canSelectImagesInContentEditable()) { - var c = b.target, - e = this.element.querySelectorAll("img"), - f = this.element.querySelectorAll("." + this.config.classNames.uneditableContainer + " img"), - g = a.lang.array(e).without(f); - "IMG" === c.nodeName && a.lang.array(g).contains(c) && this.selection.selectNode(c); - } - a.browser.usesControlRanges() && - ((this.selection.lastMouseDownPos = { x: b.clientX, y: b.clientY }), - setTimeout( - function () { - delete this.selection.lastMouseDownPos; - }.bind(this), - 0 - )); - }, - r = function (a) { - var b = (a.target, this.selection.lastMouseDownPos); - if (b) { - var c = document.body.createTextRange(); - setTimeout( - function () { - try { - c.moveToPoint(b.x, b.y), c.select(); - } catch (a) {} - }.bind(this), - 0 - ); - } - }, - s = function (b) { - if (this.config.classNames.uneditableContainer) { - var c = a.dom.getParentElement( - b.target, - { query: "." + this.config.classNames.uneditableContainer }, - !1, - this.element - ); - c && this.selection.setAfter(c); - } - }, - t = function (a) { - d.canSelectImagesInContentEditable() || - setTimeout( - function () { - this.selection.getSelection().removeAllRanges(); - }.bind(this), - 0 - ); - }, - u = function (b) { - var c, - d = b.keyCode, - f = e[d], - j = this.selection.getSelectedNode(!0); - j && 3 === j.nodeType ? j.parentNode : j; - return (!b.ctrlKey && !b.metaKey) || b.altKey || 65 !== d - ? ((b.ctrlKey || b.metaKey) && !b.altKey && f && (this.commands.exec(f), b.preventDefault()), - d === a.BACKSPACE_KEY && g(b, this), - (d === a.BACKSPACE_KEY || d === a.DELETE_KEY) && - j && - "IMG" === j.nodeName && - (b.preventDefault(), - (c = j.parentNode), - c.removeChild(j), - "A" !== c.nodeName || c.firstChild || c.parentNode.removeChild(c), - setTimeout( - function () { - a.quirks.redraw(this.element); - }.bind(this), - 0 - )), - this.config.handleTabKey && d === a.TAB_KEY && (b.preventDefault(), i(this, this.element, b.shiftKey)), - void (d === a.ENTER_KEY && h(b, this))) - : (this.selection.selectAll(), void b.preventDefault()); - }, - v = function (b) { - if (0 !== b.which && this.selection.caretIsInTheEndOfNode()) { - var c, - e, - f = this.selection.getSelectedNode(!0), - g = f && 3 === f.nodeType ? f.parentNode : f; - g && - g.closest("a") && - f === g.lastChild && - (32 !== b.which || (this.selection.caretIsInTheEndOfNode(!0) && d.hasCaretAtLinkEndInsertionProblems()) - ? ((c = this.doc.createTextNode(a.INVISIBLE_SPACE)), - this.selection.insertNode(c), - this.selection.setBefore(c), - setTimeout( - function () { - c.textContent.length > 1 - ? ((c.textContent = c.textContent.replace(a.INVISIBLE_SPACE_REG_EXP, "")), - this.selection.setAfter(c)) - : c.remove(); - }.bind(this), - 0 - )) - : 32 === b.which && - 3 === f.nodeType && - /[\u00A0 ]$/.test(f.textContent) && - ((f.textContent = f.textContent.replace(/[\u00A0 ]$/, "")), - (e = this.doc.createTextNode(" ")), - g.parentNode.insertBefore(e, g.nextSibling), - this.selection.setAfter(e, !1), - b.preventDefault())); - } - }; - (a.views.Composer.prototype.observeActions = f), - (a.views.Composer.prototype.observe = function () { - var c = this.sandbox.getIframe ? this.sandbox.getIframe() : this.sandbox.getContentEditable(), - e = - (this.element, - d.supportsEventsInIframeCorrectly() || this.sandbox.getContentEditable - ? this.element - : this.sandbox.getWindow()); - (this.focusState = this.getValue(!1, !1)), - (this.actions = f), - c.addEventListener(["DOMNodeRemoved"], j.bind(this), !1), - d.supportsMutationEvents() || - (this.domNodeRemovedInterval = setInterval(function () { - b.contains(document.documentElement, c) || j.call(this); - }, 250)), - f.addListeners(e, ["drop", "paste", "mouseup", "focus", "keyup"], k.bind(this)), - e.addEventListener("focus", l.bind(this), !1), - e.addEventListener("blur", m.bind(this), !1), - f.addListeners(this.element, ["drop", "paste", "beforepaste"], n.bind(this), !1), - this.element.addEventListener("copy", o.bind(this), !1), - this.element.addEventListener("mousedown", q.bind(this), !1), - this.element.addEventListener("click", s.bind(this), !1), - this.element.addEventListener("drop", t.bind(this), !1), - this.element.addEventListener("keyup", p.bind(this), !1), - this.element.addEventListener("keydown", u.bind(this), !1), - this.element.addEventListener("keypress", v.bind(this), !1), - a.browser.usesControlRanges() && this.element.addEventListener("mscontrolselect", r.bind(this), !1), - this.element.addEventListener( - "dragenter", - function () { - this.parent.fire("unset_placeholder"); - }.bind(this), - !1 - ); - }); - })(wysihtml), - (function (a) { - var b = 400; - a.views.Synchronizer = Base.extend({ - constructor: function (a, b, c) { - (this.editor = a), (this.textarea = b), (this.composer = c), this._observe(); - }, - fromComposerToTextarea: function (b) { - this.textarea.setValue(a.lang.string(this.composer.getValue(!1, !1)).trim(), b); - }, - fromTextareaToComposer: function (a) { - var b = this.textarea.getValue(!1, !1); - b ? this.composer.setValue(b, a) : (this.composer.clear(), this.editor.fire("set_placeholder")); - }, - sync: function (a) { - "textarea" === this.editor.currentView.name ? this.fromTextareaToComposer(a) : this.fromComposerToTextarea(a); - }, - _observe: function () { - var c, - d = this, - e = this.textarea.element.form, - f = function () { - c = setInterval(function () { - d.fromComposerToTextarea(); - }, b); - }, - g = function () { - clearInterval(c), (c = null); - }; - f(), - e && - (a.dom.observe(e, "submit", function () { - d.sync(!0); - }), - a.dom.observe(e, "reset", function () { - setTimeout(function () { - d.fromTextareaToComposer(); - }, 0); - })), - this.editor.on("change_view", function (a) { - "composer" !== a || c - ? "textarea" === a && (d.fromComposerToTextarea(!0), g()) - : (d.fromTextareaToComposer(!0), f()); - }), - this.editor.on("destroy:composer", g); - }, - }); - })(wysihtml), - (function (a) { - a.views.SourceView = Base.extend({ - constructor: function (a, b) { - (this.editor = a), (this.composer = b), this._observe(); - }, - switchToTextarea: function (a) { - var b = this.composer.win.getComputedStyle(this.composer.element), - c = parseFloat(b.width), - d = Math.max(parseFloat(b.height), 100); - this.textarea || - ((this.textarea = this.composer.doc.createElement("textarea")), - (this.textarea.className = "wysihtml-source-view")), - (this.textarea.style.width = c + "px"), - (this.textarea.style.height = d + "px"), - (this.textarea.value = this.editor.getValue(a, !0)), - this.composer.element.parentNode.insertBefore(this.textarea, this.composer.element), - (this.editor.currentView = "source"), - (this.composer.element.style.display = "none"); - }, - switchToComposer: function (a) { - var b = this.textarea.value; - b ? this.composer.setValue(b, a) : (this.composer.clear(), this.editor.fire("set_placeholder")), - this.textarea.parentNode.removeChild(this.textarea), - (this.editor.currentView = this.composer), - (this.composer.element.style.display = ""); - }, - _observe: function () { - this.editor.on( - "change_view", - function (a) { - "composer" === a ? this.switchToComposer(!0) : "textarea" === a && this.switchToTextarea(!0); - }.bind(this) - ); - }, - }); - })(wysihtml), - (wysihtml.views.Textarea = wysihtml.views.View.extend({ - name: "textarea", - constructor: function (a, b, c) { - this.base(a, b, c), this._observe(); - }, - clear: function () { - this.element.value = ""; - }, - getValue: function (a) { - var b = this.isEmpty() ? "" : this.element.value; - return a !== !1 && (b = this.parent.parse(b)), b; - }, - setValue: function (a, b) { - b !== !1 && (a = this.parent.parse(a)), (this.element.value = a); - }, - cleanUp: function (a) { - var b = this.parent.parse(this.element.value, void 0, a); - this.element.value = b; - }, - hasPlaceholderSet: function () { - var a = wysihtml.browser.supportsPlaceholderAttributeOn(this.element), - b = this.element.getAttribute("placeholder") || null, - c = this.element.value, - d = !c; - return (a && d) || c === b; - }, - isEmpty: function () { - return !wysihtml.lang.string(this.element.value).trim() || this.hasPlaceholderSet(); - }, - _observe: function () { - var a = this.element, - b = this.parent, - c = { focusin: "focus", focusout: "blur" }, - d = wysihtml.browser.supportsEvent("focusin") ? ["focusin", "focusout", "change"] : ["focus", "blur", "change"]; - b.on("beforeload", function () { - wysihtml.dom.observe(a, d, function (a) { - var d = c[a.type] || a.type; - b.fire(d).fire(d + ":textarea"); - }), - wysihtml.dom.observe(a, ["paste", "drop"], function () { - setTimeout(function () { - b.fire("paste").fire("paste:textarea"); - }, 0); - }); - }); - }, - })), - (function (a) { - var b; - a.Editor = a.lang.Dispatcher.extend({ - defaults: { - name: b, - style: !0, - autoLink: !0, - handleTabKey: !0, - parserRules: { tags: { br: {}, span: {}, div: {}, p: {}, b: {}, i: {}, u: {} }, classes: {} }, - pasteParserRulesets: null, - parser: a.dom.parse, - useLineBreaks: !0, - doubleLineBreakEscapesBlock: !0, - stylesheets: [], - placeholderText: b, - supportTouchDevices: !0, - cleanUp: !0, - contentEditableMode: !1, - classNames: { - composer: "wysihtml-editor", - body: "wysihtml-supported", - sandbox: "wysihtml-sandbox", - placeholder: "wysihtml-placeholder", - uneditableContainer: "wysihtml-uneditable-container", - }, - copyedFromMarking: '', - }, - constructor: function (b, c) { - if ( - ((this.editableElement = "string" == typeof b ? document.getElementById(b) : b), - (this.config = a.lang.object({}).merge(this.defaults).merge(c).get()), - (this._isCompatible = a.browser.supported()), - c && c.classNames && a.lang.object(this.config.classNames).merge(c.classNames), - "textarea" != this.editableElement.nodeName.toLowerCase() && - ((this.config.contentEditableMode = !0), (this.config.noTextarea = !0)), - this.config.noTextarea || - ((this.textarea = new a.views.Textarea(this, this.editableElement, this.config)), - (this.currentView = this.textarea)), - !this._isCompatible || (!this.config.supportTouchDevices && a.browser.isTouchDevice())) - ) { - var d = this; - return void setTimeout(function () { - d.fire("beforeload").fire("load"); - }, 0); - } - a.dom.addClass(document.body, this.config.classNames.body), - (this.composer = new a.views.Composer(this, this.editableElement, this.config)), - (this.currentView = this.composer), - "function" == typeof this.config.parser && this._initParser(), - this.on("beforeload", this.handleBeforeLoad); - }, - handleBeforeLoad: function () { - this.config.noTextarea - ? (this.sourceView = new a.views.SourceView(this, this.composer)) - : (this.synchronizer = new a.views.Synchronizer(this, this.textarea, this.composer)), - this.runEditorExtenders(); - }, - runEditorExtenders: function () { - a.editorExtenders.forEach( - function (a) { - a(this); - }.bind(this) - ); - }, - isCompatible: function () { - return this._isCompatible; - }, - clear: function () { - return this.currentView.clear(), this; - }, - getValue: function (a, b) { - return this.currentView.getValue(a, b); - }, - setValue: function (a, b) { - return this.fire("unset_placeholder"), a ? (this.currentView.setValue(a, b), this) : this.clear(); - }, - cleanUp: function (a) { - this.currentView.cleanUp(a); - }, - focus: function (a) { - return this.currentView.focus(a), this; - }, - disable: function () { - return this.currentView.disable(), this; - }, - enable: function () { - return this.currentView.enable(), this; - }, - isEmpty: function () { - return this.currentView.isEmpty(); - }, - hasPlaceholderSet: function () { - return this.currentView.hasPlaceholderSet(); - }, - destroy: function () { - this.composer && this.composer.sandbox && this.composer.sandbox.destroy(), - this.fire("destroy:composer"), - this.off(); - }, - parse: function (b, c, d) { - var e = this.config.contentEditableMode ? document : this.composer ? this.composer.sandbox.getDocument() : null, - f = this.config.parser(b, { - rules: d || this.config.parserRules, - cleanUp: this.config.cleanUp, - context: e, - uneditableClass: this.config.classNames.uneditableContainer, - clearInternals: c, - }); - return "object" == typeof b && a.quirks.redraw(b), f; - }, - _initParser: function () { - var b; - a.browser.supportsModernPaste() - ? this.on( - "paste:composer", - function (c) { - c.preventDefault(), (b = a.dom.getPastedHtml(c)), b && this._cleanAndPaste(b); - }.bind(this) - ) - : this.on( - "beforepaste:composer", - function (b) { - b.preventDefault(); - var c = this.composer.getScrollPos(); - a.dom.getPastedHtmlWithDiv( - this.composer, - function (a) { - a && this._cleanAndPaste(a), this.composer.setScrollPos(c); - }.bind(this) - ); - }.bind(this) - ); - }, - _cleanAndPaste: function (b) { - var c = a.quirks.cleanPastedHTML(b, { - referenceNode: this.composer.element, - rules: this.config.pasteParserRulesets || [{ set: this.config.parserRules }], - uneditableClass: this.config.classNames.uneditableContainer, - }); - this.composer.selection.deleteContents(), this.composer.selection.insertHTML(c); - }, - }); - })(wysihtml); -//# sourceMappingURL=wysihtml.min.map diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.table_editing.min.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.table_editing.min.js deleted file mode 100644 index a5b43b480d8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.table_editing.min.js +++ /dev/null @@ -1,727 +0,0 @@ -(wysihtml.commands.addTableCells = { - exec: function (a, b, c) { - if (a.tableSelection && a.tableSelection.start && a.tableSelection.end) { - var d = wysihtml.dom.table.orderSelectionEnds(a.tableSelection.start, a.tableSelection.end); - "before" == c || "above" == c - ? wysihtml.dom.table.addCells(d.start, c) - : ("after" == c || "below" == c) && wysihtml.dom.table.addCells(d.end, c), - setTimeout(function () { - a.tableSelection.select(d.start, d.end); - }, 0); - } - }, - state: function (a, b) { - return !1; - }, -}), - (wysihtml.commands.createTable = { - exec: function (a, b, c) { - var d, e, f; - if (c && c.cols && c.rows && parseInt(c.cols, 10) > 0 && parseInt(c.rows, 10) > 0) { - for ( - f = c.tableStyle ? '' : "
        ", f += "", e = 0; - e < c.rows; - e++ - ) { - for (f += "", d = 0; d < c.cols; d++) f += ""; - f += ""; - } - (f += "

        "), a.commands.exec("insertHTML", f); - } - }, - state: function (a, b) { - return !1; - }, - }), - (wysihtml.commands.deleteTableCells = { - exec: function (a, b, c) { - if (a.tableSelection && a.tableSelection.start && a.tableSelection.end) { - var d, - e = wysihtml.dom.table.orderSelectionEnds(a.tableSelection.start, a.tableSelection.end), - f = wysihtml.dom.table.indexOf(e.start), - g = a.tableSelection.table; - wysihtml.dom.table.removeCells(e.start, c), - setTimeout(function () { - (d = wysihtml.dom.table.findCell(g, f)), - d || - ("row" == c && (d = wysihtml.dom.table.findCell(g, { row: f.row - 1, col: f.col })), - "column" == c && (d = wysihtml.dom.table.findCell(g, { row: f.row, col: f.col - 1 }))), - d && a.tableSelection.select(d, d); - }, 0); - } - }, - state: function (a, b) { - return !1; - }, - }), - (wysihtml.commands.mergeTableCells = { - exec: function (a, b) { - a.tableSelection && - a.tableSelection.start && - a.tableSelection.end && - (this.state(a, b) - ? wysihtml.dom.table.unmergeCell(a.tableSelection.start) - : wysihtml.dom.table.mergeCellsBetween(a.tableSelection.start, a.tableSelection.end)); - }, - state: function (a, b) { - if (a.tableSelection) { - var c = a.tableSelection.start, - d = a.tableSelection.end; - if ( - c && - d && - c == d && - ((wysihtml.dom.getAttribute(c, "colspan") && parseInt(wysihtml.dom.getAttribute(c, "colspan"), 10) > 1) || - (wysihtml.dom.getAttribute(c, "rowspan") && parseInt(wysihtml.dom.getAttribute(c, "rowspan"), 10) > 1)) - ) - return [c]; - } - return !1; - }, - }), - (function () { - function a(a, b) { - for (var c, d = [], e = 0, f = a.length; f > e; e++) - if ((c = a[e].querySelectorAll(b))) for (var g = c.length; g--; d.unshift(c[g])); - return d; - } - function b(a) { - a.parentNode.removeChild(a); - } - function d(a, b) { - a.parentNode.insertBefore(b, a.nextSibling); - } - function e(a, b) { - for (var c = a.nextSibling; 1 != c.nodeType; ) - if (((c = c.nextSibling), !b || b == c.tagName.toLowerCase())) return c; - return null; - } - var f = wysihtml.dom, - g = function (a) { - (this.el = a), - (this.isColspan = !1), - (this.isRowspan = !1), - (this.firstCol = !0), - (this.lastCol = !0), - (this.firstRow = !0), - (this.lastRow = !0), - (this.isReal = !0), - (this.spanCollection = []), - (this.modified = !1); - }, - h = function (a, b) { - a - ? ((this.cell = a), (this.table = f.getParentElement(a, { query: "table" }))) - : b && ((this.table = b), (this.cell = this.table.querySelectorAll("th, td")[0])); - }; - (h.prototype = { - addSpannedCellToMap: function (a, b, c, d, e, f) { - for ( - var h = [], i = c + (f ? parseInt(f, 10) - 1 : 0), j = d + (e ? parseInt(e, 10) - 1 : 0), k = c; - i >= k; - k++ - ) { - "undefined" == typeof b[k] && (b[k] = []); - for (var l = d; j >= l; l++) - (b[k][l] = new g(a)), - (b[k][l].isColspan = e && parseInt(e, 10) > 1), - (b[k][l].isRowspan = f && parseInt(f, 10) > 1), - (b[k][l].firstCol = l == d), - (b[k][l].lastCol = l == j), - (b[k][l].firstRow = k == c), - (b[k][l].lastRow = k == i), - (b[k][l].isReal = l == d && k == c), - (b[k][l].spanCollection = h), - h.push(b[k][l]); - } - }, - setCellAsModified: function (a) { - if (((a.modified = !0), a.spanCollection.length > 0)) - for (var b = 0, c = a.spanCollection.length; c > b; b++) a.spanCollection[b].modified = !0; - }, - setTableMap: function () { - var a, - b, - c, - d, - e, - h, - i, - j, - k = [], - l = this.getTableRows(); - for (a = 0; a < l.length; a++) - for ( - b = l[a], c = this.getRowCells(b), h = 0, "undefined" == typeof k[a] && (k[a] = []), d = 0; - d < c.length; - d++ - ) { - for (e = c[d]; "undefined" != typeof k[a][h]; ) h++; - (i = f.getAttribute(e, "colspan")), - (j = f.getAttribute(e, "rowspan")), - i || j - ? (this.addSpannedCellToMap(e, k, a, h, i, j), (h += i ? parseInt(i, 10) : 1)) - : ((k[a][h] = new g(e)), h++); - } - return (this.map = k), k; - }, - getRowCells: function (b) { - var c = this.table.querySelectorAll("table"), - d = c ? a(c, "th, td") : [], - e = b.querySelectorAll("th, td"), - f = d.length > 0 ? wysihtml.lang.array(e).without(d) : e; - return f; - }, - getTableRows: function () { - var b = this.table.querySelectorAll("table"), - c = b ? a(b, "tr") : [], - d = this.table.querySelectorAll("tr"), - e = c.length > 0 ? wysihtml.lang.array(d).without(c) : d; - return e; - }, - getMapIndex: function (a) { - for (var b = this.map.length, c = this.map && this.map[0] ? this.map[0].length : 0, d = 0; b > d; d++) - for (var e = 0; c > e; e++) if (this.map[d][e].el === a) return { row: d, col: e }; - return !1; - }, - getElementAtIndex: function (a) { - return ( - this.setTableMap(), - this.map[a.row] && this.map[a.row][a.col] && this.map[a.row][a.col].el ? this.map[a.row][a.col].el : null - ); - }, - getMapElsTo: function (a) { - var b = []; - if ( - (this.setTableMap(), - (this.idx_start = this.getMapIndex(this.cell)), - (this.idx_end = this.getMapIndex(a)), - this.idx_start.row > this.idx_end.row || - (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) - ) { - var c = this.idx_start; - (this.idx_start = this.idx_end), (this.idx_end = c); - } - if (this.idx_start.col > this.idx_end.col) { - var d = this.idx_start.col; - (this.idx_start.col = this.idx_end.col), (this.idx_end.col = d); - } - if (null != this.idx_start && null != this.idx_end) - for (var e = this.idx_start.row, f = this.idx_end.row; f >= e; e++) - for (var g = this.idx_start.col, h = this.idx_end.col; h >= g; g++) b.push(this.map[e][g].el); - return b; - }, - orderSelectionEnds: function (a) { - if ( - (this.setTableMap(), - (this.idx_start = this.getMapIndex(this.cell)), - (this.idx_end = this.getMapIndex(a)), - this.idx_start.row > this.idx_end.row || - (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) - ) { - var b = this.idx_start; - (this.idx_start = this.idx_end), (this.idx_end = b); - } - if (this.idx_start.col > this.idx_end.col) { - var c = this.idx_start.col; - (this.idx_start.col = this.idx_end.col), (this.idx_end.col = c); - } - return { - start: this.map[this.idx_start.row][this.idx_start.col].el, - end: this.map[this.idx_end.row][this.idx_end.col].el, - }; - }, - createCells: function (a, b, c) { - for (var d, e = this.table.ownerDocument, f = e.createDocumentFragment(), g = 0; b > g; g++) { - if (((d = e.createElement(a)), c)) for (var h in c) c.hasOwnProperty(h) && d.setAttribute(h, c[h]); - d.appendChild(document.createTextNode(" ")), f.appendChild(d); - } - return f; - }, - correctColIndexForUnreals: function (a, b) { - for (var c = this.map[b], d = -1, e = 0; a > e; e++) c[e].isReal && d++; - return d; - }, - getLastNewCellOnRow: function (a, b) { - for (var c, d, e = this.getRowCells(a), f = 0, g = e.length; g > f; f++) - if (((c = e[f]), (d = this.getMapIndex(c)), d === !1 || ("undefined" != typeof b && d.row != b))) return c; - return null; - }, - removeEmptyTable: function () { - var a = this.table.querySelectorAll("td, th"); - return a && 0 != a.length ? !1 : (b(this.table), !0); - }, - splitRowToCells: function (a) { - if (a.isColspan) { - var b = parseInt(f.getAttribute(a.el, "colspan") || 1, 10), - c = a.el.tagName.toLowerCase(); - if (b > 1) { - var e = this.createCells(c, b - 1); - d(a.el, e); - } - a.el.removeAttribute("colspan"); - } - }, - getRealRowEl: function (a, b) { - var c = null, - d = null; - b = b || this.idx; - for (var e = 0, g = this.map[b.row].length; g > e; e++) - if (((d = this.map[b.row][e]), d.isReal && (c = f.getParentElement(d.el, { query: "tr" })))) return c; - return null === c && a && (c = f.getParentElement(this.map[b.row][b.col].el, { query: "tr" }) || null), c; - }, - injectRowAt: function (a, b, c, e, g) { - var h = this.getRealRowEl(!1, { row: a, col: b }), - i = this.createCells(e, c); - if (h) { - var j = this.correctColIndexForUnreals(b, a); - j >= 0 ? d(this.getRowCells(h)[j], i) : h.insertBefore(i, h.firstChild); - } else { - var k = this.table.ownerDocument.createElement("tr"); - k.appendChild(i), d(f.getParentElement(g.el, { query: "tr" }), k); - } - }, - canMerge: function (a) { - if ( - ((this.to = a), - this.setTableMap(), - (this.idx_start = this.getMapIndex(this.cell)), - (this.idx_end = this.getMapIndex(this.to)), - this.idx_start.row > this.idx_end.row || - (this.idx_start.row == this.idx_end.row && this.idx_start.col > this.idx_end.col)) - ) { - var b = this.idx_start; - (this.idx_start = this.idx_end), (this.idx_end = b); - } - if (this.idx_start.col > this.idx_end.col) { - var c = this.idx_start.col; - (this.idx_start.col = this.idx_end.col), (this.idx_end.col = c); - } - for (var d = this.idx_start.row, e = this.idx_end.row; e >= d; d++) - for (var f = this.idx_start.col, g = this.idx_end.col; g >= f; f++) - if (this.map[d][f].isColspan || this.map[d][f].isRowspan) return !1; - return !0; - }, - decreaseCellSpan: function (a, b) { - var c = parseInt(f.getAttribute(a.el, b), 10) - 1; - c >= 1 - ? a.el.setAttribute(b, c) - : (a.el.removeAttribute(b), - "colspan" == b && (a.isColspan = !1), - "rowspan" == b && (a.isRowspan = !1), - (a.firstCol = !0), - (a.lastCol = !0), - (a.firstRow = !0), - (a.lastRow = !0), - (a.isReal = !0)); - }, - removeSurplusLines: function () { - var a, c, d, e, g, h, i; - if ((this.setTableMap(), this.map)) { - for (d = 0, e = this.map.length; e > d; d++) { - for (a = this.map[d], i = !0, g = 0, h = a.length; h > g; g++) - if ( - ((c = a[g]), - !( - f.getAttribute(c.el, "rowspan") && - parseInt(f.getAttribute(c.el, "rowspan"), 10) > 1 && - c.firstRow !== !0 - )) - ) { - i = !1; - break; - } - if (i) for (g = 0; h > g; g++) this.decreaseCellSpan(a[g], "rowspan"); - } - var j = this.getTableRows(); - for (d = 0, e = j.length; e > d; d++) - (a = j[d]), 0 == a.childNodes.length && /^\s*$/.test(a.textContent || a.innerText) && b(a); - } - }, - fillMissingCells: function () { - var a = 0, - b = 0, - c = null; - if ((this.setTableMap(), this.map)) { - a = this.map.length; - for (var e = 0; a > e; e++) this.map[e].length > b && (b = this.map[e].length); - for (var f = 0; a > f; f++) - for (var h = 0; b > h; h++) - this.map[f] && - !this.map[f][h] && - h > 0 && - ((this.map[f][h] = new g(this.createCells("td", 1))), - (c = this.map[f][h - 1]), - c && c.el && c.el.parent && d(this.map[f][h - 1].el, this.map[f][h].el)); - } - }, - rectify: function () { - return this.removeEmptyTable() ? !1 : (this.removeSurplusLines(), this.fillMissingCells(), !0); - }, - unmerge: function () { - if (this.rectify() && (this.setTableMap(), (this.idx = this.getMapIndex(this.cell)), this.idx)) { - var a = this.map[this.idx.row][this.idx.col], - b = f.getAttribute(a.el, "colspan") ? parseInt(f.getAttribute(a.el, "colspan"), 10) : 1, - c = a.el.tagName.toLowerCase(); - if (a.isRowspan) { - var d = parseInt(f.getAttribute(a.el, "rowspan"), 10); - if (d > 1) - for (var e = 1, g = d - 1; g >= e; e++) this.injectRowAt(this.idx.row + e, this.idx.col, b, c, a); - a.el.removeAttribute("rowspan"); - } - this.splitRowToCells(a); - } - }, - merge: function (a) { - if (this.rectify()) - if (this.canMerge(a)) { - for ( - var c = this.idx_end.row - this.idx_start.row + 1, - d = this.idx_end.col - this.idx_start.col + 1, - e = this.idx_start.row, - f = this.idx_end.row; - f >= e; - e++ - ) - for (var g = this.idx_start.col, h = this.idx_end.col; h >= g; g++) - e == this.idx_start.row && g == this.idx_start.col - ? (c > 1 && this.map[e][g].el.setAttribute("rowspan", c), - d > 1 && this.map[e][g].el.setAttribute("colspan", d)) - : (/^\s*\s*$/.test(this.map[e][g].el.innerHTML.toLowerCase()) || - (this.map[this.idx_start.row][this.idx_start.col].el.innerHTML += - " " + this.map[e][g].el.innerHTML), - b(this.map[e][g].el)); - this.rectify(); - } else window.console && console.log("Do not know how to merge allready merged cells."); - }, - collapseCellToNextRow: function (a) { - var b = this.getMapIndex(a.el), - c = b.row + 1, - e = { row: c, col: b.col }; - if (c < this.map.length) { - var g = this.getRealRowEl(!1, e); - if (null !== g) { - var h = this.correctColIndexForUnreals(e.col, e.row); - if (h >= 0) d(this.getRowCells(g)[h], a.el); - else { - var i = this.getLastNewCellOnRow(g, c); - null !== i ? d(i, a.el) : g.insertBefore(a.el, g.firstChild); - } - parseInt(f.getAttribute(a.el, "rowspan"), 10) > 2 - ? a.el.setAttribute("rowspan", parseInt(f.getAttribute(a.el, "rowspan"), 10) - 1) - : a.el.removeAttribute("rowspan"); - } - } - }, - removeRowCell: function (a) { - a.isReal - ? a.isRowspan - ? this.collapseCellToNextRow(a) - : b(a.el) - : parseInt(f.getAttribute(a.el, "rowspan"), 10) > 2 - ? a.el.setAttribute("rowspan", parseInt(f.getAttribute(a.el, "rowspan"), 10) - 1) - : a.el.removeAttribute("rowspan"); - }, - getRowElementsByCell: function () { - var a = []; - if ((this.setTableMap(), (this.idx = this.getMapIndex(this.cell)), this.idx !== !1)) - for (var b = this.map[this.idx.row], c = 0, d = b.length; d > c; c++) b[c].isReal && a.push(b[c].el); - return a; - }, - getColumnElementsByCell: function () { - var a = []; - if ((this.setTableMap(), (this.idx = this.getMapIndex(this.cell)), this.idx !== !1)) - for (var b = 0, c = this.map.length; c > b; b++) - this.map[b][this.idx.col] && this.map[b][this.idx.col].isReal && a.push(this.map[b][this.idx.col].el); - return a; - }, - removeRow: function () { - var a = f.getParentElement(this.cell, { query: "tr" }); - if (a) { - if ((this.setTableMap(), (this.idx = this.getMapIndex(this.cell)), this.idx !== !1)) - for (var c = this.map[this.idx.row], d = 0, e = c.length; e > d; d++) - c[d].modified || (this.setCellAsModified(c[d]), this.removeRowCell(c[d])); - b(a); - } - }, - removeColCell: function (a) { - a.isColspan - ? parseInt(f.getAttribute(a.el, "colspan"), 10) > 2 - ? a.el.setAttribute("colspan", parseInt(f.getAttribute(a.el, "colspan"), 10) - 1) - : a.el.removeAttribute("colspan") - : a.isReal && b(a.el); - }, - removeColumn: function () { - if ((this.setTableMap(), (this.idx = this.getMapIndex(this.cell)), this.idx !== !1)) - for (var a = 0, b = this.map.length; b > a; a++) - this.map[a][this.idx.col].modified || - (this.setCellAsModified(this.map[a][this.idx.col]), this.removeColCell(this.map[a][this.idx.col])); - }, - remove: function (a) { - if (this.rectify()) { - switch (a) { - case "row": - this.removeRow(); - break; - case "column": - this.removeColumn(); - } - this.rectify(); - } - }, - addRow: function (a) { - var b = this.table.ownerDocument; - if ( - (this.setTableMap(), - (this.idx = this.getMapIndex(this.cell)), - "below" == a && - f.getAttribute(this.cell, "rowspan") && - (this.idx.row = this.idx.row + parseInt(f.getAttribute(this.cell, "rowspan"), 10) - 1), - this.idx !== !1) - ) { - for (var c = this.map[this.idx.row], e = b.createElement("tr"), g = 0, h = c.length; h > g; g++) - c[g].modified || (this.setCellAsModified(c[g]), this.addRowCell(c[g], e, a)); - switch (a) { - case "below": - d(this.getRealRowEl(!0), e); - break; - case "above": - var i = f.getParentElement(this.map[this.idx.row][this.idx.col].el, { query: "tr" }); - i && i.parentNode.insertBefore(e, i); - } - } - }, - addRowCell: function (a, b, d) { - var e = a.isColspan ? { colspan: f.getAttribute(a.el, "colspan") } : null; - a.isReal - ? "above" != d && a.isRowspan - ? a.el.setAttribute("rowspan", parseInt(f.getAttribute(a.el, "rowspan"), 10) + 1) - : b.appendChild(this.createCells("td", 1, e)) - : "above" != d && a.isRowspan && a.lastRow - ? b.appendChild(this.createCells("td", 1, e)) - : c.isRowspan && a.el.attr("rowspan", parseInt(f.getAttribute(a.el, "rowspan"), 10) + 1); - }, - add: function (a) { - this.rectify() && - (("below" == a || "above" == a) && this.addRow(a), ("before" == a || "after" == a) && this.addColumn(a)); - }, - addColCell: function (a, b, c) { - var e, - g = a.el.tagName.toLowerCase(); - switch (c) { - case "before": - e = !a.isColspan || a.firstCol; - break; - case "after": - e = !a.isColspan || a.lastCol || (a.isColspan && a.el == this.cell); - } - if (e) { - switch (c) { - case "before": - a.el.parentNode.insertBefore(this.createCells(g, 1), a.el); - break; - case "after": - d(a.el, this.createCells(g, 1)); - } - a.isRowspan && this.handleCellAddWithRowspan(a, b + 1, c); - } else a.el.setAttribute("colspan", parseInt(f.getAttribute(a.el, "colspan"), 10) + 1); - }, - addColumn: function (a) { - var b, c; - if ( - (this.setTableMap(), - (this.idx = this.getMapIndex(this.cell)), - "after" == a && - f.getAttribute(this.cell, "colspan") && - (this.idx.col = this.idx.col + parseInt(f.getAttribute(this.cell, "colspan"), 10) - 1), - this.idx !== !1) - ) - for (var d = 0, e = this.map.length; e > d; d++) - (b = this.map[d]), - b[this.idx.col] && - ((c = b[this.idx.col]), c.modified || (this.setCellAsModified(c), this.addColCell(c, d, a))); - }, - handleCellAddWithRowspan: function (a, b, c) { - for ( - var g, - h, - i, - j = parseInt(f.getAttribute(this.cell, "rowspan"), 10) - 1, - k = f.getParentElement(a.el, { query: "tr" }), - l = a.el.tagName.toLowerCase(), - m = this.table.ownerDocument, - n = 0; - j > n; - n++ - ) - if (((g = this.correctColIndexForUnreals(this.idx.col, b + n)), (k = e(k, "tr")))) - if (g > 0) - switch (c) { - case "before": - (h = this.getRowCells(k)), - g > 0 && this.map[b + n][this.idx.col].el != h[g] && g == h.length - 1 - ? d(h[g], this.createCells(l, 1)) - : h[g].parentNode.insertBefore(this.createCells(l, 1), h[g]); - break; - case "after": - d(this.getRowCells(k)[g], this.createCells(l, 1)); - } - else k.insertBefore(this.createCells(l, 1), k.firstChild); - else (i = m.createElement("tr")), i.appendChild(this.createCells(l, 1)), this.table.appendChild(i); - }, - }), - (f.table = { - getCellsBetween: function (a, b) { - var c = new h(a); - return c.getMapElsTo(b); - }, - addCells: function (a, b) { - var c = new h(a); - c.add(b); - }, - removeCells: function (a, b) { - var c = new h(a); - c.remove(b); - }, - mergeCellsBetween: function (a, b) { - var c = new h(a); - c.merge(b); - }, - unmergeCell: function (a) { - var b = new h(a); - b.unmerge(); - }, - orderSelectionEnds: function (a, b) { - var c = new h(a); - return c.orderSelectionEnds(b); - }, - indexOf: function (a) { - var b = new h(a); - return b.setTableMap(), b.getMapIndex(a); - }, - findCell: function (a, b) { - var c = new h(null, a); - return c.getElementAtIndex(b); - }, - findRowByCell: function (a) { - var b = new h(a); - return b.getRowElementsByCell(); - }, - findColumnByCell: function (a) { - var b = new h(a); - return b.getColumnElementsByCell(); - }, - canMerge: function (a, b) { - var c = new h(a); - return c.canMerge(b); - }, - }); - })(), - (function () { - var a = wysihtml.views.Composer.prototype.observe, - b = function () { - a.call(this), this.config.handleTables && c.call(this); - }, - c = function () { - var a = function () { - this.win.removeEventListener("load", a), - this.doc.execCommand("enableObjectResizing", !1, "false"), - this.doc.execCommand("enableInlineTableEditing", !1, "false"); - }.bind(this), - b = function () { - a.call(this), this.actions.removeListeners(this.sandbox.getIframe(), ["focus", "mouseup", "mouseover"], b); - }.bind(this); - this.doc.execCommand && - wysihtml.browser.supportsCommand(this.doc, "enableObjectResizing") && - wysihtml.browser.supportsCommand(this.doc, "enableInlineTableEditing") && - (this.sandbox.getIframe - ? this.actions.addListeners(this.sandbox.getIframe(), ["focus", "mouseup", "mouseover"], b) - : this.win.addEventListener("load", a)), - (this.tableSelection = wysihtml.quirks.tableCellsSelection(this.element, this.parent)); - }, - d = function (a, b) { - var c = function () { - return a.addEventListener("mousedown", d), n; - }, - d = function (b) { - var c = wysihtml.dom.getParentElement(b.target, { query: "td, th" }, !1, a); - c && e(c); - }, - e = function (c) { - (n.start = c), - (n.end = c), - (n.cells = [c]), - (n.table = m.getParentElement(n.start, { query: "table" }, !1, a)), - n.table && - (f(), - m.addClass(c, o), - a.addEventListener("mousemove", h), - a.addEventListener("mouseup", i), - b.fire("tableselectstart").fire("tableselectstart:composer")); - }, - f = function () { - if (a) { - var b = a.querySelectorAll("." + o); - if (b.length > 0) for (var c = 0; c < b.length; c++) m.removeClass(b[c], o); - } - }, - g = function (a) { - for (var b = 0; b < a.length; b++) m.addClass(a[b], o); - }, - h = function (c) { - var d, - e = null, - h = m.getParentElement(c.target, { query: "td, th" }, !1, a); - h && - n.table && - n.start && - ((e = m.getParentElement(h, { query: "table" }, !1, a)), - e && - e === n.table && - (f(), - (d = n.end), - (n.end = h), - (n.cells = m.table.getCellsBetween(n.start, h)), - n.cells.length > 1 && b.composer.selection.deselect(), - g(n.cells), - n.end !== d && b.fire("tableselectchange").fire("tableselectchange:composer"))); - }, - i = function (c) { - a.removeEventListener("mousemove", h), - a.removeEventListener("mouseup", i), - b.fire("tableselect").fire("tableselect:composer"), - setTimeout(function () { - k(); - }, 0); - }, - j = function (c) { - a.ownerDocument.removeEventListener("click", j), - m.getParentElement(c.target, { query: "table" }, !1, a) != n.table && - (f(), - (n.table = null), - (n.start = null), - (n.end = null), - b.fire("tableunselect").fire("tableunselect:composer")); - }, - k = function () { - a.ownerDocument.addEventListener("click", j); - }, - l = function (c, d) { - (n.start = c), - (n.end = d), - (n.table = m.getParentElement(n.start, { query: "table" }, !1, a)), - (selectedCells = m.table.getCellsBetween(n.start, n.end)), - g(selectedCells), - k(), - b.fire("tableselect").fire("tableselect:composer"); - }, - m = wysihtml.dom, - n = { table: null, start: null, end: null, cells: null, select: l }, - o = "wysiwyg-tmp-selected-cell"; - return c(); - }; - (wysihtml.Editor.prototype.defaults.handleTables = !0), - (wysihtml.quirks.tableCellsSelection = d), - (wysihtml.views.Composer.prototype.observe = b); - })(); -//# sourceMappingURL=wysihtml.table_editing.min.map diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.toolbar.min.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.toolbar.min.js deleted file mode 100644 index 767512b48c3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/client/resources/js/wysihtml/wysihtml.toolbar.min.js +++ /dev/null @@ -1,461 +0,0 @@ -!(function (a) { - var b = a.dom, - c = "wysihtml-command-dialog-opened", - d = "input, select, textarea", - e = "[data-wysihtml-dialog-field]", - f = "data-wysihtml-dialog-field"; - a.toolbar.Dialog = a.lang.Dispatcher.extend({ - constructor: function (a, b) { - (this.link = a), (this.container = b); - }, - _observe: function () { - if (!this._observed) { - var d = this, - e = function (a) { - var b = d._serialize(); - d.fire("save", b), d.hide(), a.preventDefault(), a.stopPropagation(); - }; - b.observe(d.link, "click", function () { - b.hasClass(d.link, c) && - setTimeout(function () { - d.hide(); - }, 0); - }), - b.observe(this.container, "keydown", function (b) { - var c = b.keyCode; - c === a.ENTER_KEY && e(b), c === a.ESCAPE_KEY && d.cancel(); - }), - b.delegate(this.container, "[data-wysihtml-dialog-action=save]", "click", e), - b.delegate(this.container, "[data-wysihtml-dialog-action=cancel]", "click", function (a) { - d.cancel(), a.preventDefault(), a.stopPropagation(); - }), - (this._observed = !0); - } - }, - _serialize: function () { - for (var a = {}, b = this.container.querySelectorAll(e), c = b.length, d = 0; c > d; d++) - a[b[d].getAttribute(f)] = b[d].value; - return a; - }, - _interpolate: function (a) { - for ( - var b, c, d, g = document.querySelector(":focus"), h = this.container.querySelectorAll(e), i = h.length, j = 0; - i > j; - j++ - ) - (b = h[j]), - b !== g && - ((a && "hidden" === b.type) || - ((c = b.getAttribute(f)), - (d = - this.elementToChange && "boolean" != typeof this.elementToChange - ? this.elementToChange.getAttribute(c) || "" - : b.defaultValue), - (b.value = d))); - }, - update: function (a) { - (this.elementToChange = a ? a : this.elementToChange), this._interpolate(); - }, - show: function (a) { - var e = this.container.querySelector(d); - if ( - (this._observe(), - this.update(a), - b.addClass(this.link, c), - (this.container.style.display = ""), - (this.isOpen = !0), - this.fire("show"), - e && !a) - ) - try { - e.focus(); - } catch (f) {} - }, - _hide: function (a) { - (this.elementToChange = null), - b.removeClass(this.link, c), - (this.container.style.display = "none"), - (this.isOpen = !1); - }, - hide: function () { - this._hide(), this.fire("hide"); - }, - cancel: function () { - this._hide(), this.fire("cancel"); - }, - }); -})(wysihtml), - (function (a) { - var b = (a.dom, "[data-wysihtml-dialog-field]"), - c = "data-wysihtml-dialog-field"; - a.toolbar.Dialog_bgColorStyle = a.toolbar.Dialog.extend({ - multiselect: !0, - _serialize: function () { - for (var a = {}, d = this.container.querySelectorAll(b), e = d.length, f = 0; e > f; f++) - a[d[f].getAttribute(c)] = d[f].value; - return a; - }, - _interpolate: function (d) { - for ( - var e, - f = document.querySelector(":focus"), - g = this.container.querySelectorAll(b), - h = g.length, - i = 0, - j = this.elementToChange - ? a.lang.object(this.elementToChange).isArray() - ? this.elementToChange[0] - : this.elementToChange - : null, - k = j ? j.getAttribute("style") : null, - l = k ? a.quirks.styleParser.parseColor(k, "background-color") : null; - h > i; - i++ - ) - (e = g[i]), - e !== f && - ((d && "hidden" === e.type) || - ("color" === e.getAttribute(c) && - (l - ? l[3] && 1 != l[3] - ? (e.value = "rgba(" + l[0] + "," + l[1] + "," + l[2] + "," + l[3] + ");") - : (e.value = "rgb(" + l[0] + "," + l[1] + "," + l[2] + ");") - : (e.value = "rgb(0,0,0);")))); - }, - }); - })(wysihtml), - (function (a) { - a.toolbar.Dialog_createTable = a.toolbar.Dialog.extend({ - show: function (a) { - this.base(a); - }, - }); - })(wysihtml), - (function (a) { - a.dom; - a.toolbar.Dialog_fontSizeStyle = a.toolbar.Dialog.extend({ - multiselect: !0, - _serialize: function () { - return { size: this.container.querySelector('[data-wysihtml-dialog-field="size"]').value }; - }, - _interpolate: function (b) { - var c = document.querySelector(":focus"), - d = this.container.querySelector("[data-wysihtml-dialog-field='size']"), - e = this.elementToChange - ? a.lang.object(this.elementToChange).isArray() - ? this.elementToChange[0] - : this.elementToChange - : null, - f = e ? e.getAttribute("style") : null, - g = f ? a.quirks.styleParser.parseFontSize(f) : null; - d && d !== c && g && !/^\s*$/.test(g) && (d.value = g); - }, - }); - })(wysihtml), - (function (a) { - var b = "[data-wysihtml-dialog-field]", - c = "data-wysihtml-dialog-field"; - a.toolbar.Dialog_foreColorStyle = a.toolbar.Dialog.extend({ - multiselect: !0, - _serialize: function () { - for (var a = {}, d = this.container.querySelectorAll(b), e = d.length, f = 0; e > f; f++) - a[d[f].getAttribute(c)] = d[f].value; - return a; - }, - _interpolate: function (d) { - for ( - var e, - f, - g = a.quirks.styleParser, - h = document.querySelector(":focus"), - i = this.container.querySelectorAll(b), - j = i.length, - k = 0, - l = this.elementToChange - ? a.lang.object(this.elementToChange).isArray() - ? this.elementToChange[0] - : this.elementToChange - : null, - m = l ? l.getAttribute("style") : null, - n = m ? g.parseColor(m, "color") : null; - j > k; - k++ - ) - (e = i[k]), - e !== h && - ((d && "hidden" === e.type) || - ("color" === e.getAttribute(c) && - ((f = (e.dataset.colormode || "rgb").toLowerCase()), - (f = "hex" === f ? "hash" : f), - n ? (e.value = g.unparseColor(n, f)) : (e.value = g.unparseColor([0, 0, 0], f))))); - }, - }); - })(wysihtml), - (function (a) { - var b = a.dom, - c = { position: "relative" }, - d = { left: 0, margin: 0, opacity: 0, overflow: "hidden", padding: 0, position: "absolute", top: 0, zIndex: 1 }, - e = { - cursor: "inherit", - fontSize: "50px", - height: "50px", - marginTop: "-25px", - outline: 0, - padding: 0, - position: "absolute", - right: "-4px", - top: "50%", - }, - f = { "x-webkit-speech": "", speech: "" }; - a.toolbar.Speech = function (g, h) { - var i = document.createElement("input"); - if (!a.browser.supportsSpeechApiOn(i)) return void (h.style.display = "none"); - var j = g.editor.textarea.element.getAttribute("lang"); - j && (f.lang = j); - var k = document.createElement("div"); - a.lang.object(d).merge({ width: h.offsetWidth + "px", height: h.offsetHeight + "px" }), - b.insert(i).into(k), - b.insert(k).into(h), - b.setStyles(e).on(i), - b.setAttributes(f).on(i), - b.setStyles(d).on(k), - b.setStyles(c).on(h); - var l = "onwebkitspeechchange" in i ? "webkitspeechchange" : "speechchange"; - b.observe(i, l, function () { - g.execCommand("insertText", i.value), (i.value = ""); - }), - b.observe(i, "click", function (a) { - b.hasClass(h, "wysihtml-command-disabled") && a.preventDefault(), a.stopPropagation(); - }); - }; - })(wysihtml), - (function (a) { - function b(b, c) { - var d = b.commands.state(c.name, c.value); - return !c.dialog.multiselect && a.lang.object(d).isArray() && (d = 1 === d.length ? d[0] : !0), d; - } - var c = "wysihtml-command-disabled", - d = "wysihtml-commands-disabled", - e = "wysihtml-command-active", - f = "wysihtml-action-active", - g = a.dom; - (a.toolbar.Toolbar = Base.extend({ - constructor: function (b, g, h) { - (this.editor = b), - (this.container = "string" == typeof g ? document.getElementById(g) : g), - (this.composer = b.composer), - this._getLinks("command"), - this._getLinks("action"), - this._observe(), - h && this.show(), - null != b.config.classNameCommandDisabled && (c = b.config.classNameCommandDisabled), - null != b.config.classNameCommandsDisabled && (d = b.config.classNameCommandsDisabled), - null != b.config.classNameCommandActive && (e = b.config.classNameCommandActive), - null != b.config.classNameActionActive && (f = b.config.classNameActionActive); - for ( - var i = this.container.querySelectorAll("[data-wysihtml-command=insertSpeech]"), j = i.length, k = 0; - j > k; - k++ - ) - new a.toolbar.Speech(this, i[k]); - }, - _getLinks: function (b) { - for ( - var c, - d, - e, - f, - g, - h, - i = (this[b + "Links"] = a.lang.array(this.container.querySelectorAll("[data-wysihtml-" + b + "]")).get()), - j = i.length, - k = 0, - l = (this[b + "Mapping"] = {}); - j > k; - k++ - ) - (c = i[k]), - (e = c.getAttribute("data-wysihtml-" + b)), - (f = c.getAttribute("data-wysihtml-" + b + "-value")), - (h = c.getAttribute("data-wysihtml-" + b + "-blank-value")), - (d = this.container.querySelector("[data-wysihtml-" + b + "-group='" + e + "']")), - (g = this._getDialog(c, e)), - (l[e + ":" + f] = { link: c, group: d, name: e, value: f, tracksBlankValue: h, dialog: g, state: !1 }); - }, - _getDialog: function (b, c) { - var d, - e, - f = this, - g = this.container.querySelector("[data-wysihtml-dialog='" + c + "']"); - return ( - g && - ((d = a.toolbar["Dialog_" + c] ? new a.toolbar["Dialog_" + c](b, g) : new a.toolbar.Dialog(b, g)), - d.on("show", function () { - (e = f.composer.selection.getBookmark()), - f.editor.fire("show:dialog", { command: c, dialogContainer: g, commandLink: b }); - }), - d.on("save", function (a) { - e && f.composer.selection.setBookmark(e), - f._execCommand(c, a), - f.editor.fire("save:dialog", { command: c, dialogContainer: g, commandLink: b }), - f._hideAllDialogs(), - f._preventInstantFocus(), - (e = void 0); - }), - d.on("cancel", function () { - e && f.composer.selection.setBookmark(e), - f.editor.fire("cancel:dialog", { command: c, dialogContainer: g, commandLink: b }), - (e = void 0), - f._preventInstantFocus(); - }), - d.on("hide", function () { - f.editor.fire("hide:dialog", { command: c, dialogContainer: g, commandLink: b }), (e = void 0); - })), - d - ); - }, - execCommand: function (a, b) { - this.commandsDisabled || this._execCommand(a, b); - }, - _execCommand: function (a, b) { - this.editor.focus(!1), this.composer.commands.exec(a, b), this._updateLinkStates(); - }, - execAction: function (a) { - var b = this.editor; - "change_view" === a && - (b.currentView === b.textarea || "source" === b.currentView - ? b.fire("change_view", "composer") - : b.fire("change_view", "textarea")), - "showSource" == a && b.fire("showSource"); - }, - _observe: function () { - for ( - var c = this, - e = this.editor, - f = this.container, - h = this.commandLinks.concat(this.actionLinks), - i = h.length, - j = 0; - i > j; - j++ - ) - "A" === h[j].nodeName - ? g.setAttributes({ href: "javascript:;", unselectable: "on" }).on(h[j]) - : g.setAttributes({ unselectable: "on" }).on(h[j]); - g.delegate(f, "[data-wysihtml-command], [data-wysihtml-action]", "mousedown", function (a) { - a.preventDefault(); - }), - g.delegate(f, "[data-wysihtml-command]", "click", function (a) { - var d, - e = this, - f = e.getAttribute("data-wysihtml-command"), - g = e.getAttribute("data-wysihtml-command-value"), - h = c.commandMapping[f + ":" + g]; - g || !h.dialog ? c.execCommand(f, g) : ((d = b(c.composer, h)), h.dialog.show(d)), a.preventDefault(); - }), - g.delegate(f, "[data-wysihtml-action]", "click", function (a) { - var b = this.getAttribute("data-wysihtml-action"); - c.execAction(b), a.preventDefault(); - }), - e.on("interaction:composer", function (a) { - c.preventFocus || c._updateLinkStates(); - }), - (this._ownerDocumentClick = function (b) { - a.dom.contains(c.container, b.target) || - a.dom.contains(c.composer.element, b.target) || - (c._updateLinkStates(), c._preventInstantFocus()); - }), - this.container.ownerDocument.addEventListener("click", this._ownerDocumentClick, !1), - this.editor.on("destroy:composer", this.destroy.bind(this)), - this.editor.config.handleTables && - (e.on("tableselect:composer", function () { - c.container.querySelectorAll('[data-wysihtml-hiddentools="table"]')[0].style.display = ""; - }), - e.on("tableunselect:composer", function () { - c.container.querySelectorAll('[data-wysihtml-hiddentools="table"]')[0].style.display = "none"; - })), - e.on("change_view", function (a) { - setTimeout(function () { - (c.commandsDisabled = "composer" !== a), - c._updateLinkStates(), - c.commandsDisabled ? g.addClass(f, d) : g.removeClass(f, d); - }, 0); - }); - }, - destroy: function () { - this.container.ownerDocument.removeEventListener("click", this._ownerDocumentClick, !1); - }, - _hideAllDialogs: function () { - var a = this.commandMapping; - for (var b in a) a[b].dialog && a[b].dialog.hide(); - }, - _preventInstantFocus: function () { - (this.preventFocus = !0), - setTimeout( - function () { - this.preventFocus = !1; - }.bind(this), - 0 - ); - }, - _updateLinkStates: function () { - var a, - d, - h, - i, - j, - k = this.commandMapping, - l = this.composer, - m = this.actionMapping; - for (a in k) - (i = k[a]), - this.commandsDisabled - ? ((d = !1), g.removeClass(i.link, e), i.group && g.removeClass(i.group, e), i.dialog && i.dialog.hide()) - : ((d = this.composer.commands.state(i.name, i.value)), - g.removeClass(i.link, c), - i.group && g.removeClass(i.group, c)), - (i.state !== d || i.tracksBlankValue) && - ((i.state = d), - d - ? i.tracksBlankValue - ? g.removeClass(i.link, e) - : (g.addClass(i.link, e), - i.group && g.addClass(i.group, e), - !i.dialog || - ("undefined" != typeof i.value && null !== i.value) || - (d && "object" == typeof d - ? ((d = b(l, i)), - (i.state = d), - (j = i.dialog.container.dataset ? i.dialog.container.dataset.showdialogonselection : !1), - l.config.showToolbarDialogsOnSelection || j ? i.dialog.show(d) : i.dialog.update(d)) - : i.dialog.hide())) - : i.tracksBlankValue - ? g.addClass(i.link, e) - : (g.removeClass(i.link, e), - i.group && g.removeClass(i.group, e), - i.dialog && !i.value && i.dialog.hide())); - for (a in m) - (h = m[a]), - "change_view" === h.name && - ((h.state = this.editor.currentView === this.editor.textarea || "source" === this.editor.currentView), - h.state ? g.addClass(h.link, f) : g.removeClass(h.link, f)); - }, - show: function () { - this.container.style.display = ""; - }, - hide: function () { - this.container.style.display = "none"; - }, - })), - (a.Editor.prototype.defaults.toolbar = void 0), - (a.Editor.prototype.defaults.showToolbarAfterInit = !0), - (a.Editor.prototype.defaults.showToolbarDialogsOnSelection = !0), - a.extendEditor(function (b) { - b.config.toolbar && - ((b.toolbar = new a.toolbar.Toolbar(b, b.config.toolbar, b.config.showToolbarAfterInit)), - b.on("destroy:composer", function () { - b && b.toolbar && b.toolbar.destroy(); - })); - }); - })(wysihtml); -//# sourceMappingURL=wysihtml.toolbar.min.map diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/github.min.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/github.min.css deleted file mode 100644 index 3d51f9a52d5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/github.min.css +++ /dev/null @@ -1,77 +0,0 @@ -.hljs { - display: block; - overflow-x: auto; - padding: 0.5em; - color: #333; - background: #f8f8f8; -} -.hljs-comment, -.hljs-quote { - color: #998; - font-style: italic; -} -.hljs-keyword, -.hljs-selector-tag, -.hljs-subst { - color: #333; - font-weight: bold; -} -.hljs-number, -.hljs-literal, -.hljs-variable, -.hljs-template-variable, -.hljs-tag .hljs-attr { - color: #008080; -} -.hljs-string, -.hljs-doctag { - color: #d14; -} -.hljs-title, -.hljs-section, -.hljs-selector-id { - color: #900; - font-weight: bold; -} -.hljs-subst { - font-weight: normal; -} -.hljs-type, -.hljs-class .hljs-title { - color: #458; - font-weight: bold; -} -.hljs-tag, -.hljs-name, -.hljs-attribute { - color: #000080; - font-weight: normal; -} -.hljs-regexp, -.hljs-link { - color: #009926; -} -.hljs-symbol, -.hljs-bullet { - color: #990073; -} -.hljs-built_in, -.hljs-builtin-name { - color: #0086b3; -} -.hljs-meta { - color: #999; - font-weight: bold; -} -.hljs-deletion { - background: #fdd; -} -.hljs-addition { - background: #dfd; -} -.hljs-emphasis { - font-style: italic; -} -.hljs-strong { - font-weight: bold; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/highlight.min.js b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/highlight.min.js deleted file mode 100644 index 9f040ec710f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/resources/org/uberfire/ext/widgets/common/public/highlight/highlight.min.js +++ /dev/null @@ -1,1574 +0,0 @@ -/*! highlight.js v9.15.8 | BSD3 License | git.io/hljslicense */ -!(function (e) { - var t = ("object" == typeof window && window) || ("object" == typeof self && self); - "undefined" != typeof exports - ? e(exports) - : t && - ((t.hljs = e({})), - "function" == typeof define && - define.amd && - define([], function () { - return t.hljs; - })); -})(function (n) { - var d = [], - o = Object.keys, - h = {}, - c = {}, - t = /^(no-?highlight|plain|text)$/i, - l = /\blang(?:uage)?-([\w-]+)\b/i, - r = /((^(<[^>]+>|\t|)+|(?:\n)))/gm, - a = { - case_insensitive: "cI", - lexemes: "l", - contains: "c", - keywords: "k", - subLanguage: "sL", - className: "cN", - begin: "b", - beginKeywords: "bK", - end: "e", - endsWithParent: "eW", - illegal: "i", - excludeBegin: "eB", - excludeEnd: "eE", - returnBegin: "rB", - returnEnd: "rE", - relevance: "r", - variants: "v", - IDENT_RE: "IR", - UNDERSCORE_IDENT_RE: "UIR", - NUMBER_RE: "NR", - C_NUMBER_RE: "CNR", - BINARY_NUMBER_RE: "BNR", - RE_STARTERS_RE: "RSR", - BACKSLASH_ESCAPE: "BE", - APOS_STRING_MODE: "ASM", - QUOTE_STRING_MODE: "QSM", - PHRASAL_WORDS_MODE: "PWM", - C_LINE_COMMENT_MODE: "CLCM", - C_BLOCK_COMMENT_MODE: "CBCM", - HASH_COMMENT_MODE: "HCM", - NUMBER_MODE: "NM", - C_NUMBER_MODE: "CNM", - BINARY_NUMBER_MODE: "BNM", - CSS_NUMBER_MODE: "CSSNM", - REGEXP_MODE: "RM", - TITLE_MODE: "TM", - UNDERSCORE_TITLE_MODE: "UTM", - COMMENT: "C", - beginRe: "bR", - endRe: "eR", - illegalRe: "iR", - lexemesRe: "lR", - terminators: "t", - terminator_end: "tE", - }, - N = "", - v = { classPrefix: "hljs-", tabReplace: null, useBR: !1, languages: void 0 }; - function y(e) { - return e.replace(/&/g, "&").replace(//g, ">"); - } - function b(e) { - return e.nodeName.toLowerCase(); - } - function w(e, t) { - var r = e && e.exec(t); - return r && 0 === r.index; - } - function u(e) { - return t.test(e); - } - function p(e) { - var t, - r = {}, - a = Array.prototype.slice.call(arguments, 1); - for (t in e) r[t] = e[t]; - return ( - a.forEach(function (e) { - for (t in e) r[t] = e[t]; - }), - r - ); - } - function m(e) { - var n = []; - return ( - (function e(t, r) { - for (var a = t.firstChild; a; a = a.nextSibling) - 3 === a.nodeType - ? (r += a.nodeValue.length) - : 1 === a.nodeType && - (n.push({ event: "start", offset: r, node: a }), - (r = e(a, r)), - b(a).match(/br|hr|img|input/) || n.push({ event: "stop", offset: r, node: a })); - return r; - })(e, 0), - n - ); - } - function i(e) { - if (a && !e.langApiRestored) { - for (var t in ((e.langApiRestored = !0), a)) e[t] && (e[a[t]] = e[t]); - (e.c || []).concat(e.v || []).forEach(i); - } - } - function E(s) { - function l(e) { - return (e && e.source) || e; - } - function c(e, t) { - return new RegExp(l(e), "m" + (s.cI ? "i" : "") + (t ? "g" : "")); - } - !(function t(r, e) { - if (!r.compiled) { - if (((r.compiled = !0), (r.k = r.k || r.bK), r.k)) { - function a(r, e) { - s.cI && (e = e.toLowerCase()), - e.split(" ").forEach(function (e) { - var t = e.split("|"); - n[t[0]] = [r, t[1] ? Number(t[1]) : 1]; - }); - } - var n = {}; - "string" == typeof r.k - ? a("keyword", r.k) - : o(r.k).forEach(function (e) { - a(e, r.k[e]); - }), - (r.k = n); - } - (r.lR = c(r.l || /\w+/, !0)), - e && - (r.bK && (r.b = "\\b(" + r.bK.split(" ").join("|") + ")\\b"), - r.b || (r.b = /\B|\b/), - (r.bR = c(r.b)), - r.endSameAsBegin && (r.e = r.b), - r.e || r.eW || (r.e = /\B|\b/), - r.e && (r.eR = c(r.e)), - (r.tE = l(r.e) || ""), - r.eW && e.tE && (r.tE += (r.e ? "|" : "") + e.tE)), - r.i && (r.iR = c(r.i)), - null == r.r && (r.r = 1), - r.c || (r.c = []), - (r.c = Array.prototype.concat.apply( - [], - r.c.map(function (e) { - return (function (t) { - return ( - t.v && - !t.cached_variants && - (t.cached_variants = t.v.map(function (e) { - return p(t, { v: null }, e); - })), - t.cached_variants || (t.eW && [p(t)]) || [t] - ); - })("self" === e ? r : e); - }) - )), - r.c.forEach(function (e) { - t(e, r); - }), - r.starts && t(r.starts, e); - var i = r.c - .map(function (e) { - return e.bK ? "\\.?(?:" + e.b + ")\\.?" : e.b; - }) - .concat([r.tE, r.i]) - .map(l) - .filter(Boolean); - r.t = i.length - ? c( - (function (e, t) { - for ( - var r = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./, a = 0, n = "", i = 0; - i < e.length; - i++ - ) { - var s = a, - c = l(e[i]); - for (0 < i && (n += t); 0 < c.length; ) { - var o = r.exec(c); - if (null == o) { - n += c; - break; - } - (n += c.substring(0, o.index)), - (c = c.substring(o.index + o[0].length)), - "\\" == o[0][0] && o[1] - ? (n += "\\" + String(Number(o[1]) + s)) - : ((n += o[0]), "(" == o[0] && a++); - } - } - return n; - })(i, "|"), - !0 - ) - : { - exec: function () { - return null; - }, - }; - } - })(s); - } - function k(e, t, i, r) { - function c(e, t, r, a) { - var n = '') + t + (r ? "" : N) : t; - } - function s() { - (b += - null != u.sL - ? (function () { - var e = "string" == typeof u.sL; - if (e && !h[u.sL]) return y(p); - var t = e ? k(u.sL, p, !0, d[u.sL]) : x(p, u.sL.length ? u.sL : void 0); - return 0 < u.r && (m += t.r), e && (d[u.sL] = t.top), c(t.language, t.value, !1, !0); - })() - : (function () { - var e, t, r, a, n, i, s; - if (!u.k) return y(p); - for (a = "", t = 0, u.lR.lastIndex = 0, r = u.lR.exec(p); r; ) - (a += y(p.substring(t, r.index))), - (n = u), - (i = r), - void 0, - (s = l.cI ? i[0].toLowerCase() : i[0]), - (e = n.k.hasOwnProperty(s) && n.k[s]) ? ((m += e[1]), (a += c(e[0], y(r[0])))) : (a += y(r[0])), - (t = u.lR.lastIndex), - (r = u.lR.exec(p)); - return a + y(p.substr(t)); - })()), - (p = ""); - } - function o(e) { - (b += e.cN ? c(e.cN, "", !0) : ""), (u = Object.create(e, { parent: { value: u } })); - } - function a(e, t) { - if (((p += e), null == t)) return s(), 0; - var r = (function (e, t) { - var r, a, n; - for (r = 0, a = t.c.length; r < a; r++) - if (w(t.c[r].bR, e)) - return ( - t.c[r].endSameAsBegin && - (t.c[r].eR = - ((n = t.c[r].bR.exec(e)[0]), new RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"), "m"))), - t.c[r] - ); - })(t, u); - if (r) return r.skip ? (p += t) : (r.eB && (p += t), s(), r.rB || r.eB || (p = t)), o(r), r.rB ? 0 : t.length; - var a = (function e(t, r) { - if (w(t.eR, r)) { - for (; t.endsParent && t.parent; ) t = t.parent; - return t; - } - if (t.eW) return e(t.parent, r); - })(u, t); - if (a) { - var n = u; - for ( - n.skip ? (p += t) : (n.rE || n.eE || (p += t), s(), n.eE && (p = t)); - u.cN && (b += N), u.skip || u.sL || (m += u.r), (u = u.parent) !== a.parent; - - ); - return a.starts && (a.endSameAsBegin && (a.starts.eR = a.eR), o(a.starts)), n.rE ? 0 : t.length; - } - if ( - (function (e, t) { - return !i && w(t.iR, e); - })(t, u) - ) - throw new Error('Illegal lexeme "' + t + '" for mode "' + (u.cN || "") + '"'); - return (p += t), t.length || 1; - } - var l = M(e); - if (!l) throw new Error('Unknown language: "' + e + '"'); - E(l); - var n, - u = r || l, - d = {}, - b = ""; - for (n = u; n !== l; n = n.parent) n.cN && (b = c(n.cN, "", !0) + b); - var p = "", - m = 0; - try { - for (var f, g, _ = 0; (u.t.lastIndex = _), (f = u.t.exec(t)); ) - (g = a(t.substring(_, f.index), f[0])), (_ = f.index + g); - for (a(t.substr(_)), n = u; n.parent; n = n.parent) n.cN && (b += N); - return { r: m, value: b, language: e, top: u }; - } catch (e) { - if (e.message && -1 !== e.message.indexOf("Illegal")) return { r: 0, value: y(t) }; - throw e; - } - } - function x(r, e) { - e = e || v.languages || o(h); - var a = { r: 0, value: y(r) }, - n = a; - return ( - e - .filter(M) - .filter(_) - .forEach(function (e) { - var t = k(e, r, !1); - (t.language = e), t.r > n.r && (n = t), t.r > a.r && ((n = a), (a = t)); - }), - n.language && (a.second_best = n), - a - ); - } - function f(e) { - return v.tabReplace || v.useBR - ? e.replace(r, function (e, t) { - return v.useBR && "\n" === e ? "
        " : v.tabReplace ? t.replace(/\t/g, v.tabReplace) : ""; - }) - : e; - } - function s(e) { - var t, - r, - a, - n, - i, - s = (function (e) { - var t, - r, - a, - n, - i = e.className + " "; - if (((i += e.parentNode ? e.parentNode.className : ""), (r = l.exec(i)))) - return M(r[1]) ? r[1] : "no-highlight"; - for (t = 0, a = (i = i.split(/\s+/)).length; t < a; t++) if (u((n = i[t])) || M(n)) return n; - })(e); - u(s) || - (v.useBR - ? ((t = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = e.innerHTML - .replace(/\n/g, "") - .replace(//g, "\n")) - : (t = e), - (i = t.textContent), - (a = s ? k(s, i, !0) : x(i)), - (r = m(t)).length && - (((n = document.createElementNS("http://www.w3.org/1999/xhtml", "div")).innerHTML = a.value), - (a.value = (function (e, t, r) { - var a = 0, - n = "", - i = []; - function s() { - return e.length && t.length - ? e[0].offset !== t[0].offset - ? e[0].offset < t[0].offset - ? e - : t - : "start" === t[0].event - ? e - : t - : e.length - ? e - : t; - } - function c(e) { - n += - "<" + - b(e) + - d.map - .call(e.attributes, function (e) { - return " " + e.nodeName + '="' + y(e.value).replace('"', """) + '"'; - }) - .join("") + - ">"; - } - function o(e) { - n += ""; - } - function l(e) { - ("start" === e.event ? c : o)(e.node); - } - for (; e.length || t.length; ) { - var u = s(); - if (((n += y(r.substring(a, u[0].offset))), (a = u[0].offset), u === e)) { - for (i.reverse().forEach(o); l(u.splice(0, 1)[0]), (u = s()) === e && u.length && u[0].offset === a; ); - i.reverse().forEach(c); - } else "start" === u[0].event ? i.push(u[0].node) : i.pop(), l(u.splice(0, 1)[0]); - } - return n + y(r.substr(a)); - })(r, m(n), i))), - (a.value = f(a.value)), - (e.innerHTML = a.value), - (e.className = (function (e, t, r) { - var a = t ? c[t] : r, - n = [e.trim()]; - return e.match(/\bhljs\b/) || n.push("hljs"), -1 === e.indexOf(a) && n.push(a), n.join(" ").trim(); - })(e.className, s, a.language)), - (e.result = { language: a.language, re: a.r }), - a.second_best && (e.second_best = { language: a.second_best.language, re: a.second_best.r })); - } - function g() { - if (!g.called) { - g.called = !0; - var e = document.querySelectorAll("pre code"); - d.forEach.call(e, s); - } - } - function M(e) { - return (e = (e || "").toLowerCase()), h[e] || h[c[e]]; - } - function _(e) { - var t = M(e); - return t && !t.disableAutodetect; - } - return ( - (n.highlight = k), - (n.highlightAuto = x), - (n.fixMarkup = f), - (n.highlightBlock = s), - (n.configure = function (e) { - v = p(v, e); - }), - (n.initHighlighting = g), - (n.initHighlightingOnLoad = function () { - addEventListener("DOMContentLoaded", g, !1), addEventListener("load", g, !1); - }), - (n.registerLanguage = function (t, e) { - var r = (h[t] = e(n)); - i(r), - r.aliases && - r.aliases.forEach(function (e) { - c[e] = t; - }); - }), - (n.listLanguages = function () { - return o(h); - }), - (n.getLanguage = M), - (n.autoDetection = _), - (n.inherit = p), - (n.IR = n.IDENT_RE = "[a-zA-Z]\\w*"), - (n.UIR = n.UNDERSCORE_IDENT_RE = "[a-zA-Z_]\\w*"), - (n.NR = n.NUMBER_RE = "\\b\\d+(\\.\\d+)?"), - (n.CNR = n.C_NUMBER_RE = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)"), - (n.BNR = n.BINARY_NUMBER_RE = "\\b(0b[01]+)"), - (n.RSR = n.RE_STARTERS_RE = - "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~"), - (n.BE = n.BACKSLASH_ESCAPE = { b: "\\\\[\\s\\S]", r: 0 }), - (n.ASM = n.APOS_STRING_MODE = { cN: "string", b: "'", e: "'", i: "\\n", c: [n.BE] }), - (n.QSM = n.QUOTE_STRING_MODE = { cN: "string", b: '"', e: '"', i: "\\n", c: [n.BE] }), - (n.PWM = n.PHRASAL_WORDS_MODE = - { - b: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/, - }), - (n.C = n.COMMENT = - function (e, t, r) { - var a = n.inherit({ cN: "comment", b: e, e: t, c: [] }, r || {}); - return a.c.push(n.PWM), a.c.push({ cN: "doctag", b: "(?:TODO|FIXME|NOTE|BUG|XXX):", r: 0 }), a; - }), - (n.CLCM = n.C_LINE_COMMENT_MODE = n.C("//", "$")), - (n.CBCM = n.C_BLOCK_COMMENT_MODE = n.C("/\\*", "\\*/")), - (n.HCM = n.HASH_COMMENT_MODE = n.C("#", "$")), - (n.NM = n.NUMBER_MODE = { cN: "number", b: n.NR, r: 0 }), - (n.CNM = n.C_NUMBER_MODE = { cN: "number", b: n.CNR, r: 0 }), - (n.BNM = n.BINARY_NUMBER_MODE = { cN: "number", b: n.BNR, r: 0 }), - (n.CSSNM = n.CSS_NUMBER_MODE = - { - cN: "number", - b: n.NR + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?", - r: 0, - }), - (n.RM = n.REGEXP_MODE = - { cN: "regexp", b: /\//, e: /\/[gimuy]*/, i: /\n/, c: [n.BE, { b: /\[/, e: /\]/, r: 0, c: [n.BE] }] }), - (n.TM = n.TITLE_MODE = { cN: "title", b: n.IR, r: 0 }), - (n.UTM = n.UNDERSCORE_TITLE_MODE = { cN: "title", b: n.UIR, r: 0 }), - (n.METHOD_GUARD = { b: "\\.\\s*" + n.UIR, r: 0 }), - n.registerLanguage("apache", function (e) { - var t = { cN: "number", b: "[\\$%]\\d+" }; - return { - aliases: ["apacheconf"], - cI: !0, - c: [ - e.HCM, - { cN: "section", b: "" }, - { - cN: "attribute", - b: /\w+/, - r: 0, - k: { - nomarkup: - "order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername", - }, - starts: { - e: /$/, - r: 0, - k: { literal: "on off all" }, - c: [ - { cN: "meta", b: "\\s\\[", e: "\\]$" }, - { cN: "variable", b: "[\\$%]\\{", e: "\\}", c: ["self", t] }, - t, - e.QSM, - ], - }, - }, - ], - i: /\S/, - }; - }), - n.registerLanguage("bash", function (e) { - var t = { cN: "variable", v: [{ b: /\$[\w\d#@][\w\d_]*/ }, { b: /\$\{(.*?)}/ }] }, - r = { cN: "string", b: /"/, e: /"/, c: [e.BE, t, { cN: "variable", b: /\$\(/, e: /\)/, c: [e.BE] }] }; - return { - aliases: ["sh", "zsh"], - l: /\b-?[a-z\._]+\b/, - k: { - keyword: "if then else elif fi for while in do done case esac function", - literal: "true false", - built_in: - "break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp", - _: "-ne -eq -lt -gt -f -d -e -s -l -a", - }, - c: [ - { cN: "meta", b: /^#![^\n]+sh\s*$/, r: 10 }, - { cN: "function", b: /\w[\w\d_]*\s*\(\s*\)\s*\{/, rB: !0, c: [e.inherit(e.TM, { b: /\w[\w\d_]*/ })], r: 0 }, - e.HCM, - r, - { cN: "string", b: /'/, e: /'/ }, - t, - ], - }; - }), - n.registerLanguage("coffeescript", function (e) { - var t = { - keyword: - "in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not", - literal: "true false null undefined yes no on off", - built_in: "npm require console print module global window document", - }, - r = "[A-Za-z$_][0-9A-Za-z$_]*", - a = { cN: "subst", b: /#\{/, e: /}/, k: t }, - n = [ - e.BNM, - e.inherit(e.CNM, { starts: { e: "(\\s*/)?", r: 0 } }), - { - cN: "string", - v: [ - { b: /'''/, e: /'''/, c: [e.BE] }, - { b: /'/, e: /'/, c: [e.BE] }, - { b: /"""/, e: /"""/, c: [e.BE, a] }, - { b: /"/, e: /"/, c: [e.BE, a] }, - ], - }, - { - cN: "regexp", - v: [ - { b: "///", e: "///", c: [a, e.HCM] }, - { b: "//[gim]*", r: 0 }, - { b: /\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/ }, - ], - }, - { b: "@" + r }, - { - sL: "javascript", - eB: !0, - eE: !0, - v: [ - { b: "```", e: "```" }, - { b: "`", e: "`" }, - ], - }, - ]; - a.c = n; - var i = e.inherit(e.TM, { b: r }), - s = "(\\(.*\\))?\\s*\\B[-=]>", - c = { cN: "params", b: "\\([^\\(]", rB: !0, c: [{ b: /\(/, e: /\)/, k: t, c: ["self"].concat(n) }] }; - return { - aliases: ["coffee", "cson", "iced"], - k: t, - i: /\/\*/, - c: n.concat([ - e.C("###", "###"), - e.HCM, - { cN: "function", b: "^\\s*" + r + "\\s*=\\s*" + s, e: "[-=]>", rB: !0, c: [i, c] }, - { b: /[:\(,=]\s*/, r: 0, c: [{ cN: "function", b: s, e: "[-=]>", rB: !0, c: [c] }] }, - { - cN: "class", - bK: "class", - e: "$", - i: /[:="\[\]]/, - c: [{ bK: "extends", eW: !0, i: /[:="\[\]]/, c: [i] }, i], - }, - { b: r + ":", e: ":", rB: !0, rE: !0, r: 0 }, - ]), - }; - }), - n.registerLanguage("cpp", function (e) { - var t = { cN: "keyword", b: "\\b[a-z\\d_]*_t\\b" }, - r = { - cN: "string", - v: [ - { b: '(u8?|U|L)?"', e: '"', i: "\\n", c: [e.BE] }, - { b: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/ }, - { b: "'\\\\?.", e: "'", i: "." }, - ], - }, - a = { - cN: "number", - v: [ - { b: "\\b(0b[01']+)" }, - { b: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" }, - { b: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" }, - ], - r: 0, - }, - n = { - cN: "meta", - b: /#\s*[a-z]+\b/, - e: /$/, - k: { "meta-keyword": "if else elif endif define undef warning error line pragma ifdef ifndef include" }, - c: [ - { b: /\\\n/, r: 0 }, - e.inherit(r, { cN: "meta-string" }), - { cN: "meta-string", b: /<[^\n>]*>/, e: /$/, i: "\\n" }, - e.CLCM, - e.CBCM, - ], - }, - i = e.IR + "\\s*\\(", - s = { - keyword: - "int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not", - built_in: - "std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr", - literal: "true false nullptr NULL", - }, - c = [t, e.CLCM, e.CBCM, a, r]; - return { - aliases: ["c", "cc", "h", "c++", "h++", "hpp", "hh", "hxx", "cxx"], - k: s, - i: "", - k: s, - c: ["self", t], - }, - { b: e.IR + "::", k: s }, - { - v: [ - { b: /=/, e: /;/ }, - { b: /\(/, e: /\)/ }, - { bK: "new throw return else", e: /;/ }, - ], - k: s, - c: c.concat([{ b: /\(/, e: /\)/, k: s, c: c.concat(["self"]), r: 0 }]), - r: 0, - }, - { - cN: "function", - b: "(" + e.IR + "[\\*&\\s]+)+" + i, - rB: !0, - e: /[{;=]/, - eE: !0, - k: s, - i: /[^\w\s\*&]/, - c: [ - { b: i, rB: !0, c: [e.TM], r: 0 }, - { - cN: "params", - b: /\(/, - e: /\)/, - k: s, - r: 0, - c: [e.CLCM, e.CBCM, r, a, t, { b: /\(/, e: /\)/, k: s, r: 0, c: ["self", e.CLCM, e.CBCM, r, a, t] }], - }, - e.CLCM, - e.CBCM, - n, - ], - }, - { cN: "class", bK: "class struct", e: /[{;:]/, c: [{ b: //, c: ["self"] }, e.TM] }, - ]), - exports: { preprocessor: n, strings: r, k: s }, - }; - }), - n.registerLanguage("cs", function (e) { - var t = { - keyword: - "abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield", - literal: "null false true", - }, - r = { - cN: "number", - v: [ - { b: "\\b(0b[01']+)" }, - { b: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" }, - { b: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" }, - ], - r: 0, - }, - a = { cN: "string", b: '@"', e: '"', c: [{ b: '""' }] }, - n = e.inherit(a, { i: /\n/ }), - i = { cN: "subst", b: "{", e: "}", k: t }, - s = e.inherit(i, { i: /\n/ }), - c = { cN: "string", b: /\$"/, e: '"', i: /\n/, c: [{ b: "{{" }, { b: "}}" }, e.BE, s] }, - o = { cN: "string", b: /\$@"/, e: '"', c: [{ b: "{{" }, { b: "}}" }, { b: '""' }, i] }, - l = e.inherit(o, { i: /\n/, c: [{ b: "{{" }, { b: "}}" }, { b: '""' }, s] }); - (i.c = [o, c, a, e.ASM, e.QSM, r, e.CBCM]), (s.c = [l, c, n, e.ASM, e.QSM, r, e.inherit(e.CBCM, { i: /\n/ })]); - var u = { v: [o, c, a, e.ASM, e.QSM] }, - d = e.IR + "(<" + e.IR + "(\\s*,\\s*" + e.IR + ")*>)?(\\[\\])?"; - return { - aliases: ["csharp", "c#"], - k: t, - i: /::/, - c: [ - e.C("///", "$", { - rB: !0, - c: [{ cN: "doctag", v: [{ b: "///", r: 0 }, { b: "\x3c!--|--\x3e" }, { b: "" }] }], - }), - e.CLCM, - e.CBCM, - { - cN: "meta", - b: "#", - e: "$", - k: { - "meta-keyword": "if else elif endif define undef warning error line region endregion pragma checksum", - }, - }, - u, - r, - { bK: "class interface", e: /[{;=]/, i: /[^\s:,]/, c: [e.TM, e.CLCM, e.CBCM] }, - { - bK: "namespace", - e: /[{;=]/, - i: /[^\s:]/, - c: [e.inherit(e.TM, { b: "[a-zA-Z](\\.?\\w)*" }), e.CLCM, e.CBCM], - }, - { cN: "meta", b: "^\\s*\\[", eB: !0, e: "\\]", eE: !0, c: [{ cN: "meta-string", b: /"/, e: /"/ }] }, - { bK: "new return throw await else", r: 0 }, - { - cN: "function", - b: "(" + d + "\\s+)+" + e.IR + "\\s*\\(", - rB: !0, - e: /\s*[{;=]/, - eE: !0, - k: t, - c: [ - { b: e.IR + "\\s*\\(", rB: !0, c: [e.TM], r: 0 }, - { cN: "params", b: /\(/, e: /\)/, eB: !0, eE: !0, k: t, r: 0, c: [u, r, e.CBCM] }, - e.CLCM, - e.CBCM, - ], - }, - ], - }; - }), - n.registerLanguage("css", function (e) { - var t = { - b: /[A-Z\_\.\-]+\s*:/, - rB: !0, - e: ";", - eW: !0, - c: [ - { - cN: "attribute", - b: /\S/, - e: ":", - eE: !0, - starts: { - eW: !0, - eE: !0, - c: [ - { - b: /[\w-]+\(/, - rB: !0, - c: [ - { cN: "built_in", b: /[\w-]+/ }, - { b: /\(/, e: /\)/, c: [e.ASM, e.QSM] }, - ], - }, - e.CSSNM, - e.QSM, - e.ASM, - e.CBCM, - { cN: "number", b: "#[0-9A-Fa-f]+" }, - { cN: "meta", b: "!important" }, - ], - }, - }, - ], - }; - return { - cI: !0, - i: /[=\/|'\$]/, - c: [ - e.CBCM, - { cN: "selector-id", b: /#[A-Za-z0-9_-]+/ }, - { cN: "selector-class", b: /\.[A-Za-z0-9_-]+/ }, - { cN: "selector-attr", b: /\[/, e: /\]/, i: "$" }, - { cN: "selector-pseudo", b: /:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/ }, - { b: "@(font-face|page)", l: "[a-z-]+", k: "font-face page" }, - { - b: "@", - e: "[{;]", - i: /:/, - c: [ - { cN: "keyword", b: /\w+/ }, - { b: /\s/, eW: !0, eE: !0, r: 0, c: [e.ASM, e.QSM, e.CSSNM] }, - ], - }, - { cN: "selector-tag", b: "[a-zA-Z-][a-zA-Z0-9_-]*", r: 0 }, - { b: "{", e: "}", i: /\S/, c: [e.CBCM, t] }, - ], - }; - }), - n.registerLanguage("diff", function (e) { - return { - aliases: ["patch"], - c: [ - { - cN: "meta", - r: 10, - v: [ - { b: /^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/ }, - { b: /^\*\*\* +\d+,\d+ +\*\*\*\*$/ }, - { b: /^\-\-\- +\d+,\d+ +\-\-\-\-$/ }, - ], - }, - { - cN: "comment", - v: [ - { b: /Index: /, e: /$/ }, - { b: /={3,}/, e: /$/ }, - { b: /^\-{3}/, e: /$/ }, - { b: /^\*{3} /, e: /$/ }, - { b: /^\+{3}/, e: /$/ }, - { b: /\*{5}/, e: /\*{5}$/ }, - ], - }, - { cN: "addition", b: "^\\+", e: "$" }, - { cN: "deletion", b: "^\\-", e: "$" }, - { cN: "addition", b: "^\\!", e: "$" }, - ], - }; - }), - n.registerLanguage("http", function (e) { - var t = "HTTP/[0-9\\.]+"; - return { - aliases: ["https"], - i: "\\S", - c: [ - { b: "^" + t, e: "$", c: [{ cN: "number", b: "\\b\\d{3}\\b" }] }, - { - b: "^[A-Z]+ (.*?) " + t + "$", - rB: !0, - e: "$", - c: [{ cN: "string", b: " ", e: " ", eB: !0, eE: !0 }, { b: t }, { cN: "keyword", b: "[A-Z]+" }], - }, - { cN: "attribute", b: "^\\w", e: ": ", eE: !0, i: "\\n|\\s|=", starts: { e: "$", r: 0 } }, - { b: "\\n\\n", starts: { sL: [], eW: !0 } }, - ], - }; - }), - n.registerLanguage("ini", function (e) { - var t = { - cN: "string", - c: [e.BE], - v: [ - { b: "'''", e: "'''", r: 10 }, - { b: '"""', e: '"""', r: 10 }, - { b: '"', e: '"' }, - { b: "'", e: "'" }, - ], - }; - return { - aliases: ["toml"], - cI: !0, - i: /\S/, - c: [ - e.C(";", "$"), - e.HCM, - { cN: "section", b: /^\s*\[+/, e: /\]+/ }, - { - b: /^[a-z0-9\[\]_\.-]+\s*=\s*/, - e: "$", - rB: !0, - c: [ - { cN: "attr", b: /[a-z0-9\[\]_\.-]+/ }, - { - b: /=/, - eW: !0, - r: 0, - c: [ - e.C(";", "$"), - e.HCM, - { cN: "literal", b: /\bon|off|true|false|yes|no\b/ }, - { cN: "variable", v: [{ b: /\$[\w\d"][\w\d_]*/ }, { b: /\$\{(.*?)}/ }] }, - t, - { cN: "number", b: /([\+\-]+)?[\d]+_[\d_]+/ }, - e.NM, - ], - }, - ], - }, - ], - }; - }), - n.registerLanguage("java", function (e) { - var t = - "false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do", - r = { - cN: "number", - b: "\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?", - r: 0, - }; - return { - aliases: ["jsp"], - k: t, - i: /<\/|#/, - c: [ - e.C("/\\*\\*", "\\*/", { - r: 0, - c: [ - { b: /\w+@/, r: 0 }, - { cN: "doctag", b: "@[A-Za-z]+" }, - ], - }), - e.CLCM, - e.CBCM, - e.ASM, - e.QSM, - { - cN: "class", - bK: "class interface", - e: /[{;=]/, - eE: !0, - k: "class interface", - i: /[:"\[\]]/, - c: [{ bK: "extends implements" }, e.UTM], - }, - { bK: "new throw return else", r: 0 }, - { - cN: "function", - b: - "([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+" + - e.UIR + - "\\s*\\(", - rB: !0, - e: /[{;=]/, - eE: !0, - k: t, - c: [ - { b: e.UIR + "\\s*\\(", rB: !0, r: 0, c: [e.UTM] }, - { cN: "params", b: /\(/, e: /\)/, k: t, r: 0, c: [e.ASM, e.QSM, e.CNM, e.CBCM] }, - e.CLCM, - e.CBCM, - ], - }, - r, - { cN: "meta", b: "@[A-Za-z]+" }, - ], - }; - }), - n.registerLanguage("javascript", function (e) { - var t = "[A-Za-z$_][0-9A-Za-z$_]*", - r = { - keyword: - "in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as", - literal: "true false null undefined NaN Infinity", - built_in: - "eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise", - }, - a = { cN: "number", v: [{ b: "\\b(0[bB][01]+)" }, { b: "\\b(0[oO][0-7]+)" }, { b: e.CNR }], r: 0 }, - n = { cN: "subst", b: "\\$\\{", e: "\\}", k: r, c: [] }, - i = { cN: "string", b: "`", e: "`", c: [e.BE, n] }; - n.c = [e.ASM, e.QSM, i, a, e.RM]; - var s = n.c.concat([e.CBCM, e.CLCM]); - return { - aliases: ["js", "jsx"], - k: r, - c: [ - { cN: "meta", r: 10, b: /^\s*['"]use (strict|asm)['"]/ }, - { cN: "meta", b: /^#!/, e: /$/ }, - e.ASM, - e.QSM, - i, - e.CLCM, - e.CBCM, - a, - { b: /[{,]\s*/, r: 0, c: [{ b: t + "\\s*:", rB: !0, r: 0, c: [{ cN: "attr", b: t, r: 0 }] }] }, - { - b: "(" + e.RSR + "|\\b(case|return|throw)\\b)\\s*", - k: "return throw case", - c: [ - e.CLCM, - e.CBCM, - e.RM, - { - cN: "function", - b: "(\\(.*?\\)|" + t + ")\\s*=>", - rB: !0, - e: "\\s*=>", - c: [ - { cN: "params", v: [{ b: t }, { b: /\(\s*\)/ }, { b: /\(/, e: /\)/, eB: !0, eE: !0, k: r, c: s }] }, - ], - }, - { cN: "", b: /\s/, e: /\s*/, skip: !0 }, - { - b: //, - sL: "xml", - c: [ - { b: /<[A-Za-z0-9\\._:-]+\s*\/>/, skip: !0 }, - { - b: /<[A-Za-z0-9\\._:-]+/, - e: /(\/[A-Za-z0-9\\._:-]+|[A-Za-z0-9\\._:-]+\/)>/, - skip: !0, - c: [{ b: /<[A-Za-z0-9\\._:-]+\s*\/>/, skip: !0 }, "self"], - }, - ], - }, - ], - r: 0, - }, - { - cN: "function", - bK: "function", - e: /\{/, - eE: !0, - c: [e.inherit(e.TM, { b: t }), { cN: "params", b: /\(/, e: /\)/, eB: !0, eE: !0, c: s }], - i: /\[|%/, - }, - { b: /\$[(.]/ }, - e.METHOD_GUARD, - { cN: "class", bK: "class", e: /[{;=]/, eE: !0, i: /[:"\[\]]/, c: [{ bK: "extends" }, e.UTM] }, - { bK: "constructor get set", e: /\{/, eE: !0 }, - ], - i: /#(?!!)/, - }; - }), - n.registerLanguage("json", function (e) { - var t = { literal: "true false null" }, - r = [e.QSM, e.CNM], - a = { e: ",", eW: !0, eE: !0, c: r, k: t }, - n = { - b: "{", - e: "}", - c: [{ cN: "attr", b: /"/, e: /"/, c: [e.BE], i: "\\n" }, e.inherit(a, { b: /:/ })], - i: "\\S", - }, - i = { b: "\\[", e: "\\]", c: [e.inherit(a)], i: "\\S" }; - return r.splice(r.length, 0, n, i), { c: r, k: t, i: "\\S" }; - }), - n.registerLanguage("makefile", function (e) { - var t = { cN: "variable", v: [{ b: "\\$\\(" + e.UIR + "\\)", c: [e.BE] }, { b: /\$[@%`]+/ }] }], - }, - ], - }; - return { - aliases: ["html", "xhtml", "rss", "atom", "xjb", "xsd", "xsl", "plist"], - cI: !0, - c: [ - { cN: "meta", b: "", r: 10, c: [{ b: "\\[", e: "\\]" }] }, - e.C("\x3c!--", "--\x3e", { r: 10 }), - { b: "<\\!\\[CDATA\\[", e: "\\]\\]>", r: 10 }, - { cN: "meta", b: /<\?xml/, e: /\?>/, r: 10 }, - { - b: /<\?(php)?/, - e: /\?>/, - sL: "php", - c: [ - { b: "/\\*", e: "\\*/", skip: !0 }, - { b: 'b"', e: '"', skip: !0 }, - { b: "b'", e: "'", skip: !0 }, - e.inherit(e.ASM, { i: null, cN: null, c: null, skip: !0 }), - e.inherit(e.QSM, { i: null, cN: null, c: null, skip: !0 }), - ], - }, - { - cN: "tag", - b: "|$)", - e: ">", - k: { name: "style" }, - c: [t], - starts: { e: "", rE: !0, sL: ["css", "xml"] }, - }, - { - cN: "tag", - b: "|$)", - e: ">", - k: { name: "script" }, - c: [t], - starts: { e: "", rE: !0, sL: ["actionscript", "javascript", "handlebars", "xml"] }, - }, - { cN: "tag", b: "", c: [{ cN: "name", b: /[^\/><\s]+/, r: 0 }, t] }, - ], - }; - }), - n.registerLanguage("markdown", function (e) { - return { - aliases: ["md", "mkdown", "mkd"], - c: [ - { cN: "section", v: [{ b: "^#{1,6}", e: "$" }, { b: "^.+?\\n[=-]{2,}$" }] }, - { b: "<", e: ">", sL: "xml", r: 0 }, - { cN: "bullet", b: "^\\s*([*+-]|(\\d+\\.))\\s+" }, - { cN: "strong", b: "[*_]{2}.+?[*_]{2}" }, - { cN: "emphasis", v: [{ b: "\\*.+?\\*" }, { b: "_.+?_", r: 0 }] }, - { cN: "quote", b: "^>\\s+", e: "$" }, - { cN: "code", v: [{ b: "^```w*s*$", e: "^```s*$" }, { b: "`.+?`" }, { b: "^( {4}|\t)", e: "$", r: 0 }] }, - { b: "^[-\\*]{3,}", e: "$" }, - { - b: "\\[.+?\\][\\(\\[].*?[\\)\\]]", - rB: !0, - c: [ - { cN: "string", b: "\\[", e: "\\]", eB: !0, rE: !0, r: 0 }, - { cN: "link", b: "\\]\\(", e: "\\)", eB: !0, eE: !0 }, - { cN: "symbol", b: "\\]\\[", e: "\\]", eB: !0, eE: !0 }, - ], - r: 10, - }, - { - b: /^\[[^\n]+\]:/, - rB: !0, - c: [ - { cN: "symbol", b: /\[/, e: /\]/, eB: !0, eE: !0 }, - { cN: "link", b: /:\s*/, e: /$/, eB: !0 }, - ], - }, - ], - }; - }), - n.registerLanguage("nginx", function (e) { - var t = { cN: "variable", v: [{ b: /\$\d+/ }, { b: /\$\{/, e: /}/ }, { b: "[\\$\\@]" + e.UIR }] }, - r = { - eW: !0, - l: "[a-z/_]+", - k: { - literal: - "on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll", - }, - r: 0, - i: "=>", - c: [ - e.HCM, - { - cN: "string", - c: [e.BE, t], - v: [ - { b: /"/, e: /"/ }, - { b: /'/, e: /'/ }, - ], - }, - { b: "([a-z]+):/", e: "\\s", eW: !0, eE: !0, c: [t] }, - { - cN: "regexp", - c: [e.BE, t], - v: [ - { b: "\\s\\^", e: "\\s|{|;", rE: !0 }, - { b: "~\\*?\\s+", e: "\\s|{|;", rE: !0 }, - { b: "\\*(\\.[a-z\\-]+)+" }, - { b: "([a-z\\-]+\\.)+\\*" }, - ], - }, - { cN: "number", b: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b" }, - { cN: "number", b: "\\b\\d+[kKmMgGdshdwy]*\\b", r: 0 }, - t, - ], - }; - return { - aliases: ["nginxconf"], - c: [ - e.HCM, - { b: e.UIR + "\\s+{", rB: !0, e: "{", c: [{ cN: "section", b: e.UIR }], r: 0 }, - { b: e.UIR + "\\s", e: ";|{", rB: !0, c: [{ cN: "attribute", b: e.UIR, starts: r }], r: 0 }, - ], - i: "[^\\s\\}]", - }; - }), - n.registerLanguage("objectivec", function (e) { - var t = /[a-zA-Z@][a-zA-Z0-9_]*/, - r = "@interface @class @protocol @implementation"; - return { - aliases: ["mm", "objc", "obj-c"], - k: { - keyword: - "int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN", - literal: "false true FALSE TRUE nil YES NO NULL", - built_in: "BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once", - }, - l: t, - i: "" }, - ], - }, - ], - }, - { cN: "class", b: "(" + r.split(" ").join("|") + ")\\b", e: "({|$)", eE: !0, k: r, l: t, c: [e.UTM] }, - { b: "\\." + e.UIR, r: 0 }, - ], - }; - }), - n.registerLanguage("perl", function (e) { - var t = - "getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when", - r = { cN: "subst", b: "[$@]\\{", e: "\\}", k: t }, - a = { b: "->{", e: "}" }, - n = { - v: [{ b: /\$\d/ }, { b: /[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/ }, { b: /[\$%@][^\s\w{]/, r: 0 }], - }, - i = [e.BE, r, n], - s = [ - n, - e.HCM, - e.C("^\\=\\w", "\\=cut", { eW: !0 }), - a, - { - cN: "string", - c: i, - v: [ - { b: "q[qwxr]?\\s*\\(", e: "\\)", r: 5 }, - { b: "q[qwxr]?\\s*\\[", e: "\\]", r: 5 }, - { b: "q[qwxr]?\\s*\\{", e: "\\}", r: 5 }, - { b: "q[qwxr]?\\s*\\|", e: "\\|", r: 5 }, - { b: "q[qwxr]?\\s*\\<", e: "\\>", r: 5 }, - { b: "qw\\s+q", e: "q", r: 5 }, - { b: "'", e: "'", c: [e.BE] }, - { b: '"', e: '"' }, - { b: "`", e: "`", c: [e.BE] }, - { b: "{\\w+}", c: [], r: 0 }, - { b: "-?\\w+\\s*\\=\\>", c: [], r: 0 }, - ], - }, - { cN: "number", b: "(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", r: 0 }, - { - b: "(\\/\\/|" + e.RSR + "|\\b(split|return|print|reverse|grep)\\b)\\s*", - k: "split return print reverse grep", - r: 0, - c: [ - e.HCM, - { cN: "regexp", b: "(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*", r: 10 }, - { cN: "regexp", b: "(m|qr)?/", e: "/[a-z]*", c: [e.BE], r: 0 }, - ], - }, - { cN: "function", bK: "sub", e: "(\\s*\\(.*?\\))?[;{]", eE: !0, r: 5, c: [e.TM] }, - { b: "-\\w\\b", r: 0 }, - { b: "^__DATA__$", e: "^__END__$", sL: "mojolicious", c: [{ b: "^@@.*", e: "$", cN: "comment" }] }, - ]; - return (r.c = s), { aliases: ["pl", "pm"], l: /[\w\.]+/, k: t, c: (a.c = s) }; - }), - n.registerLanguage("php", function (e) { - var t = { b: "\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*" }, - r = { cN: "meta", b: /<\?(php)?|\?>/ }, - a = { - cN: "string", - c: [e.BE, r], - v: [{ b: 'b"', e: '"' }, { b: "b'", e: "'" }, e.inherit(e.ASM, { i: null }), e.inherit(e.QSM, { i: null })], - }, - n = { v: [e.BNM, e.CNM] }; - return { - aliases: ["php", "php3", "php4", "php5", "php6", "php7"], - cI: !0, - k: "and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally", - c: [ - e.HCM, - e.C("//", "$", { c: [r] }), - e.C("/\\*", "\\*/", { c: [{ cN: "doctag", b: "@[A-Za-z]+" }] }), - e.C("__halt_compiler.+?;", !1, { eW: !0, k: "__halt_compiler", l: e.UIR }), - { - cN: "string", - b: /<<<['"]?\w+['"]?$/, - e: /^\w+;?$/, - c: [e.BE, { cN: "subst", v: [{ b: /\$\w+/ }, { b: /\{\$/, e: /\}/ }] }], - }, - r, - { cN: "keyword", b: /\$this\b/ }, - t, - { b: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/ }, - { - cN: "function", - bK: "function", - e: /[;{]/, - eE: !0, - i: "\\$|\\[|%", - c: [e.UTM, { cN: "params", b: "\\(", e: "\\)", c: ["self", t, e.CBCM, a, n] }], - }, - { - cN: "class", - bK: "class interface", - e: "{", - eE: !0, - i: /[:\(\$"]/, - c: [{ bK: "extends implements" }, e.UTM], - }, - { bK: "namespace", e: ";", i: /[\.']/, c: [e.UTM] }, - { bK: "use", e: ";", c: [e.UTM] }, - { b: "=>" }, - a, - n, - ], - }; - }), - n.registerLanguage("properties", function (e) { - var t = "[ \\t\\f]*", - r = "(" + t + "[:=]" + t + "|[ \\t\\f]+)", - a = "([^\\\\\\W:= \\t\\f\\n]|\\\\.)+", - n = "([^\\\\:= \\t\\f\\n]|\\\\.)+", - i = { e: r, r: 0, starts: { cN: "string", e: /$/, r: 0, c: [{ b: "\\\\\\n" }] } }; - return { - cI: !0, - i: /\S/, - c: [ - e.C("^\\s*[!#]", "$"), - { b: a + r, rB: !0, c: [{ cN: "attr", b: a, endsParent: !0, r: 0 }], starts: i }, - { b: n + r, rB: !0, r: 0, c: [{ cN: "meta", b: n, endsParent: !0, r: 0 }], starts: i }, - { cN: "attr", r: 0, b: n + t + "$" }, - ], - }; - }), - n.registerLanguage("python", function (e) { - var t = { - keyword: - "and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10", - built_in: "Ellipsis NotImplemented", - literal: "False None True", - }, - r = { cN: "meta", b: /^(>>>|\.\.\.) / }, - a = { cN: "subst", b: /\{/, e: /\}/, k: t, i: /#/ }, - n = { - cN: "string", - c: [e.BE], - v: [ - { b: /(u|b)?r?'''/, e: /'''/, c: [e.BE, r], r: 10 }, - { b: /(u|b)?r?"""/, e: /"""/, c: [e.BE, r], r: 10 }, - { b: /(fr|rf|f)'''/, e: /'''/, c: [e.BE, r, a] }, - { b: /(fr|rf|f)"""/, e: /"""/, c: [e.BE, r, a] }, - { b: /(u|r|ur)'/, e: /'/, r: 10 }, - { b: /(u|r|ur)"/, e: /"/, r: 10 }, - { b: /(b|br)'/, e: /'/ }, - { b: /(b|br)"/, e: /"/ }, - { b: /(fr|rf|f)'/, e: /'/, c: [e.BE, a] }, - { b: /(fr|rf|f)"/, e: /"/, c: [e.BE, a] }, - e.ASM, - e.QSM, - ], - }, - i = { - cN: "number", - r: 0, - v: [{ b: e.BNR + "[lLjJ]?" }, { b: "\\b(0o[0-7]+)[lLjJ]?" }, { b: e.CNR + "[lLjJ]?" }], - }, - s = { cN: "params", b: /\(/, e: /\)/, c: ["self", r, i, n] }; - return ( - (a.c = [n, i, r]), - { - aliases: ["py", "gyp", "ipython"], - k: t, - i: /(<\/|->|\?)|=>/, - c: [ - r, - i, - n, - e.HCM, - { - v: [ - { cN: "function", bK: "def" }, - { cN: "class", bK: "class" }, - ], - e: /:/, - i: /[${=;\n,]/, - c: [e.UTM, s, { b: /->/, eW: !0, k: "None" }], - }, - { cN: "meta", b: /^[\t ]*@/, e: /$/ }, - { b: /\b(print|exec)\(/ }, - ], - } - ); - }), - n.registerLanguage("ruby", function (e) { - var t = "[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?", - r = { - keyword: - "and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor", - literal: "true false nil", - }, - a = { cN: "doctag", b: "@[A-Za-z]+" }, - n = { b: "#<", e: ">" }, - i = [e.C("#", "$", { c: [a] }), e.C("^\\=begin", "^\\=end", { c: [a], r: 10 }), e.C("^__END__", "\\n$")], - s = { cN: "subst", b: "#\\{", e: "}", k: r }, - c = { - cN: "string", - c: [e.BE, s], - v: [ - { b: /'/, e: /'/ }, - { b: /"/, e: /"/ }, - { b: /`/, e: /`/ }, - { b: "%[qQwWx]?\\(", e: "\\)" }, - { b: "%[qQwWx]?\\[", e: "\\]" }, - { b: "%[qQwWx]?{", e: "}" }, - { b: "%[qQwWx]?<", e: ">" }, - { b: "%[qQwWx]?/", e: "/" }, - { b: "%[qQwWx]?%", e: "%" }, - { b: "%[qQwWx]?-", e: "-" }, - { b: "%[qQwWx]?\\|", e: "\\|" }, - { b: /\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/ }, - { b: /<<(-?)\w+$/, e: /^\s*\w+$/ }, - ], - }, - o = { cN: "params", b: "\\(", e: "\\)", endsParent: !0, k: r }, - l = [ - c, - n, - { - cN: "class", - bK: "class module", - e: "$|;", - i: /=/, - c: [ - e.inherit(e.TM, { b: "[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?" }), - { b: "<\\s*", c: [{ b: "(" + e.IR + "::)?" + e.IR }] }, - ].concat(i), - }, - { cN: "function", bK: "def", e: "$|;", c: [e.inherit(e.TM, { b: t }), o].concat(i) }, - { b: e.IR + "::" }, - { cN: "symbol", b: e.UIR + "(\\!|\\?)?:", r: 0 }, - { cN: "symbol", b: ":(?!\\s)", c: [c, { b: t }], r: 0 }, - { cN: "number", b: "(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b", r: 0 }, - { b: "(\\$\\W)|((\\$|\\@\\@?)(\\w+))" }, - { cN: "params", b: /\|/, e: /\|/, k: r }, - { - b: "(" + e.RSR + "|unless)\\s*", - k: "unless", - c: [ - n, - { - cN: "regexp", - c: [e.BE, s], - i: /\n/, - v: [ - { b: "/", e: "/[a-z]*" }, - { b: "%r{", e: "}[a-z]*" }, - { b: "%r\\(", e: "\\)[a-z]*" }, - { b: "%r!", e: "![a-z]*" }, - { b: "%r\\[", e: "\\][a-z]*" }, - ], - }, - ].concat(i), - r: 0, - }, - ].concat(i); - s.c = l; - var u = [ - { b: /^\s*=>/, starts: { e: "$", c: (o.c = l) } }, - { - cN: "meta", - b: "^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)", - starts: { e: "$", c: l }, - }, - ]; - return { aliases: ["rb", "gemspec", "podspec", "thor", "irb"], k: r, i: /\/\*/, c: i.concat(u).concat(l) }; - }), - n.registerLanguage("shell", function (e) { - return { - aliases: ["console"], - c: [{ cN: "meta", b: "^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]", starts: { e: "$", sL: "bash" } }], - }; - }), - n.registerLanguage("sql", function (e) { - var t = e.C("--", "$"); - return { - cI: !0, - i: /[<>{}*]/, - c: [ - { - bK: "begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with", - e: /;/, - eW: !0, - l: /[\w\.]+/, - k: { - keyword: - "as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask main main_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek", - literal: "true false null unknown", - built_in: - "array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varying void", - }, - c: [ - { cN: "string", b: "'", e: "'", c: [e.BE, { b: "''" }] }, - { cN: "string", b: '"', e: '"', c: [e.BE, { b: '""' }] }, - { cN: "string", b: "`", e: "`", c: [e.BE] }, - e.CNM, - e.CBCM, - t, - e.HCM, - ], - }, - e.CBCM, - t, - e.HCM, - ], - }; - }), - n - ); -}); diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/DatePickerTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/DatePickerTest.java deleted file mode 100644 index 3b52189509a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/DatePickerTest.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import java.util.Date; - -import com.google.gwt.i18n.client.DateTimeFormat; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.gwtbootstrap3.client.ui.TextBox; -import org.gwtbootstrap3.extras.datepicker.client.ui.base.constants.DatePickerLanguage; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class DatePickerTest { - - @Mock - public org.gwtbootstrap3.extras.datepicker.client.ui.DatePicker datePickerMock; - public DatePicker datePicker; - @Mock - TextBox textBox; - - @Before - public void setup() { - when(datePickerMock.getTextBox()).thenReturn(textBox); - } - - @Test - public void testSetFormat() { - datePicker = new DatePicker(datePickerMock); - String gwtDateFormat = "dd-MMM-yyyy"; - DateTimeFormat gwtDateTimeFormat = DateTimeFormat.getFormat(gwtDateFormat); - - datePicker.setLocaleName("en"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.EN); - verify(datePickerMock).setFormat(DatePickerFormatUtilities.convertToBS3DateFormat(gwtDateFormat)); - - Date now = new Date(); - now = gwtDateTimeFormat.parse(gwtDateTimeFormat.format(now)); - - datePicker.setValue(now); - verify(textBox).setValue(gwtDateTimeFormat.format(now)); - when(textBox.getValue()).thenReturn(gwtDateTimeFormat.format(now)); - assertEquals(now, - datePicker.getValue()); - } - - @Test - public void testSetDatePickerLang() { - datePicker = new DatePicker(datePickerMock); - String gwtDateFormat = "dd-MMM-yyyy"; - - datePicker.setLocaleName("es"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.ES); - - datePicker.setLocaleName("fr"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.FR); - - datePicker.setLocaleName("ja"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.JA); - - datePicker.setLocaleName("pt_BR"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.PT_BR); - - datePicker.setLocaleName("zh_CN"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.ZH_CN); - - datePicker.setLocaleName("de"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.DE); - - datePicker.setLocaleName("zh_TW"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.ZH_TW); - - datePicker.setLocaleName("ru"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.RU); - - datePicker.setLocaleName("en"); - datePicker.setFormat(gwtDateFormat); - verify(datePickerMock).setLanguage(DatePickerLanguage.EN); - } - - @Test - public void testGetLocaleName() { - datePicker = new DatePicker(datePickerMock); - - datePicker.setLocaleName(""); - assertEquals("", - datePicker.getLocaleName()); - - datePicker.setLocaleName(null); - assertEquals("", - datePicker.getLocaleName()); - - datePicker.setLocaleName("default"); - assertEquals("", - datePicker.getLocaleName()); - - String currentLocale = "testValue"; - datePicker.setLocaleName(currentLocale); - assertEquals(currentLocale, - datePicker.getLocaleName()); - } - - @Test - public void testGetDataPickerDate(){ - datePicker = new DatePicker(datePickerMock); - - assertNull(datePicker.getDataPickerDate()); - } - -} - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBoxTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBoxTest.java deleted file mode 100644 index c54388cd705..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/common/NumericIntegerTextBoxTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.common; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.assertj.core.api.Assertions; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; - -@RunWith(GwtMockitoTestRunner.class) -public class NumericIntegerTextBoxTest { - - private NumericIntegerTextBox numericIntegerTextBox; - - @Before - public void setUp() throws Exception { - numericIntegerTextBox = new NumericIntegerTextBox(); - } - - @Test - public void testDefaultValue() { - Assertions.assertThat(numericIntegerTextBox.makeValidValue("")).isEqualTo("0"); - Assertions.assertThat(numericIntegerTextBox.makeValidValue("123")).isEqualTo("0"); - Assertions.assertThat(numericIntegerTextBox.makeValidValue("-123")).isEqualTo("0"); - Assertions.assertThat(numericIntegerTextBox.makeValidValue("abcd")).isEqualTo("0"); - } - - @Test - public void testIsValidValue_ValidValues() { - Assertions.assertThat(numericIntegerTextBox.isValidValue("123", false)).isTrue(); - Assertions.assertThat(numericIntegerTextBox.isValidValue("-123", false)).isTrue(); - } - - @Test - public void testIsValidValue_InvalidValues() { - Assertions.assertThat(numericIntegerTextBox.isValidValue("123.0", false)).isFalse(); - Assertions.assertThat(numericIntegerTextBox.isValidValue("abcd", false)).isFalse(); - Assertions.assertThat(numericIntegerTextBox.isValidValue("!", false)).isFalse(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/AbstractEntryCreationLiveSearchServiceTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/AbstractEntryCreationLiveSearchServiceTest.java deleted file mode 100644 index 27eef301eac..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/AbstractEntryCreationLiveSearchServiceTest.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.stubbing.Answer; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.ParameterizedCommand; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -public abstract class AbstractEntryCreationLiveSearchServiceTest { - - protected static final String VALUE = "value"; - - protected EDITOR editor; - - @Mock - protected EntryCreationLiveSearchService searchService; - - @Mock - protected SingleLiveSearchSelectionHandler searchSelectionHandler; - - @Mock - protected LiveSearchDropDownView view; - - @Mock - private ManagedInstance selectorItems; - - protected LiveSearchDropDown dropDown; - - protected ParameterizedCommand onAddCommand; - - protected Command onCancelCommand; - - @Before - public void init() { - when(selectorItems.get()).thenAnswer((Answer>) invocationOnMock -> mock(LiveSearchSelectorItem.class)); - - editor = mock(getEditorType()); - - when(searchService.getEditor()).thenReturn(editor); - - dropDown = spy(new LiveSearchDropDown(view, selectorItems)); - } - - @Test - public void testEditorAddNewEntryAction() { - - startTest(); - - LiveSearchEntry entry = new LiveSearchEntry<>(VALUE, VALUE); - - onAddCommand.execute(entry); - - verify(dropDown).addNewItem(entry); - verify(searchSelectionHandler).selectItem(any()); - verify(dropDown).search(any()); - verify(dropDown).doSearch(any()); - verify(view).searchInProgress(any()); - verify(searchService).search(anyString(), anyInt(), any()); - verify(view).restoreFooter(); - } - - protected void startTest() { - dropDown.init(searchService, searchSelectionHandler); - - verify(view).setNewInstanceEnabled(true); - - ArgumentCaptor onAddCommandCaptor = ArgumentCaptor.forClass(ParameterizedCommand.class); - ArgumentCaptor onCancelCommandCaptor = ArgumentCaptor.forClass(Command.class); - - verify(editor).init(onAddCommandCaptor.capture(), onCancelCommandCaptor.capture()); - - onAddCommand = onAddCommandCaptor.getValue(); - - onCancelCommand = onCancelCommandCaptor.getValue(); - - assertNotNull(onAddCommand); - assertNotNull(onCancelCommand); - - dropDown.showNewItem(); - } - - abstract Class getEditorType(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/InlineEntryCreationLiveSearchServiceTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/InlineEntryCreationLiveSearchServiceTest.java deleted file mode 100644 index d5711d8fd84..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/InlineEntryCreationLiveSearchServiceTest.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class InlineEntryCreationLiveSearchServiceTest extends AbstractEntryCreationLiveSearchServiceTest { - - @Test - public void testInlineEditorCancelAction() { - startTest(); - - onCancelCommand.execute(); - - verify(dropDown, never()).addNewItem(any()); - verify(view).restoreFooter(); - } - - @Override - protected void startTest() { - super.startTest(); - - verify(view).showNewItemEditor(editor); - } - - @Override - protected Class getEditorType() { - return InlineCreationEditor.class; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownTest.java deleted file mode 100644 index f2b95575472..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/LiveSearchDropDownTest.java +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.ArgumentCaptor; -import org.mockito.Mock; -import org.mockito.Spy; -import org.mockito.stubbing.Answer; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyInt; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class LiveSearchDropDownTest { - - @Mock - LiveSearchDropDownView view; - - @Mock - LiveSearchCallback searchCallback; - - @Spy - LiveSearchService searchService = new LiveSearchService() { - - @Override - public void search(String pattern, - int maxResults, - LiveSearchCallback callback) { - LiveSearchResults results = new LiveSearchResults(); - switch (pattern) { - case "a": - results.add("1", "a"); - break; - case "b": - results.add("1", "a"); - results.add("2", "b"); - results.add("3", "c"); - break; - } - - callback.afterSearch(results); - } - - @Override - public void searchEntry(String key, LiveSearchCallback callback) { - LiveSearchResults results = new LiveSearchResults(); - switch (key) { - case "1": - results.add("1", "a"); - break; - case "2": - results.add("2", "b"); - break; - } - - callback.afterSearch(results); - } - }; - - @Spy - SingleLiveSearchSelectionHandler selectionHandler = new SingleLiveSearchSelectionHandler<>(); - - @Mock - Command onChangeCommand; - - @Mock - ClickEvent clickEvent; - - LiveSearchDropDown presenter; - - @Mock - ManagedInstance> selectorItems; - - @Before - public void setUp() { - - when(selectorItems.get()).thenAnswer((Answer>) invocationOnMock -> { - final LiveSearchSelectorItem result = mock(LiveSearchSelectorItem.class); - - doAnswer((Answer) invocationOnMock1 -> { - String key = (String) invocationOnMock1.getArguments()[0]; - String value = (String) invocationOnMock1.getArguments()[1]; - - when(result.getKey()).thenReturn(key); - when(result.getValue()).thenReturn(value); - return null; - }).when(result).init(any(), any()); - - return result; - }); - - presenter = spy(new LiveSearchDropDown(view, selectorItems)); - presenter.setOnChange(onChangeCommand); - presenter.init(searchService, selectionHandler); - - doAnswer(invocationOnMock -> { - ClickEvent event = (ClickEvent) invocationOnMock.getArguments()[0]; - event.stopPropagation(); - return null; - }).when(view).onSearchClick(any()); - } - - @Test - public void testInit() { - presenter.setWidth(200); - presenter.setMaxItems(10); - presenter.setSearchHint("a"); - presenter.setSelectorHint("b"); - - assertEquals(presenter.getMaxItems(), - 10); - - verify(view).setWidth(200); - verify(view).setSearchHint("a"); - verify(view).setDropDownText("b"); - } - - @Test - public void testClear() { - presenter.clear(); - - assertNull(presenter.getLastSearch()); - verify(view).clearItems(); - verify(view).clearSearch(); - } - - @Test - public void testSearch() { - presenter.search("a"); - - assertEquals(presenter.getLastSearch(), - "a"); - - verify(view).clearItems(); - verify(view).addItem(any()); - verify(view).searchFinished(); - - verify(searchService).search(eq("a"), - anyInt(), - any()); - } - - @Test - public void testEmptySearch() { - presenter.setSearchHint("s"); - presenter.setNotFoundMessage("n"); - presenter.setMaxItems(15); - presenter.search(""); - - assertEquals(presenter.getLastSearch(), - ""); - - verify(view).searchInProgress("s"); - verify(view).clearItems(); - verify(view).noItems("n"); - verify(view).searchFinished(); - - verify(searchService).search(eq(""), - eq(15), - any()); - } - - @Test - public void testRepeatedSearch() { - presenter.search("a"); - presenter.search("a"); // 2nd search is ignored as it's a repetition - - verify(view).clearItems(); - verify(view).addItem(any()); - verify(view).searchFinished(); - - verify(searchService).search(eq("a"), - anyInt(), - any()); - } - - @Test - public void testSearchCache() { - presenter.search("a"); - presenter.search(""); - presenter.search("a"); - presenter.search(""); - presenter.search("a"); - presenter.search(""); - - assertTrue(presenter.isSearchCacheEnabled()); - assertEquals(presenter.getLastSearch(), - ""); - - verify(view, - times(2)).searchInProgress(any()); - verify(searchService).search(eq("a"), - anyInt(), - any()); - verify(searchService).search(eq(""), - anyInt(), - any()); - verify(view, - times(2)).searchFinished(); - - verify(view, - times(6)).clearItems(); - verify(view, - times(3)).addItem(any()); - verify(view, - times(3)).noItems(any()); - } - - @Test - public void testSearchCacheDisabled() { - presenter.setSearchCacheEnabled(false); - - presenter.search("a"); - presenter.search(""); - presenter.search("a"); - presenter.search(""); - presenter.search("a"); - presenter.search(""); - - assertFalse(presenter.isSearchCacheEnabled()); - assertEquals(presenter.getLastSearch(), - ""); - - verify(view, - times(6)).searchInProgress(any()); - verify(searchService, - times(3)).search(eq("a"), - anyInt(), - any()); - verify(searchService, - times(3)).search(eq(""), - anyInt(), - any()); - verify(view, - times(6)).searchFinished(); - - verify(view, - times(6)).clearItems(); - verify(view, - times(3)).addItem(any()); - verify(view, - times(3)).noItems(any()); - } - - @Test - public void testItemsOrdered() { - presenter.search("b"); - - ArgumentCaptor resultsCaptor = ArgumentCaptor.forClass(LiveSearchResults.class); - verify(presenter).showResults(resultsCaptor.capture()); - - LiveSearchResults results = resultsCaptor.getValue(); - assertEquals(results.size(), - 3); - assertEquals(results.get(0).getValue(), - "a"); - assertEquals(results.get(1).getValue(), - "b"); - assertEquals(results.get(2).getValue(), - "c"); - } - - @Test - public void testItemSelected() { - - doAnswer(invocationOnMock -> { - LiveSearchResults results = new LiveSearchResults(1); - results.add("1", "a"); - LiveSearchCallback callback = (LiveSearchCallback) invocationOnMock.getArguments()[1]; - callback.afterSearch(results); - - return null; - }).when(searchService).searchEntry(anyString(), any()); - - presenter.setSelectedItem("1"); - - assertEquals("1", selectionHandler.getSelectedKey()); - verify(view).setDropDownText("a"); - verify(onChangeCommand, never()).execute(); - } - - @Test - public void testOnClickSearchInput() { - view.onSearchClick(clickEvent); - - verify(clickEvent).stopPropagation(); - } -} - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/ModalEntryCreationLiveSearchServiceTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/ModalEntryCreationLiveSearchServiceTest.java deleted file mode 100644 index b787173de44..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/ModalEntryCreationLiveSearchServiceTest.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class ModalEntryCreationLiveSearchServiceTest extends AbstractEntryCreationLiveSearchServiceTest { - - @Test - public void testInlineEditorCancelAction() { - - startTest(); - - onCancelCommand.execute(); - - verify(dropDown, never()).addNewItem(any()); - verify(view, never()).restoreFooter(); - } - - @Override - protected Class getEditorType() { - return ModalCreationEditor.class; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandlerTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandlerTest.java deleted file mode 100644 index 7c2bb667ae6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/MultipleLiveSearchSelectionHandlerTest.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown; - -import com.google.gwtmockito.GwtMockito; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Spy; -import org.uberfire.ext.widgets.common.client.resources.i18n.CommonConstants; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class MultipleLiveSearchSelectionHandlerTest { - - private String SELECTED_ITEM_TEXT = "selectedItem"; - - - @Mock - private Command callback; - - @Spy - private MultipleLiveSearchSelectionHandler handler; - -// @GwtMock - private CommonConstants constants; - - @Before - public void init() { - GwtMockito.initMocks(this); - System.out.println(CommonConstants.INSTANCE.liveSearchElementsSelected(2)); - handler.setLiveSearchSelectionCallback(callback); - } - - @Test - public void testRegisterItemWithoutSelectedValue() { - LiveSearchSelectorItem item = createItem("any"); - - handler.registerItem(item); - - verify(item, never()).select(); - verify(item, times(1)).setSelectionCallback(any()); - verify(item, times(1)).setMultipleSelection(true); - - checkHandlerSelectedValue(null); - - assertEquals(null, handler.getDropDownMenuHeader()); - } - - @Test - public void testRegisterIItemWithSelectedValue() { - LiveSearchSelectorItem selectedItem = doTestSelectItem(); - - LiveSearchSelectorItem secondItem = createItem(SELECTED_ITEM_TEXT); - - handler.registerItem(secondItem); - - verify(selectedItem, atLeast(1)).getKey(); - verify(secondItem, times(2)).getKey(); - verify(secondItem).select(); - - checkHandlerSelectedValue(SELECTED_ITEM_TEXT); - - assertEquals(SELECTED_ITEM_TEXT, handler.getDropDownMenuHeader()); - } - - @Test - public void testSelectItem() { - doTestSelectItem(); - - assertEquals(1, handler.getSelectedValues().size()); - - assertEquals(SELECTED_ITEM_TEXT, handler.getDropDownMenuHeader()); - } - - @Test - public void testSelectMultipleItems() { - - // Setting max title elements to 3 - handler.setMaxDropDownTextItems(3); - - // Register Items - LiveSearchSelectorItem firstItem = createItem("a"); - handler.registerItem(firstItem); - LiveSearchSelectorItem secondItem = createItem("b"); - handler.registerItem(secondItem); - LiveSearchSelectorItem thirdItem = createItem("c"); - handler.registerItem(thirdItem); - LiveSearchSelectorItem fourthItem = createItem("d"); - handler.registerItem(fourthItem); - - // Selecting values - - // Selecting "a" - handler.selectKey("a"); - verify(handler, times(1)).selectItem(firstItem); - verify(firstItem).select(); - verify(callback).execute(); - checkHandlerSelectedValue("a"); - assertEquals(1, handler.getSelectedValues().size()); - assertEquals("a", handler.getDropDownMenuHeader()); - - // Selecting "a" & "b" - handler.selectKey("b"); - verify(handler, times(1)).selectItem(secondItem); - verify(secondItem).select(); - verify(callback, times(2)).execute(); - checkHandlerSelectedValue("b"); - assertEquals(2, handler.getSelectedValues().size()); - assertEquals("a & b", handler.getDropDownMenuHeader()); - - // Selecting "a", "b" & "c" - handler.selectKey("c"); - verify(handler, times(1)).selectItem(thirdItem); - verify(thirdItem).select(); - verify(callback, times(3)).execute(); - checkHandlerSelectedValue("c"); - assertEquals(3, handler.getSelectedValues().size()); - assertEquals("a, b & c", handler.getDropDownMenuHeader()); - - // Selectiong "a", "b", "c" & "d" - handler.selectKey("d"); - verify(handler, times(1)).selectItem(fourthItem); - verify(fourthItem).select(); - verify(callback, times(4)).execute(); - checkHandlerSelectedValue("d"); - assertEquals(4, handler.getSelectedValues().size()); - assertEquals("liveSearchElementsSelected(4)", handler.getDropDownMenuHeader()); - - // Deselecting values - - // Deselect "a" - handler.selectKey("a"); - verify(handler, times(2)).selectItem(firstItem); - verify(firstItem).reset(); - verify(callback, times(5)).execute(); - assertEquals(3, handler.getSelectedValues().size()); - assertEquals("b, c & d", handler.getDropDownMenuHeader()); - - // Deselect "b" - handler.selectKey("b"); - verify(handler, times(2)).selectItem(secondItem); - verify(secondItem).reset(); - verify(callback, times(6)).execute(); - assertEquals(2, handler.getSelectedValues().size()); - assertEquals("c & d", handler.getDropDownMenuHeader()); - - // Deselect "c" - handler.selectKey("c"); - verify(handler, times(2)).selectItem(thirdItem); - verify(thirdItem).reset(); - verify(callback, times(7)).execute(); - assertEquals(1, handler.getSelectedValues().size()); - assertEquals("d", handler.getDropDownMenuHeader()); - - // Deselect "d" - handler.selectKey("d"); - verify(handler, times(2)).selectItem(fourthItem); - verify(fourthItem).reset(); - verify(callback, times(8)).execute(); - assertEquals(0, handler.getSelectedValues().size()); - assertEquals(null, handler.getDropDownMenuHeader()); - } - - @Test - public void testClearSelection() { - // Register Items - LiveSearchSelectorItem firstItem = createItem("a"); - handler.registerItem(firstItem); - LiveSearchSelectorItem secondItem = createItem("b"); - handler.registerItem(secondItem); - LiveSearchSelectorItem thirdItem = createItem("c"); - handler.registerItem(thirdItem); - LiveSearchSelectorItem fourthItem = createItem("d"); - handler.registerItem(fourthItem); - - handler.selectKey("a"); - handler.selectKey("b"); - handler.selectKey("c"); - handler.selectKey("d"); - - assertEquals(4, handler.getSelectedValues().size()); - assertEquals("a, b, c & d", handler.getDropDownMenuHeader()); - - handler.clearSelection(); - - assertEquals(0, handler.getSelectedValues().size()); - assertEquals(null, handler.getDropDownMenuHeader()); - } - - protected LiveSearchSelectorItem doTestSelectItem() { - LiveSearchSelectorItem item = createItem(SELECTED_ITEM_TEXT); - - handler.registerItem(item); - - handler.selectItem(item); - - verify(item).select(); - - checkHandlerSelectedValue(SELECTED_ITEM_TEXT); - - assertEquals(SELECTED_ITEM_TEXT, handler.getDropDownMenuHeader()); - - verify(callback).execute(); - - return item; - } - - private LiveSearchSelectorItem createItem(String value) { - LiveSearchSelectorItem item = mock(LiveSearchSelectorItem.class); - - when(item.getKey()).thenReturn(value); - when(item.getValue()).thenReturn(value); - - return item; - } - - private void checkHandlerSelectedValue(String value) { - if (value != null) { - assertTrue(handler.getSelectedValues().contains(value)); - } else { - assertTrue(handler.getSelectedValues().isEmpty()); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDownTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDownTest.java deleted file mode 100644 index 72067fb29da..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/PerspectiveDropDownTest.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import org.jboss.errai.ioc.client.container.SyncBeanDef; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.uberfire.client.mvp.ActivityBeansCache; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class PerspectiveDropDownTest { - - @Mock - ActivityBeansCache activityBeansCache; - - @Mock - LiveSearchDropDown liveSearchDropDown; - - PerspectiveDropDown perspectiveDropDown; - - @Before - public void setUp() { - perspectiveDropDown = new PerspectiveDropDown(activityBeansCache, liveSearchDropDown); - - SyncBeanDef mock1 = mock(SyncBeanDef.class); - when(mock1.getName()).thenReturn("A"); - - SyncBeanDef mock2 = mock(SyncBeanDef.class); - when(mock2.getName()).thenReturn("B"); - - when(activityBeansCache.getPerspectiveActivities()).thenReturn(Arrays.asList(mock1, mock2)); - } - - @Test - public void testSearchAll() { - perspectiveDropDown.searchService.search("", -1, itemList -> { - assertEquals(itemList.size(), 2); - }); - } - - @Test - public void testSearchItem() { - perspectiveDropDown.searchService.search("A", -1, itemList -> { - assertEquals(itemList.size(), 1); - }); - perspectiveDropDown.searchService.search("a", -1, itemList -> { - assertEquals(itemList.size(), 1); - }); - } - - @Test - public void testSearchEmpty() { - perspectiveDropDown.searchService.search("x", -1, itemList -> { - assertEquals(itemList.size(), 0); - }); - } - - @Test - public void testExcludeItems() { - Set excluded = new HashSet<>(); - excluded.add("A"); - perspectiveDropDown.setPerspectiveIdsExcluded(excluded); - perspectiveDropDown.searchService.search("", -1, itemList -> { - assertEquals(itemList.size(), 1); - assertEquals(itemList.get(0).getKey(), "B"); - }); - } - - @Test - public void testCustomNames() { - perspectiveDropDown.setPerspectiveNameProvider(itemId -> "x"); - perspectiveDropDown.searchService.search("A", -1, itemList -> { - assertEquals(itemList.size(), 0); - }); - perspectiveDropDown.searchService.search("x", -1, itemList -> { - assertEquals(itemList.size(), 2); - }); - } -} - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandlerTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandlerTest.java deleted file mode 100644 index 2be343abe31..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/SingleLiveSearchSelectionHandlerTest.java +++ /dev/null @@ -1,163 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Spy; -import org.mockito.junit.MockitoJUnitRunner; -import org.uberfire.mvp.Command; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.atLeast; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class SingleLiveSearchSelectionHandlerTest { - - private String SELECTED_ITEM_TEXT = "selectedItem"; - - @Spy - private SingleLiveSearchSelectionHandler handler = new SingleLiveSearchSelectionHandler(); - - @Mock - private Command callback; - - @Before - public void init() { - handler.setLiveSearchSelectionCallback(callback); - } - - @Test - public void testRegisterItemWithoutSelectedValue() { - LiveSearchSelectorItem item = createItem("any"); - - handler.registerItem(item); - - verify(item, never()).select(); - verify(item, times(1)).setSelectionCallback(any()); - - checkHandlerSelectedValue(null); - } - - @Test - public void testRegisterIItemWithSelectedValue() { - LiveSearchSelectorItem selectedItem = doTestSelectItem(); - - LiveSearchSelectorItem secondItem = createItem(SELECTED_ITEM_TEXT); - - handler.registerItem(secondItem); - - verify(selectedItem, atLeast(1)).getKey(); - verify(secondItem).getKey(); - verify(secondItem).select(); - } - - @Test - public void testSelectItem() { - doTestSelectItem(); - } - - protected LiveSearchSelectorItem doTestSelectItem() { - LiveSearchSelectorItem item = createItem(SELECTED_ITEM_TEXT); - - handler.registerItem(item); - - handler.selectItem(item); - - verify(item).select(); - - checkHandlerSelectedValue(SELECTED_ITEM_TEXT); - - verify(callback).execute(); - - return item; - } - - @Test - public void testSelectSecondItem() { - LiveSearchSelectorItem firstItem = doTestSelectItem(); - - String secondSelected = SELECTED_ITEM_TEXT + "2"; - - LiveSearchSelectorItem secondItem = createItem(secondSelected); - - handler.registerItem(secondItem); - - handler.selectItem(secondItem); - - verify(secondItem).select(); - verify(firstItem).reset(); - - checkHandlerSelectedValue(secondSelected); - } - - @Test - public void testSelectKeyWithoutSelectedValue() { - - LiveSearchSelectorItem firstItem = createItem("a"); - - handler.registerItem(firstItem); - - LiveSearchSelectorItem secondItem = createItem("b"); - - handler.registerItem(secondItem); - - LiveSearchSelectorItem thirdItem = createItem(SELECTED_ITEM_TEXT); - - handler.registerItem(thirdItem); - - handler.selectKey("a"); - - verify(handler).selectItem(firstItem); - verify(firstItem).select(); - - checkHandlerSelectedValue("a"); - - handler.selectKey("b"); - - verify(handler).selectItem(secondItem); - verify(secondItem).select(); - verify(firstItem).reset(); - - checkHandlerSelectedValue("b"); - - handler.selectKey(SELECTED_ITEM_TEXT); - verify(handler).selectItem(thirdItem); - verify(thirdItem).select(); - verify(secondItem).reset(); - - checkHandlerSelectedValue(SELECTED_ITEM_TEXT); - } - - @Test - public void testClearSelection() { - LiveSearchSelectorItem item = doTestSelectItem(); - - handler.clearSelection(); - - verify(item).reset(); - - checkHandlerSelectedValue(null); - } - - private LiveSearchSelectorItem createItem(String value) { - LiveSearchSelectorItem item = mock(LiveSearchSelectorItem.class); - - when(item.getKey()).thenReturn(value); - when(item.getValue()).thenReturn(value); - - return item; - } - - private void checkHandlerSelectedValue(String value) { - assertEquals(value, handler.getSelectedKey()); - assertEquals(value, handler.getSelectedValue()); - assertEquals(value, handler.getDropDownMenuHeader()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterTest.java deleted file mode 100644 index 52eb901b56b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/footer/LiveSearchFooterTest.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.dropdown.footer; - -import org.jboss.errai.common.client.dom.HTMLElement; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.uberfire.ext.widgets.common.client.dropdown.InlineCreationEditor; -import org.uberfire.mvp.Command; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class LiveSearchFooterTest { - - private static final String NEW_LABEL = "new"; - private static final String RESET_LABEL = "reset"; - - @Mock - private HTMLElement editorElement; - - @Mock - private InlineCreationEditor editor; - - @Mock - private LiveSearchFooterView view; - - @Mock - private Command onNewEntry; - - @Mock - private Command onReset; - - private LiveSearchFooter footer; - - @Before - public void init() { - when(editor.getElement()).thenReturn(editorElement); - - footer = new LiveSearchFooter(view); - - footer.init(onNewEntry, onReset); - } - - @Test - public void testFunctionallity() { - - verify(view).init(footer); - - footer.getElement(); - verify(view).getElement(); - - footer.setNewEntryLabel(NEW_LABEL); - verify(view).setNewEntryLabel(NEW_LABEL); - - footer.setResetLabel(RESET_LABEL); - verify(view).setResetLabel(RESET_LABEL); - - footer.showReset(true); - verify(view).showReset(true); - - footer.showAddNewEntry(true); - verify(view).showAddNewEntry(true); - - footer.restore(); - verify(view).restore(); - - footer.showEditor(editor); - verify(view).show(editorElement); - - footer.onResetPressed(); - verify(onReset).execute(); - - footer.onNewEntryPressed(); - verify(onNewEntry).execute(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentTest.java deleted file mode 100644 index e1115623bd2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/dropdown/noItems/NoItemsComponentTest.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.uberfire.ext.widgets.common.client.dropdown.noItems; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class NoItemsComponentTest { - - private static final String MESSAGE = "a message"; - - @Mock - private NoItemsComponentView view; - - private NoItemsComponent component; - - @Test - public void testFunctionality() { - component = new NoItemsComponent(view); - - component.getElement(); - verify(view).getElement(); - - component.show(); - verify(view).show(); - - component.hide(); - verify(view).hide(); - - component.setMessage(MESSAGE); - verify(view).setMessage(MESSAGE); - - component.setMessage(null); - verify(view, times(2)).setMessage(anyString()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectComponentTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectComponentTest.java deleted file mode 100644 index 945af404cd0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectComponentTest.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.function.Consumer; - -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; - -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.atLeastOnce; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class SelectComponentTest { - - @Mock - private SelectComponent.View view; - - @Mock - private ManagedInstance selectOptionComponents; - private SelectComponent component; - private SelectOption option1; - - @Mock - private Consumer callback; - - @Mock - private SelectOptionComponent selectOptionComponent; - - @Before - public void setUp() { - - option1 = new SelectOptionImpl("FIRST", - "first"); - - component = spy(new SelectComponent(view, - selectOptionComponents)); - - when(this.selectOptionComponents.get()).thenReturn(this.selectOptionComponent); - - component.init(); - } - - @Test - public void testSetup() { - component.setup(Arrays.asList(option1), - callback); - verify(selectOptionComponent).initialize(eq(option1), - any()); - } - - @Test - public void testEmptySelectOptions() { - component.setup(Arrays.asList(), - callback); - verify(selectOptionComponent, - never()).initialize(eq(option1), - any()); - } - - @Test - public void testSelectOption() { - - List> consumer = new ArrayList(); - - doAnswer(invocation -> { - consumer.add((Consumer) invocation.getArguments()[1]); - return null; - }).when(this.selectOptionComponent).initialize(any(), - any()); - - doAnswer(invocation -> { - consumer.get(0).accept(option1); - return null; - }).when(selectOptionComponent).select(); - - component.setup(Arrays.asList(option1), - callback); - selectOptionComponent.select(); - - verify(this.component, - times(1)).deactivateAll(); - - verify(this.callback, - times(1)).accept(option1); - - verify(selectOptionComponent, - times(1)).activate(); - - verify(view, - atLeastOnce()).setSelected(eq(this.option1.getName())); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponentTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponentTest.java deleted file mode 100644 index 7055d1549e3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/select/SelectOptionComponentTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.ext.widgets.common.client.select; - -import java.util.function.Consumer; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; - -import static org.mockito.Mockito.eq; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(MockitoJUnitRunner.class) -public class SelectOptionComponentTest { - - @Mock - private SelectOptionComponent.View view; - - @Mock - private Consumer callback; - - private SelectOptionComponent component; - - private SelectOptionImpl option; - - @Before - public void setUp() { - this.option = new SelectOptionImpl("OPTION", - "Option"); - - component = new SelectOptionComponent(this.view); - component.initialize(option, - callback); - } - - @Test - public void testSelectOption() { - this.component.select(); - verify(this.callback, - times(1)).accept(eq(this.option)); - } - - @Test - public void testActivate() { - this.component.activate(); - verify(this.view, - times(1)).setActive(true); - } - - @Test - public void testDeactivate() { - this.component.deactivate(); - verify(this.view, - times(1)).setActive(false); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/ColumnPickerTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/ColumnPickerTest.java deleted file mode 100644 index f31c05cc0af..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/ColumnPickerTest.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright 2019 JBoss Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gwt.cell.client.TextCell; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; -import com.google.gwt.user.cellview.client.TextHeader; -import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwtmockito.GwtMock; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.gwt.DataGrid; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; -import org.uberfire.ext.widgets.table.client.ColumnMeta; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@SuppressWarnings("unchecked") -@RunWith(GwtMockitoTestRunner.class) -public class ColumnPickerTest { - - @InjectMocks - ColumnPicker columnPicker; - - @GwtMock - DataGrid dataGrid; - - @GwtMock - Button toggleButton; - - @GwtMock - PopupPanel popup; - - ClickHandler clickHandler; - - @Before - public void setUp() throws Exception { - final List columns = new ArrayList(); - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - columns.add((Column) invocationOnMock.getArguments()[0]); - return null; - } - }).when(dataGrid).addColumn(any(Column.class), any(Header.class)); - - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - columns.add((Column) invocationOnMock.getArguments()[1]); - return null; - } - }).when(dataGrid).insertColumn(any(int.class), - any(Column.class), - any(Header.class)); - - doAnswer(new Answer() { - @Override - public Integer answer(InvocationOnMock invocationOnMock) throws Throwable { - return columns.size(); - } - }).when(dataGrid).getColumnCount(); - - doAnswer(new Answer() { - @Override - public Void answer(InvocationOnMock invocationOnMock) throws Throwable { - columns.remove(0); - return null; - } - }).when(dataGrid).removeColumn(0); - - when(toggleButton.addClickHandler(any(ClickHandler.class))).thenAnswer(new Answer() { - public Object answer(InvocationOnMock aInvocation) throws Throwable { - clickHandler = (ClickHandler) aInvocation.getArguments()[0]; - return null; - } - }); - } - - @Test - public void testAddRemoveColumn() { - final Column column = mock(Column.class); - when(column.getDataStoreName()).thenReturn("id"); - final ColumnMeta meta = new ColumnMeta(column, "caption"); - meta.setHeader(new TextHeader("header")); - - columnPicker.addColumn(meta); - - assertTrue(columnPicker.getColumnMetaList().contains(meta)); - verify(dataGrid).insertColumn(0, column, meta.getHeader()); - assertEquals(1, dataGrid.getColumnCount()); - - columnPicker.removeColumn(meta); - - assertFalse(columnPicker.getColumnMetaList().contains(meta)); - verify(dataGrid).removeColumn(0); - assertEquals(0, dataGrid.getColumnCount()); - } - - - @Test - public void testSortColumn() { - final Column column1 = mock(Column.class); - final ColumnMeta meta1 = new ColumnMeta(column1, "caption1", true, 1); - meta1.setHeader(new TextHeader("header1")); - final Column column0 = mock(Column.class); - final ColumnMeta meta0 = new ColumnMeta(column0, "caption0", true, 0); - meta0.setHeader(new TextHeader("header0")); - - columnPicker.addColumns(Arrays.asList(meta1, meta0)); - - assertEquals(2, columnPicker.getColumnMetaList().size()); - verify(dataGrid).insertColumn(0, column0, meta0.getHeader()); - verify(dataGrid).insertColumn(1, column1, meta1.getHeader()); - assertEquals(2, dataGrid.getColumnCount()); - } - - @Test - public void testToggleButton() { - columnPicker.createToggleButton(); - clickHandler.onClick(new ClickEvent() { - }); - - verify(popup).show(); - - when(toggleButton.isActive()).thenReturn(true); - - clickHandler.onClick(new ClickEvent() { - }); - - verify(popup).hide(false); - } - - @Test - public void testAdjustColumnWidths() { - final Column column1 = createColumn("col1", "col1"); - final ColumnMeta meta1 = new ColumnMeta(column1, "caption1", true, 1); - meta1.setHeader(new TextHeader("header1")); - final Column column2 = createColumn("col2", "col2"); - final ColumnMeta meta2 = new ColumnMeta(column2, "caption2", true, 0); - meta2.setHeader(new TextHeader("header2")); - final Column column3 = createColumn("col3", "col3"); - final ColumnMeta meta3 = new ColumnMeta(column3, "caption3", true, 0); - meta3.setHeader(new TextHeader("header3")); - - when(dataGrid.getColumnWidth(column1)).thenReturn("35px"); - when(dataGrid.getColumnWidth(column2)).thenReturn(null); - when(dataGrid.getColumnWidth(column3)).thenReturn(null); - - List columnMetasList = new ArrayList(); - columnMetasList.add(meta1); - columnMetasList.add(meta2); - columnMetasList.add(meta3); - columnPicker.addColumns(columnMetasList); - } - - private Column createColumn(String value, - String dataStoreName) { - - Column testColumn = new Column(new TextCell()) { - @Override - public String getValue(String object) { - return value; - } - }; - testColumn.setSortable(true); - testColumn.setDataStoreName(dataStoreName); - return testColumn; - } - -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/PagedTableTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/PagedTableTest.java deleted file mode 100644 index c7c666860d1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/PagedTableTest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.client.Element; -import com.google.gwt.view.client.AsyncDataProvider; -import com.google.gwtmockito.GwtMock; -import com.google.gwtmockito.GwtMockitoTestRunner; -import com.google.gwtmockito.WithClassesToStub; -import org.gwtbootstrap3.client.ui.Image; -import org.gwtbootstrap3.client.ui.Label; -import org.gwtbootstrap3.client.ui.html.Text; -import org.gwtbootstrap3.extras.select.client.ui.Select; -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.ArgumentMatchers.anyString; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.uberfire.ext.widgets.common.client.tables.PagedTable.DEFAULT_PAGE_SIZE; - -@RunWith(GwtMockitoTestRunner.class) -@WithClassesToStub({Image.class, Label.class, Text.class}) -public class PagedTableTest { - - @GwtMock - AsyncDataProvider dataProvider; - - @GwtMock - Select select; - - @Test - public void testSetDataProvider() throws Exception { - PagedTable pagedTable = new PagedTable(); - - pagedTable.setDataProvider(dataProvider); - verify(dataProvider).addDataDisplay(pagedTable); - } - - @Test - public void testDataGridHeight() throws Exception { - final int PAGE_SIZE = 10; - final int ROWS = 2; - final int EXPECTED_HEIGHT_PX = PagedTable.HEIGHT_OFFSET_PX; - PagedTable pagedTable = new PagedTable(PAGE_SIZE, null, false, false, false); - pagedTable.dataGrid = spy(pagedTable.dataGrid); - when(pagedTable.dataGrid.getRowCount()).thenReturn(ROWS); - - verify(pagedTable.dataGrid, times(0)).setHeight(anyString()); - pagedTable.loadPageSizePreferences(); - verify(pagedTable.dataGrid, times(1)).setHeight(eq(EXPECTED_HEIGHT_PX + "px")); - } - - @Test - public void testDataGridHeightWithMoreItemsThanPaging() throws Exception { - final int PAGE_SIZE = 10; - final int ROWS = 12; - final int EXPECTED_HEIGHT_PX = PagedTable.HEIGHT_OFFSET_PX; - var pagedTable = new PagedTable(PAGE_SIZE, null, false, false, false); - pagedTable.dataGrid = spy(pagedTable.dataGrid); - when(pagedTable.dataGrid.getRowCount()).thenReturn(ROWS); - - verify(pagedTable.dataGrid, times(0)).setHeight(anyString()); - pagedTable.loadPageSizePreferences(); - verify(pagedTable.dataGrid, times(1)).setHeight(eq(EXPECTED_HEIGHT_PX + "px")); - } - - @Test - public void testLoadPageSizePreferencesResetsPageStart() throws Exception { - final int PAGE_SIZE = 10; - - PagedTable pagedTable = new PagedTable(PAGE_SIZE); - pagedTable.dataGrid = spy(pagedTable.dataGrid); - - verify(pagedTable.dataGrid, times(0)).setPageStart(0); - - pagedTable.loadPageSizePreferences(); - verify(pagedTable.dataGrid, times(1)).setPageStart(0); - } - - @Test - public void testPageSizeSelectStartValue() throws Exception { - final int size = 10; - - new PagedTable(size); - - verify(select).setValue(String.valueOf(size)); - verify(select).addValueChangeHandler(any()); - } - - @Test - public void testDefaultPageSizeValue() throws Exception { - new PagedTable(); - - verify(select).setValue(String.valueOf(DEFAULT_PAGE_SIZE)); - verify(select).addValueChangeHandler(any()); - } - - @Test - public void testDataGridMinWidthNotSetByDefault() throws Exception { - final int PAGE_SIZE = 10; - Element mockElement = mock(Element.class); - final int minWidth = 800; - PagedTable pagedTable = new PagedTable(PAGE_SIZE, null, false, false, false); - ColumnPicker columnPickerMock = mock(ColumnPicker.class); - - when(pagedTable.dataGridContainer.getElement()).thenReturn(mockElement); - when(columnPickerMock.getDataGridMinWidth()).thenReturn(minWidth); - - pagedTable.setColumnPicker(columnPickerMock); - pagedTable.setTableHeight(); - - verify(mockElement, never()).setAttribute(eq("style"), anyString()); - } - - @Test - public void testEnableDataGridMinWidth() throws Exception { - final int PAGE_SIZE = 10; - Element mockElement = mock(Element.class); - final int minWidth = 800; - PagedTable pagedTable = new PagedTable(PAGE_SIZE, null, false, false, false); - ColumnPicker columnPickerMock = mock(ColumnPicker.class); - - when(pagedTable.dataGridContainer.getElement()).thenReturn(mockElement); - when(columnPickerMock.getDataGridMinWidth()).thenReturn(minWidth); - - pagedTable.setColumnPicker(columnPickerMock); - pagedTable.enableDataGridMinWidth(true); - pagedTable.setTableHeight(); - - verify(columnPickerMock, never()).setDefaultColumnWidthSize(anyInt()); - verify(mockElement).setAttribute("style", "min-width:" + minWidth + Style.Unit.PX.getType()); - } - - @Test - public void testDefaultColumnWidth() throws Exception { - final int PAGE_SIZE = 10; - Element mockElement = mock(Element.class); - final int minWidth = 800; - PagedTable pagedTable = new PagedTable(PAGE_SIZE, null, false, false, false); - ColumnPicker columnPickerMock = mock(ColumnPicker.class); - - when(pagedTable.dataGridContainer.getElement()).thenReturn(mockElement); - when(columnPickerMock.getDataGridMinWidth()).thenReturn(minWidth); - - pagedTable.setColumnPicker(columnPickerMock); - pagedTable.setDefaultColumWidthSize(150); - pagedTable.enableDataGridMinWidth(true); - pagedTable.setTableHeight(); - - verify(columnPickerMock).setDefaultColumnWidthSize(150); - verify(mockElement).setAttribute("style", "min-width:" + minWidth + Style.Unit.PX.getType()); - } - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/SimpleTableTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/SimpleTableTest.java deleted file mode 100644 index 5d70e1cbfc6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/test/java/org/uberfire/ext/widgets/common/client/tables/SimpleTableTest.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.common.client.tables; - -import com.google.gwtmockito.GwtMock; -import com.google.gwtmockito.GwtMockitoTestRunner; -import com.google.gwtmockito.WithClassesToStub; -import org.gwtbootstrap3.client.ui.Image; -import org.gwtbootstrap3.client.ui.Label; -import org.gwtbootstrap3.client.ui.html.Text; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.uberfire.ext.widgets.table.client.DataGrid; - -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -@WithClassesToStub({Image.class, Label.class, Text.class}) -public class SimpleTableTest { - - @GwtMock - DataGrid dataGridMock; - - private SimpleTable simpleTable; - - @Before - public void setupMocks() { - simpleTable = new SimpleTable(); - } - - @Test - public void testRedrawFlush() throws Exception { - this.simpleTable = new SimpleTable(); - - simpleTable.dataGrid = dataGridMock; - simpleTable.redraw(); - verify(dataGridMock).redraw(); - verify(dataGridMock).flush(); - } - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/pom.xml deleted file mode 100644 index 1df591e49f4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-widgets - ${revision} - - - uberfire-widgets-core - pom - - Uberfire Widgets Core - Uberfire Widgets Core - - - uberfire-widgets-core-client - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/pom.xml deleted file mode 100644 index 1d7fdb37a56..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/pom.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-widgets-core - ${revision} - - - uberfire-widgets-core-client - jar - - Uberfire Widgets Core Client - Uberfire Widgets Core Client - - - - org.gwtbootstrap3 - gwtbootstrap3 - - - - org.jboss.errai - errai-common - - - - org.uberfire - uberfire-widgets-commons - - - - org.uberfire - uberfire-api - - - - org.uberfire - uberfire-client-api - - - - org.uberfire - uberfire-commons - - - - org.kie.soup - kie-soup-commons - - - - org.uberfire - uberfire-workbench-client - - - - org.uberfire - uberfire-workbench-processors - - - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - - org.jboss.errai - errai-cdi-client - - - - - org.jboss.errai - errai-ioc - - - - org.jboss.errai - errai-bus - - - - - com.google.gwt - gwt-user - provided - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - commons-logging - commons-logging - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/CoreEntryPoint.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/CoreEntryPoint.java deleted file mode 100644 index c38979da3f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/CoreEntryPoint.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.uberfire.ext.widgets.core.client.resources.TreeNavigatorResources; -import org.uberfire.ext.widgets.core.client.resources.WizardResources; - -/** - * Bootstrap widgets-core - */ -@EntryPoint -public class CoreEntryPoint { - - @PostConstruct - public void startApp() { - //Ensure CSS has been loaded - WizardResources.INSTANCE.css().ensureInjected(); - TreeNavigatorResources.INSTANCE.css().ensureInjected(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreCss.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreCss.java deleted file mode 100644 index 84264a75577..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreCss.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.resources.client.CssResource; - -public interface CoreCss - extends - CssResource { - -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreImages.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreImages.java deleted file mode 100644 index 4b06b6593e6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreImages.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.ImageResource; - -public interface CoreImages - extends - ClientBundle { - - CoreImages INSTANCE = GWT.create(CoreImages.class); - - @Source("images/open_folder.gif") - ImageResource openedFolder(); - - @Source("images/package.gif") - ImageResource packageIcon(); - - @Source("images/file.gif") - ImageResource file(); - - @Source("images/backup_large.png") - ImageResource backupLarge(); - - //A warning triangle - @Source("images/warning-large.png") - ImageResource warningLarge(); - - @Source("images/tick.png") - ImageResource tick(); - - @Source("images/BPM_FileIcons_text.png") - ImageResource typeTextFile(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreResources.java deleted file mode 100644 index 5809fd163d0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/CoreResources.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; - -public interface CoreResources - extends - ClientBundle { - - CoreResources INSTANCE = GWT.create(CoreResources.class); - - CoreImages images(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/TreeNavigatorResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/TreeNavigatorResources.java deleted file mode 100644 index eafc81b5b68..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/TreeNavigatorResources.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.CssResource; - -/** - * Wizard resources - */ -public interface TreeNavigatorResources - extends - ClientBundle { - - public static final TreeNavigatorResources INSTANCE = GWT.create(TreeNavigatorResources.class); - - @Source("css/TreeNavigator.css") - NavigatorStyle css(); - - public interface NavigatorStyle extends CssResource { - - @ClassName("tree") - String tree(); - - @ClassName("tree-folder") - String treeFolder(); - - @ClassName("tree-folder-header") - String treeFolderHeader(); - - @ClassName("tree-folder-name") - String treeFolderName(); - - @ClassName("tree-folder-content") - String treeFolderContent(); - - @ClassName("tree-item") - String treeItem(); - - @ClassName("tree-item-name") - String treeItemName(); - - @ClassName("tree-selected") - String treeSelected(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardCellListResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardCellListResources.java deleted file mode 100644 index e63e5574461..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardCellListResources.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.cellview.client.CellList; - -/** - * Overriding the default styling for CellLists - */ -public interface WizardCellListResources - extends - CellList.Resources { - - WizardCellListResources INSTANCE = GWT.create(WizardCellListResources.class); - - @Source("css/WizardsCellList.css") - WizardCellListStyle cellListStyle(); - - public interface WizardCellListStyle - extends - CellList.Style { - - String cellListEvenItem(); - - String cellListKeyboardSelectedItem(); - - String cellListOddItem(); - - String cellListSelectedItem(); - - String cellListWidget(); - - String cellListEmptyItem(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardResources.java deleted file mode 100644 index e5516122ad5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/WizardResources.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.CssResource; - -/** - * Wizard resources - */ -public interface WizardResources - extends - ClientBundle { - - WizardResources INSTANCE = GWT.create(WizardResources.class); - - @Source("css/Wizards.css") - WizardStyle css(); - - public interface WizardStyle - extends - CssResource { - - String wizardDTableList(); - - String wizardDTableHeader(); - - String wizardDTableButtons(); - - String wizardDTableFields(); - - String wizardDTableMessageContainer(); - - String wizardDTableMessage(); - - String wizardDTableValidationError(); - - String wizardButtonbar(); - - String wizardPageTitleContainer(); - - String wizardPageTitleImageContainer(); - - String wizardPageTitleLabelContainer(); - - String wizardDTableFieldContainerValid(); - - String wizardDTableFieldContainerInvalid(); - - String wizardDTableSummaryContainer(); - - String wizardDTableCaption(); - - String scrollPanel(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.java deleted file mode 100644 index 742d2467047..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.resources.i18n; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.i18n.client.Messages; - -/** - * Core Widgets I18N constants - */ -public interface CoreConstants - extends - Messages { - - CoreConstants INSTANCE = GWT.create(CoreConstants.class); - - String multipleMatchingActivitiesFound(); - - String activityNotFound(); - - String cancel(); - - String Previous(); - - String Next(); - - String Finish(); - - String Delete(); - - String RepositoryViewUriLabel(); - - String RepositoryViewRootLabel(); - - String Downloading(); - - String SelectFileToUpload(); - - String UploadSuccess(); - - String UploadFail(); - - String Uploading(); - - String DefaultEditor(); - - String Download(); - - String FileExplorer(); - - String Navigator(); - - String EmptyEntry(); - - String MetaFileEditor(); - - String CantLoadOrganizationalUnits(); - - String SelectEntry(); - - String URLMandatory(); - - String InvalidUrlFormat(); - - String OrganizationalUnitMandatory(); - - String RepositoryNaneMandatory(); - - String RepositoryNameInvalid(); - - String DoYouAgree(); - - String RepoCloneSuccess(); - - String RepoAlreadyExists(); - - String RepoCloneFail(); - - String Cloning(); - - String IndexClonedRepositoryWarning(); - - String RepoInformation(); - - String IsRequired(); - - String RepoName(); - - String RepoNameHolder(); - - String OrganizationalUnit(); - - String GitUrl(); - - String GitUrlHolder(); - - String UserName(); - - String UserNameHolder(); - - String Password(); - - String PasswordHolder(); - - String Cancel(); - - String Clone(); - - String RepoCreationSuccess(); - - String RepoCreationFail(); - - String Create(); - - String RepositoryEditor(); - - String AvailableProtocols(); - - String Reverting(); - - String GeneralInformation(); - - String CommitHistory(); - - String LoadMore(); - - String TextEditor(); - - String ConfirmStateRevert(); - - String ActivityNotFound(); - - String CloneRepository(); - - String CreateRepository(); - - String Empty(); - - String RevertToThis(); - - String textResourceTypeDescription(); - - String Branches(); - - String Update(); - - String GroupId(); - - String ArtifactId(); - - String Version(); - - String GroupIdHolder(); - - String ArtifactIdHolder(); - - String VersionHolder(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenPresenter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenPresenter.java deleted file mode 100644 index 9b3b41f79f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenPresenter.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.screens.iframe; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchScreen; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -@Dependent -@WorkbenchScreen(identifier = "IFrameScreen") -public class IFrameScreenPresenter { - - @Inject - public IFrameScreenPresenter.View view; - private String title; - - @OnStartup - public void onStartup(final PlaceRequest placeRequest) { - this.view.setURL(placeRequest.getParameter("url", - "none")); - this.title = placeRequest.getParameter("title", - "iframe"); - } - - @WorkbenchPartTitle - public String getTitle() { - return title; - } - - @WorkbenchPartView - public IsWidget getWidget() { - return view; - } - - public interface View extends IsWidget { - - void setURL(final String url); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenView.java deleted file mode 100644 index d96ea241b45..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/screens/iframe/IFrameScreenView.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.screens.iframe; - -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Frame; -import com.google.gwt.user.client.ui.RequiresResize; - -public class IFrameScreenView - extends Composite - implements IFrameScreenPresenter.View, - RequiresResize { - - private final Frame frame = new Frame(); - - public IFrameScreenView() { - initWidget(frame); - } - - @Override - public void setURL(final String url) { - frame.setUrl(url); - } - - @Override - public void onResize() { - int height = getParent().getOffsetHeight(); - int width = getParent().getOffsetWidth(); - frame.setPixelSize(width, - height); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItem.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItem.java deleted file mode 100644 index 921b8643ddd..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItem.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import java.util.function.Supplier; - -import com.google.gwt.user.client.ui.FlowPanel; -import org.gwtbootstrap3.client.ui.Icon; -import org.gwtbootstrap3.client.ui.constants.IconType; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -public class FSTreeItem extends TreeItem { - - private final FSType fstype; - - FSTreeItem(final FSType type, - final String value, - final Supplier contentProvider) { - super(createType(type), - value, - value, - createIcon(type), - contentProvider); - this.fstype = checkNotNull("type", - type); - } - - public FSTreeItem(final FSType type, - final String value) { - super(createType(type), - value, - value, - createIcon(type)); - this.fstype = checkNotNull("type", - type); - } - - private static final Type createType(final FSType type) { - switch (type) { - case ITEM: - return Type.ITEM; - case FOLDER: - return Type.CONTAINER; - } - return Type.ROOT; - } - - private static final Icon createIcon(final FSType type) { - IconType iconType = IconType.FOLDER; - switch (type) { - case ITEM: - iconType = IconType.FILE_O; - break; - case FOLDER: - iconType = IconType.FOLDER; - break; - case ROOT: - iconType = IconType.FOLDER; - break; - } - return new Icon(iconType); - } - - public FSTreeItem addItem(final FSType type, - final String value) { - final FSTreeItem treeItem = new FSTreeItem(type, - value); - super.addItem(treeItem); - return treeItem; - } - - public FSType getFSType() { - return this.fstype; - } - - @Override - protected void onOpenState() { - super.onOpenState(); - getIcon().setType(IconType.FOLDER_OPEN); - } - - @Override - protected void onCloseState() { - super.onCloseState(); - getIcon().setType(IconType.FOLDER); - } - - private Icon getIcon() { - return (Icon) getIconWidget(); - } - - public enum FSType { - ROOT, - FOLDER, - ITEM, - LOADING - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/Tree.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/Tree.java deleted file mode 100644 index dd12f678b6a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/Tree.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import java.util.Iterator; -import java.util.function.Supplier; - -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.logical.shared.HasCloseHandlers; -import com.google.gwt.event.logical.shared.HasOpenHandlers; -import com.google.gwt.event.logical.shared.HasSelectionHandlers; -import com.google.gwt.event.logical.shared.OpenEvent; -import com.google.gwt.event.logical.shared.OpenHandler; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; -import org.uberfire.ext.widgets.core.client.resources.TreeNavigatorResources; - -public class Tree extends Composite implements HasSelectionHandlers, - HasOpenHandlers, - HasCloseHandlers { - - private FlowPanel container; - private T curSelection = null; - - public Tree() { - this(FlowPanel::new); - } - - Tree(final Supplier containerProvider) { - container = containerProvider.get(); - initWidget(container); - container.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().tree()); - } - - @Override - public HandlerRegistration addOpenHandler(final OpenHandler handler) { - return addHandler(handler, - OpenEvent.getType()); - } - - @Override - public HandlerRegistration addCloseHandler(final CloseHandler handler) { - return addHandler(handler, - CloseEvent.getType()); - } - - @Override - public HandlerRegistration addSelectionHandler(final SelectionHandler handler) { - return addHandler(handler, - SelectionEvent.getType()); - } - - public void clear() { - container.clear(); - } - - public void setSelectedItem(final T item, - final boolean fireEvents) { - onSelection(item, - fireEvents); - } - - public T getSelectedItem() { - return curSelection; - } - - public void setSelectedItem(final T item) { - onSelection(item, - true); - } - - @SuppressWarnings("unchecked") - public T addItem(final T item) { - container.add(item); - item.setTree(this); - return item; - } - - @SuppressWarnings("unchecked") - public T getItemByUuid(String uuid) { - final T item[] = (T[]) new TreeItem[1]; - getItems().forEach(i -> { - if (item[0] == null) { - item[0] = (T) i.getItemByUuid(uuid); - } - }); - return item[0]; - } - - public T getItem(int index) { - T item = null; - Iterator itemIter = getItems().iterator(); - int idx = 0; - while (itemIter.hasNext()) { - T treeItem = itemIter.next(); - if (idx == index) { - item = treeItem; - break; - } - idx++; - } - return item; - } - - public void removeItem(final T item) { - container.remove(item); - } - - public Iterable getItems() { - return () -> new T.TreeItemIterator(container); - } - - public boolean isEmpty() { - return container.getWidgetCount() == 0; - } - - void onSelection(final T item, - final boolean fireEvents) { - if (curSelection != null) { - curSelection.setSelected(false); - } - curSelection = item; - if (curSelection != null) { - // Select the item and fire the selection event. - curSelection.setSelected(true); - if (fireEvents) { - SelectionEvent.fire(this, - curSelection); - } - } - } - - void fireStateChanged(final T item, - final T.State state) { - if (state.equals(T.State.OPEN)) { - OpenEvent.fire(this, - item); - } else { - CloseEvent.fire(this, - item); - } - onSelection(item, - true); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/TreeItem.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/TreeItem.java deleted file mode 100644 index 931320ab568..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/tree/TreeItem.java +++ /dev/null @@ -1,509 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import java.util.Iterator; -import java.util.function.Consumer; -import java.util.function.Supplier; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Style; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.client.ui.Anchor; -import com.google.gwt.user.client.ui.ComplexPanel; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.SimplePanel; -import org.uberfire.client.workbench.ouia.OuiaAttribute; -import org.uberfire.client.workbench.ouia.OuiaComponent; -import org.uberfire.client.workbench.ouia.OuiaComponentIdAttribute; -import org.uberfire.client.workbench.ouia.OuiaComponentTypeAttribute; -import org.uberfire.ext.widgets.core.client.resources.TreeNavigatorResources; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -public class TreeItem extends Composite implements OuiaComponent { - - private static final String OUIA_COMPONENT_TYPE = "tree-item"; - - private final Type type; - protected FlowPanel content; - private Tree tree; - private Object userObject; - private I parentItem; - private State state; - private String label; - private String uuid; - private boolean isSelected = false; - private FlowPanel header; - private IsWidget icon; - private FlowPanel item; - - public TreeItem(final Type type, - final String value, - final String label, - final IsWidget icon) { - this(type, - value, - label, - icon, - FlowPanel::new); - } - - TreeItem(final Type type, - final String value, - final String label, - final IsWidget icon, - final Supplier contentProvider - ) { - this.label = label; - this.uuid = value; - this.type = checkNotNull("type", - type); - - if (type.equals(Type.CONTAINER) || type.equals(Type.ROOT)) { - final FlowPanel folder = contentProvider.get(); - folder.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeFolder()); - folder.getElement().getStyle().setDisplay(Style.Display.BLOCK); - { - this.state = State.CLOSE; - this.header = GWT.create(FlowPanel.class); - this.icon = icon; - this.content = contentProvider.get(); - final Anchor name = new Anchor(); - { - header.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeFolderHeader()); - folder.add(header); - { - header.add(icon); - } - final FlowPanel folderName = new FlowPanel(); - { - folderName.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeFolderName()); - header.add(folderName); - { - name.setText(label); - name.setTitle(value); - folderName.add(name); - } - } - header.addDomHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - if (!isSelected) { - updateSelected(); - } - if (state.equals(State.CLOSE)) { - setState(State.OPEN, - true); - } else { - setState(State.CLOSE, - true); - } - } - }, - ClickEvent.getType()); - } - { - content.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeFolderContent()); - content.getElement().getStyle().setDisplay(Style.Display.NONE); - folder.add(content); - } - initWidget(folder); - } - } else if (type.equals(Type.ITEM)) { - this.state = State.NONE; - this.item = contentProvider.get(); - item.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeItem()); - { - this.icon = icon; - final FlowPanel itemName = new FlowPanel(); - final Anchor name = new Anchor(); - { - item.add(icon); - } - { - itemName.setStylePrimaryName(TreeNavigatorResources.INSTANCE.css().treeItemName()); - item.add(itemName); - { - name.setText(label); - name.setTitle(value); - - itemName.add(name); - } - } - item.addDomHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - tree.onSelection((I) TreeItem.this, - true); - } - }, - ClickEvent.getType()); - } - initWidget(item); - } else { - final FlowPanel loader = new FlowPanel(); - { - final SimplePanel loading = new SimplePanel(); - loading.getElement().setInnerText(value); - loader.add(loading); - } - initWidget(loader); - } - initOuiaComponentAttributes(); - } - - @SuppressWarnings("unchecked") - public I getItemByUuid(final String uuid) { - if (getUuid().equals(uuid)) { - return (I) this; - } - final I[] selectedItem = (I[]) new TreeItem[1]; - getChildren().forEach(c -> { - if (selectedItem[0] == null) { - selectedItem[0] = (I) c.getItemByUuid(uuid); - } - }); - return selectedItem[0]; - } - - private void updateSelected() { - tree.onSelection((I) this, - true); - } - - public State getState() { - return state; - } - - public void setState(final State state) { - setState(state, - false, - true); - } - - public void setState(final State state, - boolean fireEvents) { - setState(state, - false, - fireEvents); - } - - public void setState(final State state, - boolean propagateParent, - boolean fireEvents) { - if (notFolder()) { - return; - } - if (!this.state.equals(state)) { - this.state = state; - updateState(state); - if (fireEvents && tree != null) { - tree.fireStateChanged((I) this, - state); - } - } - if (propagateParent && parentItem != null) { - parentItem.setState(state, - true, - false); - } - } - - private boolean notFolder() { - return !type.equals(Type.CONTAINER); - } - - public Object getUserObject() { - return userObject; - } - - public void setUserObject(final Object userObject) { - this.userObject = userObject; - } - - public Type getType() { - return this.type; - } - - public I addItem(final I item) { - return addChild(item, t -> content.add(t)); - } - - public I insertItem(final I item, final int index) { - return addChild(item, t -> content.insert(t, index)); - } - - public I addItem(final Type type, - final String value, - final String label, - final IsWidget icon) { - return addChild(type, - value, - label, - icon, - this::addItem); - } - - public I insertItem(final Type type, - final String value, - final String label, - final IsWidget icon, - final int index) { - return addChild(type, - value, - label, - icon, - t -> insertItem(t, index)); - } - - @SuppressWarnings("unchecked") - private I addChild(final I item, - final Consumer addItemFunction) { - checkContainerType(); - addItemFunction.accept(item); - item.setTree(tree); - item.setParentItem(this); - return item; - } - - private void checkContainerType() { - if (null == content) { - throw new IllegalStateException("This tree item instance is not a container."); - } - } - - @SuppressWarnings("unchecked") - private I addChild(final Type type, - final String value, - final String label, - final IsWidget icon, - final Consumer addItemFunction) { - final I child = makeChild(type, - value, - label, - icon); - addItemFunction.accept(child); - return child; - } - - @SuppressWarnings("unchecked") - private I makeChild(final Type type, - final String value, - final String label, - final IsWidget icon) { - return (I) new TreeItem(type, - value, - label, - icon); - } - - public void removeItems() { - checkContainerType(); - content.clear(); - } - - public int getChildCount() { - return null != content ? content.getWidgetCount() : 0; - } - - @SuppressWarnings("unchecked") - public I getChild(final int i) { - checkContainerType(); - if (i + 1 > content.getWidgetCount()) { - return null; - } - return (I) content.getWidget(i); - } - - public Iterable getChildren() { - return () -> new TreeItemIterator(content); - } - - void setTree(final Tree tree) { - this.tree = tree; - } - - void updateState(final State state) { - // If the tree hasn't been set, there is no visual state to update. - // If the tree is not attached, then update will be called on attach. - if (tree == null) { - return; - } - switch (state) { - case OPEN: - onOpenState(); - break; - case CLOSE: - onCloseState(); - } - } - - protected void onOpenState() { - content.getElement().getStyle().setDisplay(Style.Display.BLOCK); - } - - protected void onCloseState() { - content.getElement().getStyle().setDisplay(Style.Display.NONE); - } - - @SuppressWarnings("unchecked") - public void remove() { - if (parentItem != null) { - // If this item has a parent, remove self from it. - parentItem.removeItem(this); - } else if (tree != null) { - // If the item has no parent, but is in the Tree, it must be a top-level - // element. - tree.removeItem((I) this); - } - } - - public void removeItem(final I treeItem) { - checkContainerType(); - content.remove(treeItem); - } - - public String getText() { - return getElement().getInnerText(); - } - - public String getUuid() { - return uuid; - } - - public String getLabel() { - return label; - } - - public boolean isSelected() { - return isSelected; - } - - void setSelected(boolean selected) { - isSelected = selected; - if (selected) { - if (header != null) { - header.addStyleName(TreeNavigatorResources.INSTANCE.css().treeSelected()); - } else { - item.addStyleName(TreeNavigatorResources.INSTANCE.css().treeSelected()); - } - } else { - if (header != null) { - header.removeStyleName(TreeNavigatorResources.INSTANCE.css().treeSelected()); - } else { - item.removeStyleName(TreeNavigatorResources.INSTANCE.css().treeSelected()); - } - } - } - - public TreeItem getParentItem() { - return parentItem; - } - - void setParentItem(final I parent) { - this.parentItem = parent; - } - - public boolean isEmpty() { - return null == content || content.getWidgetCount() == 0; - } - - IsWidget getIconWidget() { - return icon; - } - - FlowPanel getContent() { - return content; - } - - @Override - public OuiaComponentTypeAttribute ouiaComponentType() { - return new OuiaComponentTypeAttribute(OUIA_COMPONENT_TYPE); - } - - @Override - public OuiaComponentIdAttribute ouiaComponentId() { - return new OuiaComponentIdAttribute(OUIA_COMPONENT_TYPE + "-" + label); - } - - @Override - public Consumer ouiaAttributeRenderer() { - return ouiaAttribute -> getElement().setAttribute(ouiaAttribute.getName(), ouiaAttribute.getValue()); - } - - @Override - public boolean equals(final Object other) { - if (this == other) { - return true; - } - if (!(other instanceof TreeItem)) { - return false; - } - TreeItem that = (TreeItem) other; - return getUuid().equals(that.getUuid()); - } - - @Override - public int hashCode() { - return uuid.hashCode(); - } - - public enum Type { - ROOT, - CONTAINER, - ITEM, - } - - public enum State { - NONE, - OPEN, - CLOSE - } - - protected static class TreeItemIterator implements Iterator { - - private final ComplexPanel container; - private int index = 0; - - TreeItemIterator(ComplexPanel container) { - this.container = container; - } - - @Override - public boolean hasNext() { - if (container == null) { - return false; - } - return index < container.getWidgetCount(); - } - - @Override - @SuppressWarnings("unchecked") - public T next() { - return (T) container.getWidget(index++); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/AbstractWizard.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/AbstractWizard.java deleted file mode 100644 index ae66fdb9b97..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/AbstractWizard.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.enterprise.event.Observes; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.Widget; - -/** - * The generic "Wizard" container, providing a left-hand side list of Page - * titles, buttons to navigate the Wizard pages and a mechanism to display - * different pages of the Wizard. - */ -public abstract class AbstractWizard implements - Wizard { - - @Inject - //The generic view - protected WizardView view; - protected boolean isStarted = false; - - @PostConstruct - public void setup() { - view.init(this); - } - - //Update the status of each belonging to this Wizard - public void onStatusChange(final @Observes WizardPageStatusChangeEvent event) { - //Ignore events until the Wizard has been started - if (!isStarted) { - return; - } - //Ensure event belongs to this Wizard - final List wps = getPages(); - if (!wps.contains(event.getPage())) { - return; - } - - checkPagesState(); - } - - protected void checkPagesState() { - final List wps = getPages(); - for (WizardPage wp : wps) { - final int index = wps.indexOf(wp); - wp.isComplete(result -> view.setPageCompletionState(index, Boolean.TRUE.equals(result))); - } - - //Update the status of this Wizard - isComplete(result -> view.setCompletionStatus(Boolean.TRUE.equals(result))); - } - - public void onPageSelected(final @Observes WizardPageSelectedEvent event) { - //Ignore events until the Wizard has been started - if (!isStarted) { - return; - } - final WizardPage page = event.getSelectedPage(); - final int index = getPages().indexOf(page); - view.selectPage(index); - } - - @Override - public void start() { - //Go, Go gadget Wizard! - isStarted = true; - view.setTitle(getTitle()); - view.setPreferredHeight(getPreferredHeight()); - view.setPreferredWidth(getPreferredWidth()); - view.setPageTitles(getPages()); - - //Ensure Wizard's generic Cancel/Finish buttons are set correctly - checkPagesState(); - - view.selectPage(0); - view.show(); - } - - @Override - public void pageSelected(final int pageNumber) { - final Widget w = getPageWidget(pageNumber); - view.setBodyWidget(w); - } - - @Override - public void close() { - view.hide(); - } - - @Override - public void complete() { - view.hide(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/Wizard.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/Wizard.java deleted file mode 100644 index e7af2ddc5ad..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/Wizard.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.List; -import java.util.function.Consumer; - -import com.google.gwt.user.client.ui.Widget; - -/** - * Things a Wizard needs to implement - */ -public interface Wizard { - - /** - * Start the Wizard - */ - void start(); - - /** - * Provide a list of pages - * @return - */ - List getPages(); - - /** - * Return the widget for a particular page - * @param pageNumber The index of of the page - * @return - */ - Widget getPageWidget(int pageNumber); - - /** - * A page has been selected from the UI - * @param pageNumber - */ - void pageSelected(final int pageNumber); - - /** - * Provide a title - * @return - */ - String getTitle(); - - /** - * The preferred height of the page - * @return - */ - int getPreferredHeight(); - - /** - * The preferred width of the page - * @return - */ - int getPreferredWidth(); - - /** - * Is the Wizard complete; i.e. has all the necessary information for all - * pages in the Wizard been captured. What constitutes necessary data is up to - * the Wizard implementation, but a login page might consider the User ID and - * Password as necessary. - * @param callback True if the page is complete - */ - void isComplete(Consumer callback); - - /** - * The Wizard has been completed - */ - void complete(); - - /** - * The Wizard has been closed - */ - void close(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPage.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPage.java deleted file mode 100644 index 8c8b5cadf7f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPage.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.function.Consumer; - -import com.google.gwt.user.client.ui.IsWidget; - -/** - * A page for a Wizard - */ -public interface WizardPage - extends - IsWidget { - - /** - * Page title - * @return - */ - String getTitle(); - - /** - * Is the page; i.e. has all the necessary information been captured. What - * constitutes necessary data is up to the Wizard implementation, but a login - * page might consider the User ID and Password as necessary. - * @param callback True if the page is complete - */ - void isComplete(Consumer callback); - - /** - * Initialise the page with things that don't change between page visits - */ - void initialise(); - - /** - * Prepare the page before it is displayed with things that can change - * between page visits - */ - void prepareView(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageSelectedEvent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageSelectedEvent.java deleted file mode 100644 index 9ad050e6e50..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageSelectedEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -/** - * An event representing the selection of a page within a Wizard - */ -public class WizardPageSelectedEvent { - - private final WizardPage selectedPage; - - public WizardPageSelectedEvent(final WizardPage selectedPage) { - this.selectedPage = selectedPage; - } - - public WizardPage getSelectedPage() { - return selectedPage; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageStatusChangeEvent.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageStatusChangeEvent.java deleted file mode 100644 index 4c0b48ab62b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageStatusChangeEvent.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -/** - * An event representing the change in status (i.e. completed, not-completed) of a page within a Wizard. - */ -public class WizardPageStatusChangeEvent { - - private final WizardPage page; - - public WizardPageStatusChangeEvent(final WizardPage page) { - this.page = page; - } - - public WizardPage getPage() { - return page; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.java deleted file mode 100644 index 4d17c7c91a9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -import javax.enterprise.context.Dependent; -import javax.enterprise.event.Event; -import javax.inject.Inject; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.AnchorListItem; -import org.gwtbootstrap3.client.ui.constants.IconType; - -/** - * A widget containing the page title of a Wizard page, along with an indicator - * (a tick) that the page has been completed and whether it is the currently - * displayed page (title is made bold). - */ -@Dependent -public class WizardPageTitle extends Composite { - - private static WizardPageTitleViewBinder uiBinder = GWT.create(WizardPageTitleViewBinder.class); - @UiField - protected AnchorListItem container; - - @Inject - private Event selectPageEvent; - - public WizardPageTitle() { - initWidget(uiBinder.createAndBindUi(this)); - } - - public void setContent(final WizardPage page) { - container.setText(page.getTitle()); - page.isComplete(result -> setComplete(Boolean.TRUE.equals(result))); - - container.addDomHandler(new ClickHandler() { - - public void onClick(final ClickEvent event) { - selectPageEvent.fire(new WizardPageSelectedEvent(page)); - } - }, - ClickEvent.getType()); - } - - /** - * Is the page complete - * @param isComplete - */ - public void setComplete(final boolean isComplete) { - container.setIcon(isComplete ? IconType.CHECK_SQUARE_O : IconType.SQUARE_O); - } - - /** - * Is the page the currently displayed page. Note WizardPageTitles are - * unaware of other WizardPageTitles and hence a mediator class needs to - * control the setting of the "current page" and de-selecting other previous - * "current pages". - * @param isSelected - */ - public void setPageSelected(final boolean isSelected) { - container.setActive(isSelected); - } - - interface WizardPageTitleViewBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.ui.xml deleted file mode 100644 index b90f56dc2a2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPageTitle.ui.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.java deleted file mode 100644 index e9a7023a45a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.wizards; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.uibinder.client.UiHandler; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.kie.soup.commons.validation.PortablePreconditions; - -/** - * A Modal Footer used by the Wizard - */ -public class WizardPopupFooter extends ModalFooter { - - private static WizardPopupFooterBinder uiBinder = GWT.create(WizardPopupFooterBinder.class); - - private final Command cmdPreviousButton; - private final Command cmdNextButton; - private final Command cmdCancelButton; - private final Command cmdFinishButton; - @UiField - Button btnPrevious; - @UiField - Button btnNext; - @UiField - Button btnCancel; - @UiField - Button btnFinish; - - public WizardPopupFooter(final Command cmdPreviousButton, - final Command cmdNextButton, - final Command cmdCancelButton, - final Command cmdFinishButton) { - this.cmdPreviousButton = PortablePreconditions.checkNotNull("cmdPreviousButton", - cmdPreviousButton); - this.cmdNextButton = PortablePreconditions.checkNotNull("cmdNextButton", - cmdNextButton); - this.cmdCancelButton = PortablePreconditions.checkNotNull("cmdCancelButton", - cmdCancelButton); - this.cmdFinishButton = PortablePreconditions.checkNotNull("cmdFinishButton", - cmdFinishButton); - add(uiBinder.createAndBindUi(this)); - } - - public void enablePreviousButton(final boolean enabled) { - btnPrevious.setEnabled(enabled); - } - - public void enableNextButton(final boolean enabled) { - btnNext.setEnabled(enabled); - } - - public void enableFinishButton(final boolean enabled) { - btnFinish.setEnabled(enabled); - if (enabled) { - btnFinish.setType(ButtonType.PRIMARY); - } else { - btnFinish.setType(ButtonType.DEFAULT); - } - } - - public void setPreviousButtonFocus(final boolean focused) { - btnPrevious.setFocus(focused); - } - - public void setNextButtonFocus(final boolean focused) { - btnNext.setFocus(focused); - } - - @UiHandler("btnPrevious") - public void onPreviousButtonClick(final ClickEvent e) { - cmdPreviousButton.execute(); - } - - @UiHandler("btnNext") - public void onNextButtonClick(final ClickEvent e) { - cmdNextButton.execute(); - } - - @UiHandler("btnCancel") - public void onCancelButtonClick(final ClickEvent e) { - cmdCancelButton.execute(); - } - - @UiHandler("btnFinish") - public void onFinishButtonClick(final ClickEvent e) { - cmdFinishButton.execute(); - } - - interface WizardPopupFooterBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.ui.xml deleted file mode 100644 index fd0c7a07b77..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardPopupFooter.ui.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardView.java deleted file mode 100644 index 493b1c714e9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardView.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.List; - -import com.google.gwt.user.client.ui.Widget; -import org.uberfire.client.mvp.UberView; - -/** - * View and Presenter definitions for the generic Wizard - */ -public interface WizardView - extends - UberView { - - /** - * Show the Wizard - */ - void show(); - - /** - * The title for the Wizard - * @param title - */ - void setTitle(final String title); - - /** - * The individual page titles - * @param pages - */ - void setPageTitles(final List pages); - - /** - * Select a page - * @param page - */ - void selectPage(final int page); - - /** - * Set the Widget to display in the body panel of the generic Wizard - * @param w - */ - void setBodyWidget(final Widget w); - - /** - * Set the body panel preferred height - * @param height - */ - void setPreferredHeight(final int height); - - /** - * Set the body panel preferred width - * @param width - */ - void setPreferredWidth(final int width); - - /** - * The state (completed, not completed) of a page has changed. - * @param pageIndex - * @param isComplete - */ - void setPageCompletionState(final int pageIndex, - final boolean isComplete); - - /** - * The state (completed, not completed) of the whole Wizard has changed - * @param isComplete - */ - void setCompletionStatus(final boolean isComplete); - - /** - * Hide the Wizard - */ - void hide(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.java deleted file mode 100644 index 5e00dfd0c85..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.ArrayList; -import java.util.List; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Column; -import org.gwtbootstrap3.client.ui.NavPills; -import org.gwtbootstrap3.client.ui.base.modal.ModalDialog; -import org.jboss.errai.ioc.client.container.SyncBeanDef; -import org.jboss.errai.ioc.client.container.SyncBeanManager; -import org.uberfire.ext.widgets.common.client.common.popups.BaseModal; - -/** - * The generic Wizard view implementation - */ -@Dependent -public class WizardViewImpl extends BaseModal - implements - WizardView { - - private static WizardActivityViewImplBinder uiBinder = GWT.create(WizardActivityViewImplBinder.class); - @UiField - protected NavPills sideBar; - - @UiField - protected Column body; - - protected WizardPopupFooter footer; - @Inject - protected SyncBeanManager iocBeanManager; - protected List pageTitleWidgets = new ArrayList<>(); - private int pageNumber; - private int pageNumberTotal; - private AbstractWizard presenter; - - public WizardViewImpl() { - footer = new WizardPopupFooter( - new Command() { - @Override - public void execute() { - if (pageNumber == 0) { - return; - } - selectPage(pageNumber - 1); - footer.setPreviousButtonFocus(false); - } - }, - new Command() { - @Override - public void execute() { - if (pageNumber == pageNumberTotal - 1) { - return; - } - selectPage(pageNumber + 1); - footer.setNextButtonFocus(false); - } - }, - new Command() { - @Override - public void execute() { - presenter.close(); - } - }, - new Command() { - @Override - public void execute() { - presenter.complete(); - } - } - ); - - setBody(uiBinder.createAndBindUi(WizardViewImpl.this)); - - add(footer); - } - - @Override - protected void onUnload() { - parentOnUnload(); - getPresenter().close(); - } - - void parentOnUnload() { - super.onUnload(); - } - - AbstractWizard getPresenter() { - return presenter; - } - - @Override - public void init(final AbstractWizard presenter) { - this.presenter = presenter; - } - - @Override - public void setPageTitles(final List pages) { - //Clear existing titles - releaseWizardPageTitles(); - sideBar.clear(); - - //Add new titles for pages - this.pageNumberTotal = pages.size(); - for (WizardPage page : pages) { - final WizardPageTitle wpt = makeWizardPageTitle(page); - pageTitleWidgets.add(wpt); - sideBar.add(wpt); - } - } - - private void releaseWizardPageTitles() { - for (WizardPageTitle wpt : pageTitleWidgets) { - iocBeanManager.destroyBean(wpt); - } - pageTitleWidgets.clear(); - } - - protected WizardPageTitle makeWizardPageTitle(final WizardPage page) { - final SyncBeanDef beanDefinition = iocBeanManager.lookupBean(WizardPageTitle.class); - final WizardPageTitle bean = beanDefinition.getInstance(); - bean.setContent(page); - return bean; - } - - @Override - public void selectPage(final int pageNumber) { - if (pageNumber < 0 || pageNumber > pageNumberTotal - 1) { - return; - } - this.pageNumber = pageNumber; - for (int i = 0; i < this.pageTitleWidgets.size(); i++) { - final WizardPageTitle wpt = this.pageTitleWidgets.get(i); - wpt.setPageSelected(i == pageNumber); - } - footer.enableNextButton(pageNumber < pageNumberTotal - 1); - footer.enablePreviousButton(pageNumber > 0); - presenter.pageSelected(pageNumber); - } - - @Override - public void setBodyWidget(final Widget w) { - body.clear(); - body.add(w); - } - - @Override - public void setPreferredHeight(final int height) { - if (getWidgetCount() == 1 && getWidget(0) instanceof ModalDialog) { - this.getWidget(0).setHeight(height + "px"); - } - } - - @Override - public void setPreferredWidth(final int width) { - setWidth(width + "px"); - } - - @Override - public void setPageCompletionState(final int pageIndex, - final boolean isComplete) { - final WizardPageTitle wpt = this.pageTitleWidgets.get(pageIndex); - wpt.setComplete(isComplete); - } - - @Override - public void setCompletionStatus(final boolean isComplete) { - footer.enableFinishButton(isComplete); - } - - @Override - public void show() { - super.show(); - } - - @Override - public void hide() { - super.hide(); - releaseWizardPageTitles(); - } - - interface WizardActivityViewImplBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.ui.xml deleted file mode 100644 index c073bbd4f41..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImpl.ui.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenter.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenter.java deleted file mode 100644 index 3db365a8757..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenter.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.workbench.widgets.popups.activities.notfound; - -import javax.enterprise.context.ApplicationScoped; -import javax.inject.Inject; - -import org.uberfire.client.annotations.WorkbenchPartTitle; -import org.uberfire.client.annotations.WorkbenchPartView; -import org.uberfire.client.annotations.WorkbenchPopup; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.mvp.UberView; -import org.uberfire.ext.widgets.core.client.resources.i18n.CoreConstants; -import org.uberfire.lifecycle.OnClose; -import org.uberfire.lifecycle.OnStartup; -import org.uberfire.mvp.PlaceRequest; - -/** - * Popup presenter for when an Activity cannot be found - */ -@ApplicationScoped -@WorkbenchPopup(identifier = "workbench.activity.notfound") -public class ActivityNotFoundPresenter { - - private ActivityNotFoundView view; - - private PlaceManager placeManager; - - @WorkbenchPartTitle - public String getTitle() { - return CoreConstants.INSTANCE.ActivityNotFound(); - } - - @Inject - public ActivityNotFoundPresenter(final ActivityNotFoundView view, final PlaceManager placeManager) { - this.view = view; - this.placeManager = placeManager; - } - - private PlaceRequest place; - - @OnStartup - public void onStartup(final PlaceRequest place) { - this.place = place; - } - - @OnClose - public void onClose() { - final String identifier = place.getParameter("requestedPlaceIdentifier", - null); - if (identifier != null) { - placeManager.forceClosePlace(identifier); - } - } - - @WorkbenchPartView - public UberView getView() { - return view; - } - - public interface View extends UberView { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.java deleted file mode 100644 index 9be8cb6e174..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.core.client.workbench.widgets.popups.activities.notfound; - -import javax.annotation.PostConstruct; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.user.client.ui.SimplePanel; -import com.google.gwt.user.client.ui.Widget; - -/** - * View for when an Activity cannot be found - */ -public class ActivityNotFoundView extends SimplePanel - implements - ActivityNotFoundPresenter.View { - - private ActivityNotFoundPresenter presenter; - - private static ActivityNotFoundViewBinder uiBinder = GWT.create(ActivityNotFoundViewBinder.class); - - @PostConstruct - public void init() { - setWidget(uiBinder.createAndBindUi(this)); - } - - @Override - public void init(final ActivityNotFoundPresenter presenter) { - this.presenter = presenter; - } - - interface ActivityNotFoundViewBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.ui.xml deleted file mode 100644 index 2da072ba50e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundView.ui.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index 68590395344..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/beans.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/beans.xml deleted file mode 100644 index eb795665b4b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/UberfireWidgetsCore.gwt.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/UberfireWidgetsCore.gwt.xml deleted file mode 100644 index 255a7bbcebe..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/UberfireWidgetsCore.gwt.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/TreeNavigator.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/TreeNavigator.css deleted file mode 100644 index 8ae8da91ec6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/TreeNavigator.css +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.tree { - color: #484848; -} - -.tree a { - color: inherit; - text-decoration: none; -} - -.tree .tree-folder { - width: 100%; - min-height: 20px; - margin-top: 1px; - cursor: pointer; -} - -.tree .tree-folder .tree-folder-header { - position: relative; - display: inline-flex; - height: 20px; - width: inherit; - white-space: nowrap; - border-bottom: 1px solid transparent; - border-top: 1px solid transparent; -} - -.tree .tree-folder .tree-folder-header i { - position: relative; - top: 5px; - left: 5px; - float: left; -} - -.tree .tree-folder .tree-folder-header .tree-folder-name { - padding-left: 12px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.tree .tree-folder .tree-folder-content { - margin-left: 23px; -} - -.tree .tree-item { - display: inline-flex; - position: relative; - width: 100%; - height: 20px; - margin: 1px; - cursor: pointer; - white-space: nowrap; - border-bottom: 1px solid transparent; - border-top: 1px solid transparent; -} - -.tree .tree-item:hover, -.tree .tree-folder-header:hover { - background-color: #d4edfa; - border-color: #b3d3e7; -} - -.tree .tree-item .tree-item-name { - position: relative; - left: 10px; - z-index: 1 !important; - display: inline-flex; -} - -.tree .tree-item i { - position: relative; - padding-top: 2px; - padding-left: 5px; -} - -.tree .tree-selected, -.tree .tree-selected:hover, -.tree .tree-selected a { - background-color: #0099d3 !important; - border-color: #0076b7 !important; - color: #ffffff !important; -} - -.tree .tree-item canvas { - margin-top: 2px; - margin-left: 2px; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/Wizards.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/Wizards.css deleted file mode 100644 index 59008409066..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/Wizards.css +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -.wizardDTableList { - border-color: rgb(200, 200, 200); - border-top-style: solid; - border-left-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-width: 1px; - margin: 2px 10px 10px 10px; - padding: 5px; -} - -.wizardDTableHeader { - font-weight: bold; - background-color: rgb(220, 220, 220); - border-color: rgb(200, 200, 200); - border-top-style: solid; - border-left-style: solid; - border-right-style: solid; - border-bottom-style: solid; - border-width: 1px; - margin: 10px 10px 0px 10px; - padding: 2px 5px 2px 5px; -} - -.wizardDTableButtons { - margin-top: 100px; -} - -.wizardDTableButtons td { - margin-bottom: 10px; - width: 48px; - height: 32px; - text-align: center; -} - -.wizardDTableFields { - margin-left: 3px; - margin-right: 3px; -} - -.wizardDTableMessageContainer { - background-color: red; - margin-top: 10px; - padding: 5px; - width: 100%; -} - -.wizardDTableMessage { - margin-left: 10px; - margin-top: 6px; -} - -.wizardDTableValidationError { - color: #b94a48; -} - -.wizardButtonbar { - width: 100%; - background-color: rgb(220, 220, 220); - border-top: 1px solid rgb(200, 200, 200); - border-bottom: 1px solid rgb(200, 200, 200); - padding-top: 5px; - padding-bottom: 5px; -} - -.wizardPageTitleContainer { - margin-top: 2px; - margin-bottom: 2px; - padding-top: 2px; - padding-bottom: 2px; - padding-left: 2px; -} - -.wizardPageTitleContainer:hover { - background-color: #cdcdcd; - cursor: pointer; -} - -.wizardPageTitleImageContainer { - width: 16px; - margin-right: 5px; -} - -.wizardPageTitleLabelContainer { - width: 180px; -} - -.wizardDTableFieldContainerValid { - padding: 2px; - margin-bottom: 3px; -} - -.wizardDTableFieldContainerInvalid { - padding: 2px; - margin-bottom: 3px; - background-color: #990000; -} - -.wizardDTableSummaryContainer { - margin: 10px; -} - -.wizardDTableCaption { - margin-left: 10px; - margin-right: 10px; - margin-bottom: 10px; - margin-top: 10px; -} - -.scrollPanel { - padding-top: 5px; - padding-bottom: 5px; - margin-bottom: 5px; - border-top-style: solid; - border-top-width: 1px; - border-top-color: #d0d0d0; - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: #d0d0d0; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/WizardsCellList.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/WizardsCellList.css deleted file mode 100644 index f54f6fd4a9c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/css/WizardsCellList.css +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.cellListWidget { - width: 250px; - overflow: hidden; - padding: 2px; -} - -.cellListEvenItem { - padding: 1px; - margin-bottom: 1px; - cursor: pointer; - zoom: 1; -} - -.cellListEmptyItem { - padding: 1px; - cursor: pointer; - color: rgb(150, 150, 150); - font-style: italic; - zoom: 1; -} - -.cellListOddItem { - padding: 1px; - margin-bottom: 1px; - cursor: pointer; - zoom: 1; -} - -.cellListKeyboardSelectedItem { - background: #ffc; -} - -.cellListSelectedItem { - background-color: rgb(200, 200, 200); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.properties deleted file mode 100644 index 27fc045be60..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants.properties +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -multipleMatchingActivitiesFound=Multiple matching activities have been found. -activityNotFound=The location you try to open is inaccessible. Please double check it is an existing location and you have permissions to see it: Settings -> Roles -> Permissions. -cancel=Cancel -Previous=Previous -Next=Next -Finish=Finish -Delete=Delete -RepositoryViewUriLabel=URI: -RepositoryViewRootLabel=Root: -Downloading=downloading -SelectFileToUpload=Please select a file to upload -UploadSuccess=Uploaded successfully -UploadFail=Uploading failed -Uploading=Uploading -DefaultEditor=Default Editor -Download=Download -FileExplorer=File Explorer -Navigator=Navigator -EmptyEntry=-- empty -- -MetaFileEditor=Meta File Editor -CantLoadOrganizationalUnits=Can''t load Organizational Units. -SelectEntry=--- Select --- -URLMandatory=URL is mandatory -InvalidUrlFormat=Invalid URL format -OrganizationalUnitMandatory=Organizational Unit is mandatory -RepositoryNaneMandatory=Repository Name is mandatory -RepositoryNameInvalid=Repository Name contained illegal characters and will be generated as -DoYouAgree=Do you agree? -RepoCloneSuccess=The repository is cloned successfully -IndexClonedRepositoryWarning=The Repository will be indexed. Some workbench features may be unavailable until indexing has completed. -RepoAlreadyExists=Repository already exists. -RepoCloneFail=Can''t clone repository. -Cloning=Cloning repository... -RepoInformation=Repository Information -IsRequired=* is required -RepoName=Repository Name -RepoNameHolder=repository name... -OrganizationalUnit=Organizational Unit -GitUrl=Git URL -GitUrlHolder=git url... -UserName=User Name -UserNameHolder=user name... -Password=Password -PasswordHolder=password... -Cancel=Cancel -Clone=Clone -RepoCreationSuccess=The repository is created successfully -RepoCreationFail=Can''t create repository. -Create=Create -RepositoryEditor=Repository Editor -AvailableProtocols=Available protocol(s): -Reverting=Reverting... -GeneralInformation=General Information -CommitHistory=Commit History -LoadMore=Load More... -TextEditor=Text Editor -ConfirmStateRevert=Confirm state revert? -ActivityNotFound=Activity not found -CloneRepository=Clone Repository -CreateRepository=Create Repository -Empty=[empty] -RevertToThis=Revert to this -textResourceTypeDescription=Text -Branches=Branches -Update=Update -GroupId=Group Id -ArtifactId=Artifact Id -Version=Version -GroupIdHolder=org.guvnor -ArtifactIdHolder=Artifact Name -VersionHolder=1.0.0 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_de.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_de.properties deleted file mode 100644 index d94ffe7f3d4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_de.properties +++ /dev/null @@ -1,70 +0,0 @@ -multipleMatchingActivitiesFound=Mehrere übereinstimmende Aktivitäten gefunden. -cancel=Abbrechen -Previous=Zurück -Next=Weiter -Finish=Beenden -Delete=Löschen -RepositoryViewUriLabel=URI\: -RepositoryViewRootLabel=Root\: -Downloading=Herunterladen -SelectFileToUpload=Bitte eine Datei zum Hochladen auswählen -UploadSuccess=Erfolgreich hochgeladen -UploadFail=Hochladen fehlgeschlagen -Uploading=Hochladen -DefaultEditor=Standard-Editor -Download=Herunterladen -FileExplorer=Datei-Explorer -Navigator=Navigator -EmptyEntry=-- leer -- -MetaFileEditor=Meta Datei Editor -CantLoadOrganizationalUnits=Kann Organisationseinheiten nicht laden. -SelectEntry=--- Auswählen --- -URLMandatory=URL ist obligatorisch -InvalidUrlFormat=Ungültiges URL-Format -OrganizationalUnitMandatory=Organisationseinheit ist obligatorisch -RepositoryNaneMandatory=Repository-Name ist obligatorisch -RepositoryNameInvalid=Repository-Name enthielt unzulässige Zeichen und wird generiert als -DoYouAgree=Sind Sie einverstanden? -RepoCloneSuccess=Das Repository wurde erfolgreich geklont -IndexClonedRepositoryWarning=Das Repository wird indexiert. Einige Workbench-Features sind möglicherweise nicht verfügbar, bis die Indexierung abgeschlossen ist. -RepoAlreadyExists=Repository bereits vorhanden. -RepoCloneFail=Kann Repository nicht klonen -Cloning=Klone Repository... -RepoInformation=Repository Information -IsRequired=* ist erforderlich -RepoName=Repository-Name -RepoNameHolder=Repository-Name... -OrganizationalUnit=Organisationseinheit -GitUrl=Git URL -GitUrlHolder=Git URL... -UserName=Benutzername -UserNameHolder=Benutzername... -Password=Passwort -PasswordHolder=Passwort... -Cancel=Abbrechen -Clone=Klonen -RepoCreationSuccess=Das Repository wurde erfolgreich erstellt -RepoCreationFail=Kann Repository nicht erstellen -Create=Erstellen -RepositoryEditor=Repository-Editor -AvailableProtocols=Verfügbare Protokoll(e)\: -Reverting=Rolle zurück... -GeneralInformation=Allgemeine Informationen -CommitHistory=Festschreibungsverlauf -LoadMore=Mehr laden... -TextEditor=Texteditor -ConfirmStateRevert=Zurückrollen von Status bestätigen? -ActivityNotFound=Aktivität nicht gefunden -CloneRepository=Repository klonen -CreateRepository=Repository erstellen -Empty=[leer] -RevertToThis=Darauf zurückkehren -textResourceTypeDescription=Text -Branches=Sprünge -Update=Aktualisieren -GroupId=Gruppen-ID -ArtifactId=Artifact-ID -Version=Version -GroupIdHolder=org.guvnor -ArtifactIdHolder=Artifact-Name -VersionHolder=1.0.0 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_es.properties deleted file mode 100644 index 29e4947a15f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_es.properties +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -multipleMatchingActivitiesFound=Se han encontrado múltiples actividades coincidentes. -activityNotFound=El lugar que intenta abrir es inaccesible. Compruebe que es una ubicación existente y que tiene permisos para verla: Ajustes -> Roles -> Permisos. -cancel=Cancelar -Previous=Anterior -Next=Siguiente -Finish=Finalizar -Delete=Eliminar -RepositoryViewUriLabel=URI: -RepositoryViewRootLabel=Raíz: -Downloading=descargando -SelectFileToUpload=Seleccione un archivo para cargar -UploadSuccess=La carga se completó correctamente -UploadFail=Se produjo un error en la carga -Uploading=Cargando -DefaultEditor=Editor predeterminado -Download=Descargar -FileExplorer=Explorador de archivos -Navigator=Navegador -EmptyEntry=-- vacío -- -MetaFileEditor=Editor de metarchivos -CantLoadOrganizationalUnits=No se pueden cargar las unidades de la organización. -SelectEntry=--- Seleccionar --- -URLMandatory=La URL es obligatoria -InvalidUrlFormat=Formato de URL no válido -OrganizationalUnitMandatory=La unidad organizativa es obligatoria -RepositoryNaneMandatory=El nombre del repositorio es obligatorio -RepositoryNameInvalid=El nombre del repositorio contenía caracteres no permitidos y se generará de la siguiente manera -DoYouAgree=¿Está de acuerdo? -RepoCloneSuccess=El repositorio se clonó correctamente -IndexClonedRepositoryWarning=El repositorio se indexará. Algunas de las funcionalidades de la mesa de trabajo podrían no estar disponibles hasta que se haya completado la indexación. -RepoAlreadyExists=El repositorio ya existe. -RepoCloneFail=No se puede clonar el depósito. -Cloning=Clonando repositorio… -RepoInformation=Información del repositorio -IsRequired=* es obligatorio -RepoName=Nombre del repositorio -RepoNameHolder=nombre del depósito… -OrganizationalUnit=Unidad organizativa -GitUrl=URL Git -GitUrlHolder=url git… -UserName=Nombre de usuario -UserNameHolder=nombre de usuario… -Password=Contraseña -PasswordHolder=contraseña… -Cancel=Cancelar -Clone=Clonar -RepoCreationSuccess=El repositorio se creó correctamente -RepoCreationFail=No se puede crear un repositorio. -Create=Crear -RepositoryEditor=Editor de repositorio -AvailableProtocols=Protocolos disponibles: -Reverting=Revertiendo… -GeneralInformation=Información general -CommitHistory=Historial de confirmación -LoadMore=Cargar más… -TextEditor=Editor de texto -ConfirmStateRevert=¿Confirmar la reversión del estado? -ActivityNotFound=No se encuentra la actividad -CloneRepository=Clonar repositorio -CreateRepository=Crear repositorio -Empty=[vacío] -RevertToThis=Revertir a esto -textResourceTypeDescription=Texto -Branches=Ramas -Update=Actualizar -GroupId=ID de grupo -ArtifactId=ID de artefacto -Version=Versión -GroupIdHolder=org.guvnor -ArtifactIdHolder=Nombre de artefacto -VersionHolder=1.0.0 - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_fr.properties deleted file mode 100644 index 607822aae77..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_fr.properties +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -multipleMatchingActivitiesFound=Plusieurs activités correspondantes ont été trouvées. -activityNotFound=L’emplacement que vous essayez d’ouvrir est inaccessible. Vérifiez à nouveau qu’il s’agit d’un emplacement existant et que vous êtes autorisé à le visualiser : Paramètres -> Rôles -> Autorisations. -cancel=Annuler -Previous=Précédent -Next=Suivant -Finish=Terminer -Delete=Supprimer -RepositoryViewUriLabel=URI : -RepositoryViewRootLabel=Racine : -Downloading=téléchargement -SelectFileToUpload=Veuillez sélectionner un fichier à envoyer -UploadSuccess=Envoyé avec succès -UploadFail=L’envoi a échoué -Uploading=Envoi -DefaultEditor=Éditeur par défaut -Download=Télécharger -FileExplorer=Explorateur de fichiers -Navigator=Navigateur -EmptyEntry=-- vide -- -MetaFileEditor=Éditeur de métafichier -CantLoadOrganizationalUnits=Impossible de charger les unités d’organisation. -SelectEntry=--- Sélectionner --- -URLMandatory=L’URL est obligatoire -InvalidUrlFormat=Format d’URL non valide -OrganizationalUnitMandatory=L’unité d’organisation est obligatoire -RepositoryNaneMandatory=Le nom du référentiel est obligatoire -RepositoryNameInvalid=Le nom du référentiel contient des caractères non autorisés et sera généré comme -DoYouAgree=Êtes-vous d’accord ? -RepoCloneSuccess=Le référentiel a été cloné -IndexClonedRepositoryWarning=Le référentiel sera indexé. Il se peut que certaines fonctionnalités du tableau de référence soient indisponibles tant que l’indexation n’est pas terminée. -RepoAlreadyExists=Le référentiel existe déjà. -RepoCloneFail=Impossible de cloner le référentiel. -Cloning=Clonage du référentiel… -RepoInformation=Informations sur le référentiel -IsRequired=* est obligatoire -RepoName=Nom du référentiel -RepoNameHolder=nom du référentiel… -OrganizationalUnit=Unité d’organisation -GitUrl=URL GIT -GitUrlHolder=url git… -UserName=Nom d’utilisateur -UserNameHolder=nom d’utilisateur… -Password=Mot de passe -PasswordHolder=mot de passe… -Cancel=Annuler -Clone=Cloner -RepoCreationSuccess=Le référentiel a été créé -RepoCreationFail=Impossible de créer le référentiel. -Create=Créer -RepositoryEditor=Éditeur de référentiel -AvailableProtocols=Protocole(s) disponible(s) : -Reverting=Rétablissement… -GeneralInformation=Informations générales -CommitHistory=Historique de validation -LoadMore=Charger plus… -TextEditor=Éditeur de texte -ConfirmStateRevert=Confirmer le rétablissement de l’état initial ? -ActivityNotFound=Activité introuvable -CloneRepository=Cloner le référentiel -CreateRepository=Créer un référentiel -Empty=[vide] -RevertToThis=Restaurer ceci -textResourceTypeDescription=Texte -Branches=Branches -Update=Mettre à jour -GroupId=ID de groupe -ArtifactId=ID d’artefact -Version=Version -GroupIdHolder=org.guvnor -ArtifactIdHolder=Nom de l’artefact -VersionHolder=1.0.0 - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_ja.properties deleted file mode 100644 index 299aeb2b4a2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_ja.properties +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -multipleMatchingActivitiesFound=一致するアクティビティーが複数見つかりました。 -activityNotFound=表示しようとしている場所にアクセスできません。既存の場所であること、また表示する権限があることを再確認してください。設定 -> ロール -> パーミッション。 -cancel=キャンセル -Previous=戻る -Next=次へ -Finish=完了 -Delete=削除 -RepositoryViewUriLabel=URI: -RepositoryViewRootLabel=ルート: -Downloading=ダウンロード中 -SelectFileToUpload=アップロードするファイルを選択してください -UploadSuccess=正常にアップロードされました -UploadFail=アップロードに失敗しました -Uploading=アップロード中 -DefaultEditor=デフォルトのエディター -Download=ダウンロード -FileExplorer=ファイルエクスプローラー -Navigator=ナビゲーター -EmptyEntry=-- 空 -- -MetaFileEditor=メタファイルエディター -CantLoadOrganizationalUnits=組織単位をロードできません。 -SelectEntry=--- 選択してください--- -URLMandatory=URL は必須 -InvalidUrlFormat=無効な URL 形式 -OrganizationalUnitMandatory=組織単位は必須 -RepositoryNaneMandatory=リポジトリー名は必須 -RepositoryNameInvalid=リポジトリー名に不正な文字が含まれ、以下のように生成されます -DoYouAgree=同意しますか? -RepoCloneSuccess=リポジトリーが正常にクローンされました -IndexClonedRepositoryWarning=リポジトリーがインデックス化されます。ワークベンチ機能の一部はインデックス化が完了するまで使用できません。リポジトリーがインデックス化されます。ワークベンチ機能の一部はインデックス化が完了するまで使用できません。 -RepoAlreadyExists=リポジトリーがすでに存在します。 -RepoCloneFail=リポジトリをクローンできません。 -Cloning=リポジトリーのクローン中 ... -RepoInformation=リポジトリー情報 -IsRequired=* は必須 -RepoName=リポジトリー名 -RepoNameHolder=リポジトリー名 ... -OrganizationalUnit=組織単位 -GitUrl=Git URL -GitUrlHolder=git url... -UserName=ユーザー名 -UserNameHolder=ユーザー名 ... -Password=Password -PasswordHolder=パスワード... -Cancel=キャンセル -Clone=クローン -RepoCreationSuccess=リポジトリーが正常に作成されました -RepoCreationFail=リポジトリーを作成できません。 -Create=作成 -RepositoryEditor=リポジトリーエディター -AvailableProtocols=利用可能なプロトコル: -Reverting=取り消し中... -GeneralInformation=一般情報 -CommitHistory=コミット履歴 -LoadMore=詳細のロード... -TextEditor=テキストエディター -ConfirmStateRevert=取り消しの状態を確認しますか? -ActivityNotFound=アクティビティーが見つかりません -CloneRepository=リポジトリーをクローン -CreateRepository=リポジトリーを作成 -Empty=[空] -RevertToThis=これを取り消す -textResourceTypeDescription=テキスト -Branches=ブランチ -Update=更新 -GroupId=グループ ID -ArtifactId=アーティファクト ID -Version=バージョン -GroupIdHolder=org.guvnor -ArtifactIdHolder=アーティファクト名 -VersionHolder=1.0.0 - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_pt_BR.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_pt_BR.properties deleted file mode 100644 index 66a9ad58a67..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_pt_BR.properties +++ /dev/null @@ -1,70 +0,0 @@ -multipleMatchingActivitiesFound=Nenhuma atividade de combinação múltipla foi encontrada. -cancel=Cancelar -Previous=Anterior -Next=Próximo -Finish=Concluir -Delete=Excluir -RepositoryViewUriLabel=URI\: -RepositoryViewRootLabel=Root\: -Downloading=Executando o download -SelectFileToUpload=Por favor selecione um arquivo para carregar -UploadSuccess=Carregado com êxito -UploadFail=Falha de carregamento -Uploading=Carregando -DefaultEditor=Editor Default -Download=Download -FileExplorer=Explorer do Arquivo -Navigator=Navegador -EmptyEntry=-- vazio -- -MetaFileEditor=Editor de Arquivo Meta -CantLoadOrganizationalUnits=Não foi possível carregar Unidades Organizacionais. -SelectEntry=--- Selecionar --- -URLMandatory=O URL é mandatório -InvalidUrlFormat=Formato de URL inválido -OrganizationalUnitMandatory=A Unidade Organizacional é obrigatória -RepositoryNaneMandatory=O Nome do Repositório é obrigatório -RepositoryNameInvalid=O Nome do Repositório continha caracteres ilegais e será gerado como -DoYouAgree=Você concorda? -RepoCloneSuccess=O repositório foi clonado com êxito -IndexClonedRepositoryWarning=O Repositório será indexado. Alguns recursos de bancada podem estar indisponíveis até que a indexação seja concluída. -RepoAlreadyExists=O repositório já existe. -RepoCloneFail=Não foi possível clonar o repositório. -Cloning=Clonando o repositório... -RepoInformation=Informação do Repositório -IsRequired=* é solicitado -RepoName=Nome do Repositório -RepoNameHolder=nome do repositório... -OrganizationalUnit=Unidade Organizacional -GitUrl=Git URL -GitUrlHolder=git url... -UserName=Nome do Usuário -UserNameHolder=nome do usuário... -Password=Senha -PasswordHolder=senha... -Cancel=Cancelar -Clone=Clonar -RepoCreationSuccess=O repositório é criado com êxito -RepoCreationFail=Não foi possível criar o repositório. -Create=Criar -RepositoryEditor=Editor de repositório -AvailableProtocols=Protocolo(s) disponível(is)\: -Reverting=Revertendo... -GeneralInformation=Informação Geral -CommitHistory=Histórico de Confirmação -LoadMore=Carregar Mais... -TextEditor=Editor de Texto -ConfirmStateRevert=Confirmar o estado de reversão? -ActivityNotFound=Atividade não encontrada -CloneRepository=Clonar Repositório -CreateRepository=Criar Repositório -Empty=[vazio] -RevertToThis=Reverter a isto -textResourceTypeDescription=Texto -Branches=Ramificações -Update=Atualizar -GroupId=Id do Grupo -ArtifactId=ID do Artefato -Version=Versão -GroupIdHolder=org.guvnor -ArtifactIdHolder=Nome do Artefato -VersionHolder=1.0.0 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_zh_CN.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_zh_CN.properties deleted file mode 100644 index f3e6e7266a6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/i18n/CoreConstants_zh_CN.properties +++ /dev/null @@ -1,77 +0,0 @@ -multipleMatchingActivitiesFound=未找到多个匹配的活动。 -cancel=取消 -Previous=上一步 -# auto translated by TM merge from project: JON strings, version: jon33strings, DocId: Messages -Next=下一步 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -Finish=完成 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-guided-rule-editor-client/org/drools/workbench/screens/guided/rule/client/resources/i18n/Constants -Delete=删除 -# auto translated by TM merge from project: KIE Workbench - Common, version: 6.2.0, DocId: org.kie.workbench.widgets/kie-wb-metadata-widget/org/kie/workbench/common/widgets/metadata/client/resources/i18n/MetadataConstants -RepositoryViewUriLabel=URI\: -RepositoryViewRootLabel=Root\: -Downloading=正在下载 -# auto translated by TM merge from project: guvnor, version: 6.2.0, DocId: org.guvnor/guvnor-m2repo-editor-client/org/guvnor/m2repo/client/resources/i18n/M2RepoEditorConstants -SelectFileToUpload=请选择一个文件上传 -# auto translated by TM merge from project: KIE Workbench - Common, version: 6.2.0, DocId: org.kie.workbench.widgets/kie-wb-common-ui/org/kie/workbench/common/widgets/client/resources/i18n/CommonConstants -UploadSuccess=成功上传 -UploadFail=上传失败 -Uploading=正在上传 -DefaultEditor=默认的编辑器 -# auto translated by TM merge from project: Drools Workbench, version: 6.2.0, DocId: org.drools/drools-wb-dtable-xls-editor-client/org/drools/workbench/screens/dtablexls/client/resources/i18n/DecisionTableXLSEditorConstants -Download=下载 -FileExplorer=文件浏览器 -Navigator=导航器 -EmptyEntry=-- empty -- -MetaFileEditor=元文件编辑器 -CantLoadOrganizationalUnits=无法加载组织单元。 -SelectEntry=--- Select --- -URLMandatory=URL 是必需的 -InvalidUrlFormat=无效的 URL 格式 -OrganizationalUnitMandatory=组织单元是必需的 -RepositoryNaneMandatory=资料库名是必需的 -RepositoryNameInvalid=资料库名包含了无效的字符且将生成为 -DoYouAgree=您同意吗? -RepoCloneSuccess=资料库被成功克隆 -IndexClonedRepositoryWarning=资料库将编制索引。在索引完成至前,某些工作区的功能可能不可用。 -RepoAlreadyExists=资料库 已经存在。 -RepoCloneFail=无法克隆资料库。 -Cloning=正在克隆资料库... -RepoInformation=资料库信息 -IsRequired=* 是必需的 -RepoName=资料库名称 -RepoNameHolder=repository name... -OrganizationalUnit=组织单元 -GitUrl=Git URL -GitUrlHolder=git url... -UserName=用户名称 -UserNameHolder=user name... -Password=密码 -PasswordHolder=password... -Cancel=取消 -Clone=克隆 -RepoCreationSuccess=资料库被成功创建 -RepoCreationFail=无法创建资料库。 -Create=创建 -RepositoryEditor=存储库编辑器 -AvailableProtocols=可用的协议: -Reverting=正在还原... -GeneralInformation=普通信息 -CommitHistory=提交历史 -LoadMore=加载更多内容... -TextEditor=文本编辑器 -ConfirmStateRevert=确认状态还原? -ActivityNotFound=未找到活动 -CloneRepository=克隆资料库 -CreateRepository=创建资料库 -Empty=[empty] -RevertToThis=还原至此 -textResourceTypeDescription=文本 -Branches=分支 -Update=更新 -GroupId=Group Id -ArtifactId=Artifact Id -Version=版本 -GroupIdHolder=org.guvnor -ArtifactIdHolder=Artifact 名称 -VersionHolder=1.0.0 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/BPM_FileIcons_text.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/BPM_FileIcons_text.png deleted file mode 100644 index 17848db8457..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/BPM_FileIcons_text.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/backup_large.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/backup_large.png deleted file mode 100644 index 38d0216400e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/backup_large.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/file.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/file.gif deleted file mode 100644 index c1a19e19379..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/file.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/open_folder.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/open_folder.gif deleted file mode 100644 index 51e703b1b9c..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/open_folder.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/package.gif b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/package.gif deleted file mode 100644 index 131c28da405..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/package.gif and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/tick.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/tick.png deleted file mode 100644 index 6bd8724f669..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/tick.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/warning-large.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/warning-large.png deleted file mode 100644 index 7233d45d8e6..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/main/resources/org/uberfire/ext/widgets/core/client/resources/images/warning-large.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItemTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItemTest.java deleted file mode 100644 index 90c96974ae5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/FSTreeItemTest.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.UIObject; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; -import static org.uberfire.ext.widgets.core.client.tree.FSTreeItem.FSType; - -@RunWith(GwtMockitoTestRunner.class) -public class FSTreeItemTest { - - public static final String ROOT_VALUE = "root"; - public static final String ROOT_LABEL = "root"; - - public static final String FOLDER_VALUE = "folder"; - public static final String FOLDER_LABEL = "folder"; - - public static final String ITEM_VALUE = "item"; - public static final String ITEM_LABEL = "item"; - - @Mock - private UIObject uiObject; - - @Mock - private IsWidget widget; - - @Mock - private FlowPanel content; - - @Mock - private FlowPanel item; - - @Mock - private Tree tree; - - private FSTreeItem testedRoot; - private FSTreeItem testedContainer; - private FSTreeItem testedItem; - - @Before - public void setup() { - final Element element = mock(Element.class); - when(content.getElement()).thenReturn(element); - when(element.getTitle()).thenReturn("title"); - final Style styleItem = mock(Style.class); - when(element.getStyle()).thenReturn(styleItem); - - when(uiObject.getTitle()).thenReturn("TITLE"); - - final Style style = mock(Style.class); - when(element.getStyle()).thenReturn(style); - - testedRoot = new FSTreeItem(FSTreeItem.FSType.ROOT, - ROOT_VALUE, - () -> content); - testedRoot.setTree(tree); - - testedContainer = new FSTreeItem(FSTreeItem.FSType.FOLDER, - FOLDER_VALUE, - () -> content); - - testedItem = new FSTreeItem(FSTreeItem.FSType.ITEM, - ITEM_VALUE, - () -> content); - } - - @Test - public void testGetters() { - assertEquals(TreeItem.State.CLOSE, - testedRoot.getState()); - assertEquals(FSTreeItem.FSType.ROOT, - testedRoot.getFSType()); - assertEquals(ROOT_LABEL, - testedRoot.getLabel()); - assertEquals(ROOT_VALUE, - testedRoot.getUuid()); - - assertEquals(TreeItem.State.CLOSE, - testedContainer.getState()); - assertEquals(FSTreeItem.FSType.FOLDER, - testedContainer.getFSType()); - assertEquals(FOLDER_LABEL, - testedContainer.getLabel()); - assertEquals(FOLDER_VALUE, - testedContainer.getUuid()); - - assertEquals(TreeItem.State.NONE, - testedItem.getState()); - assertEquals(FSTreeItem.FSType.ITEM, - testedItem.getFSType()); - assertEquals(ITEM_LABEL, - testedItem.getLabel()); - assertEquals(ITEM_VALUE, - testedItem.getUuid()); - } - - @Test - public void testAddItem() { - final FSTreeItem childTreeItem = mock(FSTreeItem.class); - when(childTreeItem.getFSType()).thenReturn(FSType.ITEM); - final FSTreeItem treeItem1 = testedRoot.addItem(childTreeItem); - assertEquals(treeItem1, - childTreeItem); - verify(childTreeItem, - times(1)).setTree(eq(tree)); - verify(childTreeItem, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).add(eq(childTreeItem)); - } - - @Test - public void testAddContainer() { - final FSTreeItem childTreeContainer = mock(FSTreeItem.class); - when(childTreeContainer.getFSType()).thenReturn(FSTreeItem.FSType.FOLDER); - final FSTreeItem treeItem1 = testedRoot.addItem(childTreeContainer); - assertEquals(treeItem1, - childTreeContainer); - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).add(eq(childTreeContainer)); - } - - @Test - public void testAddItemToContainer() { - final FSTreeItem childTreeContainer = mock(FSTreeItem.class); - when(childTreeContainer.getFSType()).thenReturn(FSType.FOLDER); - - final FSTreeItem childTreeItem = mock(FSTreeItem.class); - when(childTreeItem.getFSType()).thenReturn(FSType.ITEM); - - final FSTreeItem treeItem1 = testedRoot.addItem(childTreeContainer); - - final FSTreeItem treeItem2 = testedContainer.addItem(treeItem1); - - assertEquals(treeItem1, - childTreeContainer); - assertEquals(treeItem2, - treeItem1); - - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(2)).add(treeItem2); - verify(treeItem1, - times(1)).setTree(eq(tree)); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeItemTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeItemTest.java deleted file mode 100644 index 06903ccf58d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeItemTest.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.client.Element; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.uberfire.client.workbench.ouia.OuiaComponentTypeAttribute; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.spy; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class TreeItemTest { - - public static final String ROOT_VALUE = "rootValue"; - public static final String ROOT_LABEL = "rootLabel"; - public static final String CONTAINER_VALUE = "containerValue"; - public static final String CONTAINER_LABEL = "containerLabel"; - public static final String ITEM_VALUE = "itemValue"; - public static final String ITEM_LABEL = "itemLabel"; - - @Mock - private IsWidget widget; - - @Mock - private FlowPanel content; - - @Mock - private FlowPanel treeContainer; - - @Mock - private Tree tree; - - private TreeItem testedRoot; - private TreeItem testedContainer; - private TreeItem testedItem; - - @Before - public void setup() { - final Element element = mock(Element.class); - when(content.getElement()).thenReturn(element); - final Style style = mock(Style.class); - when(element.getStyle()).thenReturn(style); - testedRoot = new TreeItem(TreeItem.Type.ROOT, - ROOT_VALUE, - ROOT_LABEL, - widget, - () -> content); - testedRoot.setTree(tree); - testedContainer = new TreeItem(TreeItem.Type.CONTAINER, - CONTAINER_VALUE, - CONTAINER_LABEL, - widget, - () -> content); - testedItem = new TreeItem(TreeItem.Type.ITEM, - ITEM_VALUE, - ITEM_LABEL, - widget, - () -> content); - } - - @Test - public void testGetters() { - assertEquals(TreeItem.State.CLOSE, - testedRoot.getState()); - assertEquals(TreeItem.Type.ROOT, - testedRoot.getType()); - assertEquals(ROOT_LABEL, - testedRoot.getLabel()); - assertEquals(ROOT_VALUE, - testedRoot.getUuid()); - assertEquals(TreeItem.State.CLOSE, - testedContainer.getState()); - assertEquals(TreeItem.Type.CONTAINER, - testedContainer.getType()); - assertEquals(CONTAINER_LABEL, - testedContainer.getLabel()); - assertEquals(CONTAINER_VALUE, - testedContainer.getUuid()); - assertEquals(TreeItem.State.NONE, - testedItem.getState()); - assertEquals(TreeItem.Type.ITEM, - testedItem.getType()); - assertEquals(ITEM_LABEL, - testedItem.getLabel()); - assertEquals(ITEM_VALUE, - testedItem.getUuid()); - } - - @Test - public void testAddItem() { - final TreeItem childTreeItem = mock(TreeItem.class); - when(childTreeItem.getType()).thenReturn(TreeItem.Type.ITEM); - final TreeItem treeItem1 = testedRoot.addItem(childTreeItem); - assertEquals(treeItem1, - childTreeItem); - verify(childTreeItem, - times(1)).setTree(eq(tree)); - verify(childTreeItem, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).add(eq(childTreeItem)); - } - - @Test - public void testAddContainer() { - final TreeItem childTreeContainer = mock(TreeItem.class); - when(childTreeContainer.getType()).thenReturn(TreeItem.Type.CONTAINER); - final TreeItem treeItem1 = testedRoot.addItem(childTreeContainer); - assertEquals(treeItem1, - childTreeContainer); - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).add(eq(childTreeContainer)); - } - - @Test - public void testAddItemToContainer() { - final TreeItem childTreeContainer = mock(TreeItem.class); - when(childTreeContainer.getType()).thenReturn(TreeItem.Type.CONTAINER); - final TreeItem childTreeItem = mock(TreeItem.class); - when(childTreeItem.getType()).thenReturn(TreeItem.Type.ITEM); - final TreeItem treeItem1 = testedRoot.addItem(childTreeContainer); - final TreeItem treeItem2 = testedContainer.addItem(treeItem1); - assertEquals(treeItem1, - childTreeContainer); - assertEquals(treeItem2, - treeItem1); - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(2)).add(eq(treeItem2)); - verify(treeItem1, - times(1)).setTree(eq(tree)); - } - - @Test - public void testInsertItem() { - final TreeItem childTreeItem = mock(TreeItem.class); - when(childTreeItem.getType()).thenReturn(TreeItem.Type.ITEM); - final int index = 7; - final TreeItem treeItem1 = testedRoot.insertItem(childTreeItem, index); - assertEquals(treeItem1, - childTreeItem); - verify(childTreeItem, - times(1)).setTree(eq(tree)); - verify(childTreeItem, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).insert(eq(childTreeItem), eq(index)); - } - - @Test - public void testInsertContainer() { - final TreeItem childTreeContainer = mock(TreeItem.class); - when(childTreeContainer.getType()).thenReturn(TreeItem.Type.CONTAINER); - final int index = 10; - final TreeItem treeItem1 = testedRoot.insertItem(childTreeContainer, index); - assertEquals(treeItem1, - childTreeContainer); - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).insert(eq(childTreeContainer), eq(index)); - } - - @Test - public void testInsertItemToContainer() { - final TreeItem childTreeContainer = mock(TreeItem.class); - when(childTreeContainer.getType()).thenReturn(TreeItem.Type.CONTAINER); - final TreeItem childTreeItem = mock(TreeItem.class); - when(childTreeItem.getType()).thenReturn(TreeItem.Type.ITEM); - final int index1 = 17; - final int index2 = 25; - final TreeItem treeItem1 = testedRoot.insertItem(childTreeContainer, index1); - final TreeItem treeItem2 = testedContainer.insertItem(treeItem1, index2); - assertEquals(treeItem1, - childTreeContainer); - assertEquals(treeItem2, - treeItem1); - verify(childTreeContainer, - times(1)).setTree(eq(tree)); - verify(childTreeContainer, - times(1)).setParentItem(eq(testedRoot)); - verify(content, - times(1)).insert(eq(treeItem2), eq(index1)); - verify(content, - times(1)).insert(eq(treeItem2), eq(index2)); - verify(treeItem1, - times(1)).setTree(eq(tree)); - } - - @Test - public void testGetChildCount() { - testedRoot.getChildCount(); - verify(content, - times(1)).getWidgetCount(); - } - - @Test - public void testRemoveItems() { - testedRoot.removeItems(); - verify(content, - times(1)).clear(); - } - - @Test - public void testRemove() { - Tree tree = new Tree<>(() -> treeContainer); - testedRoot.setTree(tree); - tree.addItem(testedRoot); - testedRoot.remove(); - verify(treeContainer, - times(1)).remove(eq(testedRoot)); - } - - @Test - public void testRemoveItem() { - final TreeItem item = mock(TreeItem.class); - when(item.getType()).thenReturn(TreeItem.Type.ITEM); - testedRoot.addItem(item); - testedRoot.removeItem(item); - verify(content, - times(1)).remove(eq(item)); - } - - @Test - public void testRemoveItemFromParent() { - final TreeItem childTreeContainer = mock(TreeItem.class); - when(childTreeContainer.getType()).thenReturn(TreeItem.Type.CONTAINER); - final TreeItem childTreeItem = mock(TreeItem.class); - when(childTreeItem.getType()).thenReturn(TreeItem.Type.ITEM); - testedRoot.addItem(childTreeContainer); - testedRoot.removeItem(childTreeContainer); - verify(content, - times(1)).remove(eq(childTreeContainer)); - } - - @Test - public void testGetItemByUuid() { - final TreeItem treeItemTest = testedRoot.getItemByUuid(ROOT_VALUE); - assertEquals(treeItemTest, - testedRoot); - } - - @Test - public void testGetItemByUuidChildren() { - final TreeItem item = mock(TreeItem.class); - when(item.getItemByUuid(ITEM_VALUE)).thenReturn(item); - when(content.getWidgetCount()).thenReturn(1); - when(content.getWidget(eq(0))).thenReturn(item); - final TreeItem treeItemTest = testedRoot.getItemByUuid(ITEM_VALUE); - assertEquals(treeItemTest, - item); - } - - @Test - public void testOuiaComponentTypeAttribute() { - assertEquals("tree-item", testedItem.ouiaComponentType().getValue()); - } - - @Test - public void testOuiaComponentIdAttribute() { - assertEquals("tree-item-" + ITEM_LABEL, testedItem.ouiaComponentId().getValue()); - } - - @Test - public void testOuiaAttributeRenderer() { - testedItem = spy(testedItem); - final Element elementMock = mock(Element.class); - doReturn(elementMock).when(testedItem).getElement(); - - final OuiaComponentTypeAttribute componentTypeAttribute = testedItem.ouiaComponentType(); - testedItem.ouiaAttributeRenderer().accept(componentTypeAttribute); - verify(elementMock).setAttribute(componentTypeAttribute.getName(), componentTypeAttribute.getValue()); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeTest.java deleted file mode 100644 index fa3ee7f3a31..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/tree/TreeTest.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.tree; - -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class TreeTest { - - @Mock - private IsWidget widget; - - @Mock - private FlowPanel container; - - @Mock - private FlowPanel content; - - private Tree testedTree; - - @Before - public void setup() { - testedTree = new Tree(() -> container); - } - - @Test - public void testIsEmpty() { - assertEquals(testedTree.isEmpty(), - true); - } - - @Test - public void testAddItem() { - final TreeItem item = mock(TreeItem.class); - testedTree.addItem(item); - item.setTree(testedTree); - verify(container, - times(1)).add(eq(item)); - } - - @Test - public void testGetItem() { - final TreeItem item1 = mock(TreeItem.class); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - testedTree.addItem(item1); - verify(container, - times(1)).add(eq(item1)); - assertEquals(testedTree.getItem(0), - item1); - } - - @Test - public void testGetItemByUuuid() { - final TreeItem item1 = mock(TreeItem.class); - when(item1.getUuid()).thenReturn("test"); - when(item1.getItemByUuid("test")).thenReturn(item1); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - - testedTree.addItem(item1); - verify(container, - times(1)).add(eq(item1)); - assertEquals(testedTree.getItem(0), - item1); - - TreeItem item = testedTree.getItemByUuid("test"); - assertEquals(item1, - item); - } - - @Test - public void testGetItemByUuuidWithParent() { - final TreeItem item1 = mock(TreeItem.class); - when(item1.getUuid()).thenReturn("test"); - when(item1.getItemByUuid("test")).thenReturn(item1); - final TreeItem parent = mock(TreeItem.class); - when(parent.getUuid()).thenReturn("parent"); - when(parent.getChild(0)).thenReturn(item1); - when(parent.getChildCount()).thenReturn(1); - when(parent.getItemByUuid("parent")).thenReturn(parent); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - - testedTree.addItem(parent); - - verify(container, - times(1)).add(eq(parent)); - assertEquals(testedTree.getItem(0), - item1); - - TreeItem item = testedTree.getItemByUuid("test"); - assertEquals(item1, - item); - } - - @Test - public void testRemoveItem() { - final TreeItem item1 = mock(TreeItem.class); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - testedTree.addItem(item1); - testedTree.removeItem(item1); - verify(container, - times(1)).remove(item1); - } - - @Test - public void testGetItems() { - final TreeItem item1 = mock(TreeItem.class); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - testedTree.addItem(item1); - testedTree.getItems().iterator().hasNext(); - verify(container, - times(1)).getWidgetCount(); - - final int[] idx = {0}; - final TreeItem[] item = new TreeItem[1]; - testedTree.getItems().forEach(i -> { - item[0] = i; - idx[0]++; - } - ); - assertEquals(idx[0], - 1); - assertEquals(item[0], - item1); - } - - @Test - public void testGetSelectedItem() { - final TreeItem item1 = mock(TreeItem.class); - when(container.getWidgetCount()).thenReturn(1); - when(container.getWidget(eq(0))).thenReturn(item1); - testedTree.addItem(item1); - testedTree.setSelectedItem(item1); - TreeItem itemGet = testedTree.getSelectedItem(); - assertEquals(itemGet, - item1); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImplTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImplTest.java deleted file mode 100644 index 8f8acb9e70e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/wizards/WizardViewImplTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.wizards; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.gwtbootstrap3.client.ui.NavPills; -import org.jboss.errai.ioc.client.container.SyncBeanManager; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.anyBoolean; -import static org.mockito.Mockito.anyList; -import static org.mockito.Mockito.doCallRealMethod; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class WizardViewImplTest { - - @Mock - NavPills sideBar; - - @Mock - WizardPopupFooter footer; - - @Mock - AbstractWizard presenter; - - @Mock - SyncBeanManager iocBeanManager; - - List pageTitleWidgets = new ArrayList<>(); - - @Mock - WizardViewImpl view; - - @Before - public void init() { - view.sideBar = sideBar; - view.footer = footer; - view.iocBeanManager = iocBeanManager; - view.pageTitleWidgets = pageTitleWidgets; - - doCallRealMethod().when(view).setCompletionStatus(anyBoolean()); - doCallRealMethod().when(view).onUnload(); - doCallRealMethod().when(view).setPageTitles(anyList()); - doCallRealMethod().when(view).hide(); - } - - @Test - public void testSetCompletionStatusTrue() { - view.setCompletionStatus(true); - - verify(view.footer, - times(1)).enableFinishButton(true); - } - - @Test - public void testSetCompletionStatusFalse() { - view.setCompletionStatus(false); - - verify(view.footer, - times(1)).enableFinishButton(false); - } - - @Test - public void testOnUnload() { - doReturn(presenter).when(view).getPresenter(); - - view.onUnload(); - - verify(presenter).close(); - verify(view).parentOnUnload(); - } - - @Test - public void testHide() { - final WizardPage firstWizardPageMock = mock(WizardPage.class); - final WizardPage secondWizardPageMock = mock(WizardPage.class); - - final WizardPageTitle firstTitleMock = mock(WizardPageTitle.class); - final WizardPageTitle secondTitleMock = mock(WizardPageTitle.class); - - doReturn(firstTitleMock).when(view).makeWizardPageTitle(firstWizardPageMock); - doReturn(secondTitleMock).when(view).makeWizardPageTitle(secondWizardPageMock); - - view.setPageTitles(Arrays.asList(firstWizardPageMock, secondWizardPageMock)); - - assertEquals(2, pageTitleWidgets.size()); - - view.hide(); - - verify(iocBeanManager).destroyBean(firstTitleMock); - verify(iocBeanManager).destroyBean(secondTitleMock); - assertEquals(0, pageTitleWidgets.size()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenterTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenterTest.java deleted file mode 100644 index bff6d214681..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-core/uberfire-widgets-core-client/src/test/java/org/uberfire/ext/widgets/core/client/workbench/widgets/popups/activities/notfound/ActivityNotFoundPresenterTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.core.client.workbench.widgets.popups.activities.notfound; - -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.mvp.PlaceRequest; - -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyZeroInteractions; -import static org.mockito.Mockito.when; - -@RunWith(GwtMockitoTestRunner.class) -public class ActivityNotFoundPresenterTest { - - @Mock - private ActivityNotFoundView view; - - @Mock - private PlaceManager placeManager; - - @Mock - private PlaceRequest placeRequest; - - private ActivityNotFoundPresenter presenter; - - @Before - public void setUp() throws Exception { - presenter = new ActivityNotFoundPresenter(view, placeManager); - presenter.onStartup(placeRequest); - } - - @Test - public void testOnCloseNullPlaceIdentifier() { - presenter.onClose(); - - verifyZeroInteractions(placeManager); - } - - @Test - public void testOnCloseNonNullPlaceIdentifier() { - final String placeIdentifier = "screen-id"; - when(placeRequest.getParameter("requestedPlaceIdentifier", null)).thenReturn(placeIdentifier); - presenter.onClose(); - - verify(placeManager).forceClosePlace(placeIdentifier); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/pom.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/pom.xml deleted file mode 100644 index 4d88a56220e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-widgets - ${revision} - - - uberfire-widgets-table - - Uberfire Table Widget - Uberfire Table Widget - - - - com.google.gwt - gwt-user - provided - - - org.gwtbootstrap3 - gwtbootstrap3 - - - org.jboss.errai - errai-ioc - - - org.uberfire - uberfire-commons - - - org.kie.soup - kie-soup-commons - - - org.uberfire - uberfire-workbench-client-views-patternfly - - - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - commons-logging - commons-logging - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/CheckboxCellImpl.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/CheckboxCellImpl.java deleted file mode 100644 index 73ca6b8c994..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/CheckboxCellImpl.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.cell.client.AbstractEditableCell; -import com.google.gwt.cell.client.Cell; -import com.google.gwt.cell.client.ValueUpdater; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.InputElement; -import com.google.gwt.dom.client.NativeEvent; -import com.google.gwt.event.dom.client.KeyCodes; -import com.google.gwt.safehtml.shared.SafeHtml; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; - -/** - * A {@link Cell} used to render a checkbox. The value of the checkbox may be - * toggled using the ENTER key as well as via mouse click. - */ -public class CheckboxCellImpl extends AbstractEditableCell { - - /** - * An html string representation of a checked input box. - */ - private static final SafeHtml INPUT_CHECKED = SafeHtmlUtils.fromSafeConstant(""); - - /** - * An html string representation of an unchecked input box. - */ - private static final SafeHtml INPUT_UNCHECKED = SafeHtmlUtils.fromSafeConstant(""); - - /** - * An html string representation of a read-only checked input box. - */ - private static final SafeHtml READ_ONLY_INPUT_CHECKED = SafeHtmlUtils.fromSafeConstant(""); - - /** - * An html string representation of a read-only unchecked input box. - */ - private static final SafeHtml READ_ONLY_INPUT_UNCHECKED = SafeHtmlUtils.fromSafeConstant(""); - - protected boolean isReadOnly; - - /** - * Construct a new {@link CheckboxCellImpl} - */ - public CheckboxCellImpl(boolean isReadOnly) { - super("click", - "keydown"); - this.isReadOnly = isReadOnly; - } - - CheckboxCellImpl(String... consumedEvents) { - super(consumedEvents); - } - - @Override - public boolean isEditing(Context context, - Element parent, - Boolean value) { - // A checkbox is never in "edit mode". There is no intermediate state - // between checked and unchecked. - return false; - } - - @Override - public void onBrowserEvent(Context context, - Element parent, - Boolean value, - NativeEvent event, - ValueUpdater valueUpdater) { - - //If read-only ignore editing events - if (isReadOnly) { - return; - } - - String type = event.getType(); - - boolean enterPressed = "keydown".equals(type) && event.getKeyCode() == KeyCodes.KEY_ENTER; - if ("click".equals(type) || enterPressed) { - InputElement input = parent.getFirstChild().cast(); - Boolean isChecked = input.isChecked(); - - /* - * Toggle the value if the enter key was pressed and the cell - * handles selection or doesn't depend on selection. If the cell - * depends on selection but doesn't handle selection, then ignore - * the enter key and let the SelectionEventManager determine which - * keys will trigger a change. - */ - if (enterPressed) { - isChecked = !isChecked; - input.setChecked(isChecked); - } - - /* - * Save the new value. However, if the cell depends on the - * selection, then do not save the value because we can get into an - * inconsistent state. - */ - if (value != isChecked) { - setViewData(context.getKey(), - isChecked); - } - - if (valueUpdater != null) { - valueUpdater.update(isChecked); - } - } - } - - @Override - public void render(Context context, - Boolean value, - SafeHtmlBuilder sb) { - // Get the view data. - Object key = context.getKey(); - Boolean viewData = getViewData(key); - if (viewData != null && viewData.equals(value)) { - clearViewData(key); - viewData = null; - } - - if (value != null && ((viewData != null) ? viewData : value)) { - if (isReadOnly) { - sb.append(READ_ONLY_INPUT_CHECKED); - } else { - sb.append(INPUT_CHECKED); - } - } else { - if (isReadOnly) { - sb.append(READ_ONLY_INPUT_UNCHECKED); - } else { - sb.append(INPUT_UNCHECKED); - } - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnChangedHandler.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnChangedHandler.java deleted file mode 100644 index 4a02c3e5de3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnChangedHandler.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -public interface ColumnChangedHandler { - - void beforeColumnChanged(); - - void afterColumnChanged(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnMeta.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnMeta.java deleted file mode 100644 index afa8a3fb27a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ColumnMeta.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; - -public class ColumnMeta implements Comparable { - - private Column column; - private String caption; - private Header header; - private boolean visible = true; - private int position = -1; - private boolean extraColumn; - private boolean isVisibleIndex = true; - - public ColumnMeta(Column column, - String caption) { - this.column = column; - this.caption = caption; - } - - public ColumnMeta(Column column, - String caption, - boolean visible) { - this.column = column; - this.caption = caption; - this.visible = visible; - } - - public ColumnMeta(Column column, - String caption, - boolean visible, - int position) { - this.column = column; - this.caption = caption; - this.visible = visible; - this.position = position; - } - - public ColumnMeta(Column column, - String caption, - boolean visible, - boolean extraColumn) { - this(column, - caption, - visible); - this.extraColumn = extraColumn; - } - - public boolean isExtraColumn() { - return extraColumn; - } - - public String getCaption() { - return caption; - } - - public void setCaption(String caption) { - this.caption = caption; - } - - public Header getHeader() { - return header; - } - - public void setHeader(Header header) { - this.header = header; - } - - public Column getColumn() { - return column; - } - - public boolean isVisible() { - return visible; - } - - public void setVisible(boolean visible) { - this.visible = visible; - } - - public int getPosition() { - return position; - } - - public void setPosition(int position) { - this.position = position; - } - - public boolean isVisibleIndex() { - return isVisibleIndex; - } - - public void setVisibleIndex(boolean visibleIndex) { - isVisibleIndex = visibleIndex; - } - - @Override - public int compareTo(Object o) { - if (!(o instanceof ColumnMeta)) { - return 0; - } - ColumnMeta otherMeta = (ColumnMeta) o; - if (position == -1 && otherMeta.getPosition() == -1) { - return 0; - } - if (position == -1) { - return 1; - } - if (otherMeta.getPosition() == -1) { - return -1; - } - if (position < otherMeta.getPosition()) { - return -1; - } else if (position > otherMeta.getPosition()) { - return 1; - } else { - return 0; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/DataGrid.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/DataGrid.java deleted file mode 100644 index e1b45f12d81..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/DataGrid.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.dom.client.Element; -import com.google.gwt.view.client.ProvidesKey; - -public class DataGrid extends org.gwtbootstrap3.client.ui.gwt.DataGrid { - - public DataGrid() { - super(); - setupDefaults(); - } - - public DataGrid(final ProvidesKey keyProvider) { - super(keyProvider); - setupDefaults(); - } - - protected void setupDefaults() { - setHover(true); - setStriped(true); - setBordered(true); - addRedrawHandler(() -> fixTableStyle(this.getElement())); - } - - public native void fixTableStyle(final Element e) /*-{ - var table = $wnd.jQuery(e).find("table").first(); - table.addClass("table"); - table.css("margin-bottom", "0px"); - }-*/; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/PagedTableHelper.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/PagedTableHelper.java deleted file mode 100644 index 5a401444eea..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/PagedTableHelper.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import org.gwtbootstrap3.client.ui.ListBox; -import org.uberfire.ext.widgets.table.client.resources.i18n.CommonConstants; - -public class PagedTableHelper { - - public static void setSelectedValue(final ListBox listbox, - final String value) { - - for (int i = 0; i < listbox.getItemCount(); i++) { - if (listbox.getValue(i).equals(value)) { - listbox.setSelectedIndex(i); - return; - } - } - } - - public static void setSelectIndexOnPageSizesSelector(int minPageSize, - int maxPageSize, - int incPageSize, - ListBox pageSizesSelector, - int pageSize) { - for (int i = minPageSize; i <= maxPageSize; i = i + incPageSize) { - pageSizesSelector - .addItem(String.valueOf(i) + " " + CommonConstants.INSTANCE.Items(), - String.valueOf(i)); - if (i == pageSize) { - for (int z = 0; z < pageSizesSelector.getItemCount(); z++) { - if (pageSizesSelector.getValue(z).equals(String.valueOf(i))) { - pageSizesSelector.setSelectedIndex(z); - break; - } - } - } - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ResizableMovableHeader.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ResizableMovableHeader.java deleted file mode 100644 index 4acc6e1db55..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/ResizableMovableHeader.java +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -import java.util.ArrayList; -import java.util.List; - -import com.google.gwt.cell.client.AbstractCell; -import com.google.gwt.cell.client.Cell.Context; -import com.google.gwt.dom.client.DivElement; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.NativeEvent; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.dom.client.Style; -import com.google.gwt.dom.client.Style.Cursor; -import com.google.gwt.dom.client.Style.Position; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.safehtml.shared.SafeHtmlBuilder; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; -import com.google.gwt.user.client.Event; -import com.google.gwt.user.client.Event.NativePreviewEvent; -import com.google.gwt.user.client.Event.NativePreviewHandler; -import org.gwtbootstrap3.client.ui.gwt.DataGrid; -import org.kie.soup.commons.validation.PortablePreconditions; - -import static com.google.gwt.dom.client.Style.Unit.PX; - -/** - * A column header that supports resizing and moving - * See https://github.com/gchatelet/GwtResizableDraggableColumns/blob/master/src/fr/mikrosimage/gwt/client/ResizableHeader.java - * - * @param - */ -public abstract class ResizableMovableHeader extends Header { - - private static final Cursor MOVE_CURSOR = Cursor.MOVE; - private static final String MOVE_COLOR = "gray"; - private static final int MOVE_HANDLE_WIDTH = 32; - - private static final Cursor RESIZE_CURSOR = Cursor.COL_RESIZE; - private static final String RESIZE_COLOR = "gray"; - private static final int RESIZE_HANDLE_WIDTH = 8; - - private static final double GHOST_OPACITY = .3; - - private static final int MINIMUM_COLUMN_WIDTH = 30; - - private final Document document = Document.get(); - - private final String title; - private final DataGrid table; - private final UberfireColumnPicker columnPicker; - private final Column column; - - private final Element tableElement; - private HeaderHelper current; - private List columnChangedHandlers = new ArrayList(); - - public ResizableMovableHeader(final String title, - final DataGrid table, - final UberfireColumnPicker columnPicker, - final Column column) { - super(new HeaderCell()); - this.title = PortablePreconditions.checkNotNull("title", - title); - this.table = PortablePreconditions.checkNotNull("table", - table); - this.columnPicker = PortablePreconditions.checkNotNull("columnPicker", - columnPicker); - this.column = PortablePreconditions.checkNotNull("column", - column); - this.tableElement = table.getElement(); - } - - private static NativeEvent getEventAndPreventPropagation(final NativePreviewEvent event) { - final NativeEvent nativeEvent = event.getNativeEvent(); - nativeEvent.preventDefault(); - nativeEvent.stopPropagation(); - return nativeEvent; - } - - private static void setLine(final Style style, - final int width, - final int top, - final int height, - final String color) { - style.setPosition(Position.ABSOLUTE); - style.setTop(top, - PX); - style.setHeight(height, - PX); - style.setWidth(width, - PX); - style.setBackgroundColor(color); - style.setZIndex(Integer.MAX_VALUE); - } - - @Override - public String getValue() { - return title; - } - - @Override - public void onBrowserEvent(final Context context, - final Element target, - final NativeEvent event) { - if (current == null) { - current = new HeaderHelper(target, - event); - } - } - - protected void columnResized(final int newWidth) { - table.setColumnWidth(column, - newWidth + "px"); - columnPicker.adjustColumnWidths(); - for (ColumnChangedHandler handler : columnChangedHandlers) { - handler.afterColumnChanged(); - } - } - - protected void columnMoved(final int fromIndex, - final int beforeIndex) { - columnPicker.columnMoved(fromIndex, - beforeIndex); - table.removeColumn(fromIndex); - table.insertColumn(beforeIndex, - column, - this); - for (ColumnChangedHandler handler : columnChangedHandlers) { - handler.afterColumnChanged(); - } - } - - protected abstract int getTableBodyHeight(); - - public void addColumnChangedHandler(ColumnChangedHandler handler) { - if (handler != null) { - columnChangedHandlers.add(handler); - } - } - - interface IDragCallback { - - void dragFinished(); - } - - private static class HeaderCell extends AbstractCell { - - public HeaderCell() { - super("mousemove"); - } - - @Override - public void render(final Context context, - final String value, - final SafeHtmlBuilder sb) { - sb.append(SafeHtmlUtils.fromString(value)); - } - } - - private class HeaderHelper implements NativePreviewHandler, - IDragCallback { - - private final HandlerRegistration handler = Event.addNativePreviewHandler(this); - private final Element source; - private final Element handles; - private final Element moveHandle; - private final Element resizeHandle; - private boolean dragging; - - public HeaderHelper(final Element target, - final NativeEvent event) { - event.preventDefault(); - event.stopPropagation(); - this.source = target; - this.handles = document.createDivElement(); - - final int leftBound = target.getOffsetLeft() + target.getOffsetWidth(); - this.moveHandle = createSpanElement(MOVE_CURSOR, - leftBound - RESIZE_HANDLE_WIDTH - MOVE_HANDLE_WIDTH, - MOVE_HANDLE_WIDTH); - this.resizeHandle = createSpanElement(RESIZE_CURSOR, - leftBound - RESIZE_HANDLE_WIDTH, - RESIZE_HANDLE_WIDTH); - handles.appendChild(moveHandle); - handles.appendChild(resizeHandle); - source.appendChild(handles); - } - - private SpanElement createSpanElement(final Cursor cursor, - final double left, - final double width) { - final SpanElement span = document.createSpanElement(); - span.setAttribute("title", - title); - final Style style = span.getStyle(); - style.setCursor(cursor); - style.setPosition(Position.ABSOLUTE); - style.setBottom(0, - PX); - style.setHeight(source.getOffsetHeight(), - PX); - style.setTop(source.getOffsetTop(), - PX); - style.setWidth(width, - PX); - style.setLeft(left, - PX); - return span; - } - - @Override - public void onPreviewNativeEvent(final NativePreviewEvent event) { - final NativeEvent natEvent = event.getNativeEvent(); - final Element element = natEvent.getEventTarget().cast(); - final String eventType = natEvent.getType(); - if (!(element == moveHandle || element == resizeHandle)) { - if ("mousedown".equals(eventType)) { - //No need to do anything, the event will be passed on to the column sort handler - } else if (!dragging && "mouseover".equals(eventType)) { - cleanUp(); - } - return; - } - final NativeEvent nativeEvent = getEventAndPreventPropagation(event); - if ("mousedown".equals(eventType)) { - if (element == resizeHandle) { - moveHandle.removeFromParent(); - new ColumnResizeHelper(this, - source, - nativeEvent); - } else { - new ColumnMoverHelper(this, - source, - nativeEvent); - } - dragging = true; - } - } - - private void cleanUp() { - handler.removeHandler(); - handles.removeFromParent(); - current = null; - } - - public void dragFinished() { - dragging = false; - cleanUp(); - } - } - - private class ColumnResizeHelper implements NativePreviewHandler { - - private final HandlerRegistration handler = Event.addNativePreviewHandler(this); - private final DivElement resizeLine = document.createDivElement(); - private final Style resizeLineStyle = resizeLine.getStyle(); - private final Element header; - private final IDragCallback dragCallback; - - private ColumnResizeHelper(final IDragCallback dragCallback, - final Element header, - final NativeEvent event) { - this.dragCallback = dragCallback; - this.header = header; - setLine(resizeLineStyle, - 2, - 0, - getTableBodyHeight(), - RESIZE_COLOR); - moveLine(event.getClientX()); - tableElement.appendChild(resizeLine); - } - - @Override - public void onPreviewNativeEvent(final NativePreviewEvent event) { - final NativeEvent nativeEvent = getEventAndPreventPropagation(event); - final int clientX = nativeEvent.getClientX(); - final String eventType = nativeEvent.getType(); - if ("mousemove".equals(eventType)) { - moveLine(clientX); - } else if ("mouseup".equals(eventType)) { - handler.removeHandler(); - resizeLine.removeFromParent(); - dragCallback.dragFinished(); - columnResized(Math.max(clientX - header.getAbsoluteLeft(), - MINIMUM_COLUMN_WIDTH)); - } - } - - private void moveLine(final int clientX) { - final int xPos = clientX - table.getAbsoluteLeft(); - resizeLineStyle.setLeft(xPos, - PX); - } - } - - private class ColumnMoverHelper implements NativePreviewHandler { - - private static final int ghostLineWidth = 4; - private final HandlerRegistration handler = Event.addNativePreviewHandler(this); - private final DivElement ghostLine = document.createDivElement(); - private final Style ghostLineStyle = ghostLine.getStyle(); - private final DivElement ghostColumn = document.createDivElement(); - private final Style ghostColumnStyle = ghostColumn.getStyle(); - private final int columnWidth; - private final int[] columnXPositions; - private final IDragCallback dragCallback; - private int fromIndex = -1; - private int toIndex; - - private ColumnMoverHelper(final IDragCallback dragCallback, - final Element target, - final NativeEvent event) { - final int clientX = event.getClientX(); - final Element tr = getRowElement(target); - final int columns = tr.getChildCount(); - - this.dragCallback = dragCallback; - this.columnWidth = target.getOffsetWidth(); - this.columnXPositions = new int[columns + 1]; - this.columnXPositions[0] = tr.getAbsoluteLeft(); - for (int i = 0; i < columns; ++i) { - final int xPos = columnXPositions[i] + ((Element) tr.getChild(i)).getOffsetWidth(); - if (xPos > clientX && fromIndex == -1) { - fromIndex = i; - } - columnXPositions[i + 1] = xPos; - } - toIndex = fromIndex; - final int bodyHeight = getTableBodyHeight(); - setLine(ghostColumnStyle, - columnWidth, - 0, - bodyHeight, - MOVE_COLOR); - setLine(ghostLineStyle, - ghostLineWidth, - 0, - bodyHeight, - RESIZE_COLOR); - ghostColumnStyle.setOpacity(GHOST_OPACITY); - moveColumn(clientX); - tableElement.appendChild(ghostColumn); - tableElement.appendChild(ghostLine); - } - - protected Element getRowElement(Element target) { - Element parent = target.getParentElement(); - while (parent != null) { - if (parent.getTagName().equalsIgnoreCase("tr")) { - return parent; - } - parent = parent.getParentElement(); - } - return target.getParentElement(); - } - - @Override - public void onPreviewNativeEvent(final NativePreviewEvent event) { - final NativeEvent nativeEvent = getEventAndPreventPropagation(event); - final String eventType = nativeEvent.getType(); - if ("mousemove".equals(eventType)) { - moveColumn(nativeEvent.getClientX()); - } else if ("mouseup".equals(eventType)) { - handler.removeHandler(); - ghostColumn.removeFromParent(); - ghostLine.removeFromParent(); - if (fromIndex != toIndex) { - columnMoved(fromIndex, - toIndex); - } - dragCallback.dragFinished(); - } - } - - private void moveColumn(final int clientX) { - final int pointer = clientX - columnWidth / 2; - ghostColumnStyle.setLeft(pointer - table.getAbsoluteLeft(), - PX); - for (int i = 0; i < columnXPositions.length - 1; ++i) { - if (clientX < columnXPositions[i + 1]) { - final int adjustedIndex = i > fromIndex ? i + 1 : i; - int lineXPos = columnXPositions[adjustedIndex] - table.getAbsoluteLeft(); - if (adjustedIndex == columnXPositions.length - 1) { - lineXPos -= ghostLineWidth; - } else if (adjustedIndex > 0) { - lineXPos -= ghostLineWidth / 2; - } - ghostLineStyle.setLeft(lineXPos, - PX); - toIndex = i; - break; - } - } - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/TableEntryPoint.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/TableEntryPoint.java deleted file mode 100644 index f60cbaafa08..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/TableEntryPoint.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.uberfire.client.views.pfly.sys.PatternFlyBootstrapper; -import org.uberfire.ext.widgets.table.client.resources.UFTableResources; - -@EntryPoint -public class TableEntryPoint { - - @PostConstruct - public void startApp() { - UFTableResources.INSTANCE.CSS().ensureInjected(); - PatternFlyBootstrapper.ensurejQueryIsAvailable(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireColumnPicker.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireColumnPicker.java deleted file mode 100644 index 98cc45a7bc6..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireColumnPicker.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.VerticalPanel; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.CheckBox; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.gwtbootstrap3.client.ui.constants.Toggle; -import org.gwtbootstrap3.client.ui.gwt.DataGrid; -import org.uberfire.ext.widgets.table.client.resources.UFTableResources; -import org.uberfire.ext.widgets.table.client.resources.i18n.CommonConstants; - -public class UberfireColumnPicker { - - protected final DataGrid dataGrid; - protected final List> columnMetaList = new ArrayList<>(); - protected final PopupPanel popup = GWT.create(PopupPanel.class); - protected List columnChangedHandler = new ArrayList<>(); - - protected DataGrid getDataGrid() { - return dataGrid; - } - - public UberfireColumnPicker(DataGrid dataGrid) { - this.dataGrid = dataGrid; - setupPopup(); - } - - private void setupPopup() { - popup.setAutoHideEnabled(true); - popup.setAutoHideOnHistoryEventsEnabled(true); - } - - public void addColumnChangedHandler(ColumnChangedHandler handler) { - columnChangedHandler.add(handler); - } - - public Collection> getColumnMetaList() { - return columnMetaList; - } - - protected String getColumnStoreName(ColumnMeta columnMeta) { - if (columnMeta != null) { - if (columnMeta.getColumn() != null) { - String colStoreName = columnMeta.getColumn().getDataStoreName(); - if (colStoreName != null && !colStoreName.isEmpty()) { - return colStoreName; - } - } - return columnMeta.getCaption(); - } - return ""; - } - - public void columnMoved(final int visibleFromIndex, - final int visibleBeforeIndex) { - int visibleColumnFromIndex = 0; - ColumnMeta columnMetaToMove = null; - for (int i = 0; i < columnMetaList.size(); i++) { - final ColumnMeta columnMeta = columnMetaList.get(i); - if (columnMeta.isVisible()) { - if (visibleFromIndex == visibleColumnFromIndex) { - columnMetaToMove = columnMeta; - break; - } - visibleColumnFromIndex++; - } - } - if (columnMetaToMove == null) { - return; - } - - columnMetaList.remove(columnMetaToMove); - - boolean columnInserted = false; - int visibleColumnBeforeIndex = 0; - for (int i = 0; i < columnMetaList.size(); i++) { - final ColumnMeta columnMeta = columnMetaList.get(i); - if (columnMeta.isVisible()) { - if (visibleBeforeIndex == visibleColumnBeforeIndex) { - columnMetaList.add(i, - columnMetaToMove); - columnInserted = true; - break; - } - visibleColumnBeforeIndex++; - } - } - if (!columnInserted) { - columnMetaList.add(columnMetaToMove); - } - } - - protected int getVisibleColumnIndex(final ColumnMeta columnMeta) { - int index = 0; - for (final ColumnMeta cm : columnMetaList) { - if (cm.equals(columnMeta)) { - return index; - } - if (cm.isVisible() && cm.isVisibleIndex()) { - index++; - } - } - return index; - } - - public void addColumn(ColumnMeta columnMeta) { - if (columnMeta == null) { - return; - } - if (!columnMetaList.contains(columnMeta)) { - columnMetaList.add(columnMeta); - } - Collections.sort(columnMetaList); - if (columnMeta.isVisible()) { - dataGrid.insertColumn(getVisibleColumnIndex(columnMeta), - columnMeta.getColumn(), - columnMeta.getHeader()); - } - } - - protected void sortAndAddColumns(List> columnMetas) { - columnMetas.stream().sorted().forEach(meta -> addColumn(meta)); - } - - public void adjustColumnWidths() { - for (ColumnChangedHandler handler : columnChangedHandler) { - handler.afterColumnChanged(); - } - } - - public void addColumns(List> columnMetas) { - columnMetaList.addAll(columnMetas); - sortAndAddColumns(columnMetas); - adjustColumnWidths(); - } - - public void removeColumn(ColumnMeta columnMeta) { - columnMetaList.remove(columnMeta); - int count = dataGrid.getColumnCount(); - for (int i = 0; i < count; i++) { - dataGrid.removeColumn(0); - } - - sortAndAddColumns(columnMetaList); - adjustColumnWidths(); - } - - protected void configureColorPickerPopup(int left, - int top, - VerticalPanel popupContent) { - popup.setWidget(popupContent); - popup.show(); - int finalLeft = left - popup.getOffsetWidth(); - popup.setPopupPosition(finalLeft, - top); - } - - protected boolean addThisColumnToPopup(ColumnMeta columnMeta) { - return (columnMeta.getHeader().getValue() instanceof String); - } - - protected void addResetButtom(final int left, - final int top, - VerticalPanel popupContent) { - //there is no reset buttom - } - - protected void showColumnPickerPopup(final int left, - final int top) { - VerticalPanel popupContent = GWT.create(VerticalPanel.class); - - initCheckBoxs(popupContent); - - addResetButtom(left, - top, - popupContent); - configureColorPickerPopup(left, - top, - popupContent); - } - - protected void initCheckBoxs(VerticalPanel popupContent) { - for (final ColumnMeta columnMeta : columnMetaList) { - if (addThisColumnToPopup(columnMeta)) { - final CheckBox checkBox = GWT.create(CheckBox.class); - checkBox.setText((String) columnMeta.getHeader().getValue()); - checkBox.setName((String) columnMeta.getHeader().getValue()); - checkBox.setValue(columnMeta.isVisible()); - checkBox.addValueChangeHandler(handler -> addColumnOnDataGrid(handler.getValue(), columnMeta)); - - popupContent.add(checkBox); - } - } - } - - protected void addColumnOnDataGrid(boolean visible, ColumnMeta columnMeta) { - if (visible) { - dataGrid.insertColumn(getVisibleColumnIndex(columnMeta), - columnMeta.getColumn(), - columnMeta.getHeader()); - } else { - dataGrid.removeColumn(columnMeta.getColumn()); - } - columnMeta.setVisible(visible); - adjustColumnWidths(); - } - - public Button createToggleButton() { - final Button button = GWT.create(Button.class); - button.addStyleName(UFTableResources.INSTANCE.CSS().columnPickerButton()); - button.setDataToggle(Toggle.BUTTON); - button.setIcon(IconType.LIST_UL); - button.setTitle(CommonConstants.INSTANCE.ColumnPickerButtonTooltip()); - - popup.addStyleName(UFTableResources.INSTANCE.CSS().columnPickerPopup()); - popup.addAutoHidePartner(button.getElement()); - popup.addCloseHandler(new CloseHandler() { - public void onClose(CloseEvent popupPanelCloseEvent) { - if (popupPanelCloseEvent.isAutoClosed()) { - button.setActive(false); - } - } - }); - - button.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - if (!button.isActive()) { - showColumnPickerPopup(button.getAbsoluteLeft() + button.getOffsetWidth(), - button.getAbsoluteTop() + button.getOffsetHeight()); - } else { - popup.hide(false); - } - } - }); - return button; - } - - protected void resetTableColumns(int left, - int top) { - int count = dataGrid.getColumnCount(); - for (int i = 0; i < count; i++) { - dataGrid.removeColumn(0); - } - - loadGlobalGridPreferences(); - - sortAndAddColumns(new ArrayList>(columnMetaList)); - - adjustColumnWidths(); - - showColumnPickerPopup(left, - top); - } - - protected void loadGlobalGridPreferences() { - } - - public int getDataGridMinWidth() { - return -1; - } - - public void setDefaultColumnWidthSize(int defaultColumSize) { - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.java deleted file mode 100644 index 12fd9e6dcd3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.AbstractDataProvider; -import com.google.gwt.view.client.ProvidesKey; -import org.gwtbootstrap3.client.ui.ListBox; - -public class UberfirePagedTable - extends UberfireSimpleTable { - - public static final int DEFAULT_PAGE_SIZE = 10; - private static Binder uiBinder = GWT.create(Binder.class); - @UiField - public UberfireSimplePager pager; - @UiField - public ListBox pageSizesSelector; - protected boolean showPageSizesSelector = false; - private int pageSize = 0; - private AbstractDataProvider dataProvider; - - public UberfirePagedTable() { - this(DEFAULT_PAGE_SIZE); - } - - public UberfirePagedTable(final int pageSize) { - this(pageSize, - null); - } - - public UberfirePagedTable(final int pageSize, - final ProvidesKey providesKey) { - this(pageSize, - providesKey, - false); - } - - public UberfirePagedTable(final int pageSize, - final ProvidesKey providesKey, - final boolean showPageSizesSelector) { - - this(pageSize, - providesKey, - showPageSizesSelector, - false, - false); - } - - public UberfirePagedTable(final int pageSize, - final ProvidesKey providesKey, - final boolean showPageSizesSelector, - final boolean showFFButton, - final boolean showLButton) { - super(providesKey); - this.showPageSizesSelector = showPageSizesSelector; - this.pageSize = pageSize; - this.dataGrid.setPageSize(pageSize); - PagedTableHelper.setSelectedValue(pageSizesSelector, - String.valueOf(pageSize)); - this.pager.setDisplay(dataGrid); - this.pageSizesSelector.setVisible(this.showPageSizesSelector); - setShowFastFordwardPagerButton(showFFButton); - setShowLastPagerButton(showLButton); - createPageSizesListBox(5, - 20, - 5); - } - - @Override - protected Widget makeWidget() { - return uiBinder.createAndBindUi(this); - } - - public AbstractDataProvider getDataProvider() { - return dataProvider; - } - - public void setDataProvider(final AbstractDataProvider dataProvider) { - this.dataProvider = dataProvider; - this.dataProvider.addDataDisplay(this); - } - - public int getPageSize() { - return this.pageSize; - } - - public int getPageStart() { - return this.pager.getPageStart(); - } - - public void createPageSizesListBox(int minPageSize, - int maxPageSize, - int incPageSize) { - pageSizesSelector.clear(); - PagedTableHelper.setSelectIndexOnPageSizesSelector(minPageSize, - maxPageSize, - incPageSize, - pageSizesSelector, - pageSize); - pageSizesSelector.addChangeHandler(event -> loadPageSizePreferences()); - - loadPageSizePreferences(); - } - - public final void loadPageSizePreferences() { - this.dataGrid.setPageSize(pageSize); - this.pager.setPageSize(pageSize); - this.dataGrid.setHeight(((pageSize == 0 ? 1 : pageSize) * 30 + 10) + "px"); - } - - public void setShowLastPagerButton(boolean showLastPagerButton) { - this.pager.setShowLastPageButton(showLastPagerButton); - } - - public void setShowFastFordwardPagerButton(boolean showFastFordwardPagerButton) { - this.pager.setShowFastFordwardPageButton(showFastFordwardPagerButton); - } - - interface Binder - extends - UiBinder { - - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.ui.xml deleted file mode 100644 index 896ae86e898..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfirePagedTable.ui.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - .dataGridContainer { - padding-top: 10px; - padding-bottom: 10px; - } - - .leftToolBar { - float: left; - text-align: left - } - - .rightToolBar { - float: right; - text-align: right; - } - - .centerToolBar { - text-align: center - } - - .pager { - margin: 0px; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimplePager.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimplePager.java deleted file mode 100644 index 3a4f8ef7e8c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimplePager.java +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.i18n.client.NumberFormat; -import com.google.gwt.resources.client.CssResource; -import com.google.gwt.user.cellview.client.AbstractPager; -import com.google.gwt.user.cellview.client.SimplePager; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.HasVerticalAlignment; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.view.client.HasRows; -import com.google.gwt.view.client.Range; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.uberfire.ext.widgets.table.client.resources.UberfireSimplePagerResources; -import org.uberfire.ext.widgets.table.client.resources.i18n.CommonConstants; - -/** - * Essentially a fork of GWT's SimplePager that maintains a set page size and - * displays page numbers and total pages more elegantly. SimplePager will ensure - * pageSize rows are always rendered even if the "last" page has - * less than pageSize rows remain. Forked not sub-classed as - * GWTs code is largely private and not open to extension :( - */ -public class UberfireSimplePager extends AbstractPager { - - private static int DEFAULT_FAST_FORWARD_ROWS = 100; - private static UberfireSimplePagerResources DEFAULT_RESOURCES; - private final Button fastForward; - private final int fastForwardRows; - private final Button firstPage; - /** - * We use an {@link HTML} so we can embed the loading image. - */ - private final HTML label = new HTML(); - private final Button lastPage; - private final Button nextPage; - private final Button prevPage; - /** - * The {@link UberfireSimplePagerResources} used by this widget. - */ - private final UberfireSimplePagerResources resources; - /** - * The {@link Style} used by this widget. - */ - private final Style style; - //Page size is normally derieved from the visibleRange - private int pageSize = 10; - - /** - * Construct a {@link SimplePager} with the default text location. - */ - public UberfireSimplePager() { - this(TextLocation.CENTER); - } - - /** - * Construct a {@link SimplePager} with the specified text location. - * @param location the location of the text relative to the buttons - */ - public UberfireSimplePager(TextLocation location) { - this(location, - getDefaultResources(), - true, - DEFAULT_FAST_FORWARD_ROWS, - true); - } - - public UberfireSimplePager(boolean showFastForwardButton, - boolean showLastPageButton) { - this(TextLocation.CENTER, - getDefaultResources(), - showFastForwardButton, - DEFAULT_FAST_FORWARD_ROWS, - showLastPageButton); - } - - /** - * Construct a {@link SimplePager} with the specified resources. - * @param location the location of the text relative to the buttons - * @param resources the {@link UberfireSimplePagerResources} to use - * @param showFastForwardButton if true, show a fast-forward button that advances by a larger - * increment than a single page - * @param fastForwardRows the number of rows to jump when fast forwarding - * @param showLastPageButton if true, show a button to go the the last page - */ - public UberfireSimplePager(TextLocation location, - UberfireSimplePagerResources resources, - boolean showFastForwardButton, - final int fastForwardRows, - boolean showLastPageButton) { - this.resources = resources; - this.fastForwardRows = fastForwardRows; - this.style = resources.simplePagerStyle(); - this.style.ensureInjected(); - - // Create the buttons. - firstPage = new Button(); - firstPage.setIcon(IconType.ANGLE_DOUBLE_LEFT); - firstPage.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - firstPage(); - } - }); - nextPage = new Button(); - nextPage.setIcon(IconType.ANGLE_RIGHT); - nextPage.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - nextPage(); - } - }); - prevPage = new Button(); - prevPage.setIcon(IconType.ANGLE_LEFT); - prevPage.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - previousPage(); - } - }); - - lastPage = new Button(); - lastPage.setIcon(IconType.ANGLE_DOUBLE_RIGHT); - lastPage.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - lastPage(); - } - }); - - fastForward = new Button(); - fastForward.setIcon(IconType.FAST_FORWARD); - fastForward.addClickHandler(new ClickHandler() { - public void onClick(ClickEvent event) { - setPage(getPage() + getFastForwardPages()); - } - }); - - // Construct the widget. - HorizontalPanel layout = new HorizontalPanel(); - layout.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); - initWidget(layout); - if (location == TextLocation.RIGHT) { - layout.add(label); - } - layout.add(firstPage); - layout.add(prevPage); - if (location == TextLocation.CENTER) { - layout.add(label); - } - layout.add(nextPage); - layout.add(fastForward); - layout.add(lastPage); - - if (location == TextLocation.LEFT) { - layout.add(label); - } - - // Add style names to the cells. - firstPage.getElement().getParentElement().addClassName(style.button()); - prevPage.getElement().getParentElement().addClassName(style.button()); - label.getElement().getParentElement().addClassName(style.pageDetails()); - nextPage.getElement().getParentElement().addClassName(style.button()); - fastForward.getElement().getParentElement().addClassName(style.button()); - lastPage.getElement().getParentElement().addClassName(style.button()); - - setShowLastPageButton(showLastPageButton); - setShowFastFordwardPageButton(showFastForwardButton); - - // Disable the buttons by default. - setDisplay(null); - } - - private static UberfireSimplePagerResources getDefaultResources() { - if (DEFAULT_RESOURCES == null) { - DEFAULT_RESOURCES = UberfireSimplePagerResources.INSTANCE; - } - return DEFAULT_RESOURCES; - } - - public void setShowLastPageButton(boolean showLastPageButton) { - this.lastPage.setVisible(showLastPageButton); - } - - public void setShowFastFordwardPageButton(boolean showFastFordwardPageButton) { - this.fastForward.setVisible(showFastFordwardPageButton); - } - - // We want pageSize to remain constant - @Override - public int getPageSize() { - return pageSize; - } - - @Override - public void setPageSize(int pageSize) { - this.pageSize = pageSize; - super.setPageSize(pageSize); - } - - // Page forward by an exact size rather than the number of visible - // rows as is in the norm in the underlying implementation - @Override - public void nextPage() { - if (getDisplay() != null) { - Range range = getDisplay().getVisibleRange(); - setPageStart(range.getStart() - + getPageSize()); - } - } - - // Page back by an exact size rather than the number of visible rows - // as is in the norm in the underlying implementation - @Override - public void previousPage() { - if (getDisplay() != null) { - Range range = getDisplay().getVisibleRange(); - setPageStart(range.getStart() - - getPageSize()); - } - } - - @Override - public void setDisplay(HasRows display) { - // Enable or disable all buttons. - boolean disableButtons = (display == null); - setFastForwardDisabled(disableButtons); - setNextPageButtonsDisabled(disableButtons); - setPrevPageButtonsDisabled(disableButtons); - super.setDisplay(display); - } - - @Override - public void setPage(int index) { - super.setPage(index); - } - - // Override so the last page is shown with a number of rows less - // than the pageSize rather than always showing the pageSize number - // of rows and possibly repeating rows on the last and penultimate - // page - @Override - public void setPageStart(int index) { - if (getDisplay() != null) { - Range range = getDisplay().getVisibleRange(); - int displayPageSize = range.getLength(); - if (!isRangeLimited() && getDisplay().isRowCountExact()) { - index = Math.min(index, - getDisplay().getRowCount() - displayPageSize); - } - index = Math.max(0, - index); - if (index != range.getStart()) { - getDisplay().setVisibleRange(index, - displayPageSize); - } - } - } - - /** - * Let the page know that the table is loading. Call this method to clear - * all data from the table and hide the current range when new data is being - * loaded into the table. - */ - public void startLoading() { - getDisplay().setRowCount(0, - true); - label.setHTML(""); - } - - /** - * Get the number of pages to fast forward based on the current page size. - * @return the number of pages to fast forward - */ - private int getFastForwardPages() { - int pageSize = getPageSize(); - return pageSize > 0 ? fastForwardRows / pageSize : 0; - } - - /** - * Enable or disable the fast forward button. - * @param disabled true to disable, false to enable - */ - private void setFastForwardDisabled(boolean disabled) { - if (fastForward == null) { - return; - } - - //The one line change to GWT's SimplePager code! - fastForward.setEnabled(!disabled); - } - - /** - * Enable or disable the next page buttons. - * @param disabled true to disable, false to enable - */ - private void setNextPageButtonsDisabled(boolean disabled) { - nextPage.setEnabled(!disabled); - if (lastPage != null) { - lastPage.setEnabled(!disabled); - } - } - - /** - * Enable or disable the previous page buttons. - * @param disabled true to disable, false to enable - */ - private void setPrevPageButtonsDisabled(boolean disabled) { - firstPage.setEnabled(!disabled); - prevPage.setEnabled(!disabled); - } - - // Override to display "0 of 0" when there are no records (otherwise - // you get "1-1 of 0") and "1 of 1" when there is only one record - // (otherwise you get "1-1 of 1"). Not internationalised (but - // neither is SimplePager) - protected String createText() { - NumberFormat formatter = NumberFormat.getFormat("#,###"); - HasRows display = getDisplay(); - Range range = display.getVisibleRange(); - int pageStart = range.getStart() + 1; - int pageSize = range.getLength(); - int dataSize = display.getRowCount(); - int endIndex = Math.min(dataSize, - pageStart - + pageSize - - 1); - endIndex = Math.max(pageStart, - endIndex); - boolean exact = display.isRowCountExact(); - if (dataSize == 0) { - return "0 " + of() + " 0"; - } else if (pageStart == endIndex) { - return formatter.format(pageStart) - + " " + of() + " " - + formatter.format(dataSize); - } - return formatter.format(pageStart) - + "-" - + formatter.format(endIndex) - + (exact ? " " + of() + " " : " " + of() + " " + over() + " ") - + formatter.format(dataSize); - } - - @Override - protected void onRangeOrRowCountChanged() { - HasRows display = getDisplay(); - label.setText(createText()); - - // Update the prev and first buttons. - setPrevPageButtonsDisabled(!hasPreviousPage()); - - // Update the next and last buttons. - if (isRangeLimited() || !display.isRowCountExact()) { - setNextPageButtonsDisabled(!hasNextPage()); - setFastForwardDisabled(!hasNextPages(getFastForwardPages())); - } - } - - /** - * Check if the next button is disabled. Visible for testing. - */ - boolean isNextButtonDisabled() { - return nextPage.isEnabled() == false; - } - - /** - * Check if the previous button is disabled. Visible for testing. - */ - boolean isPreviousButtonDisabled() { - return prevPage.isEnabled() == false; - } - - private String of() { - return CommonConstants.INSTANCE.Of(); - } - - private String over() { - return CommonConstants.INSTANCE.Over(); - } - - /** - * The location of the text relative to the paging buttons. - */ - public enum TextLocation { - CENTER, - LEFT, - RIGHT - } - - /** - * Styles used by this widget. - */ - public interface Style - extends - CssResource { - - /** - * Applied to buttons. - */ - String button(); - - /** - * Applied to the details text. - */ - String pageDetails(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.java deleted file mode 100644 index 12b59a83fbb..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client; - -import java.util.List; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.JavaScriptObject; -import com.google.gwt.dom.client.Style; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.ColumnSortEvent; -import com.google.gwt.user.cellview.client.ColumnSortList; -import com.google.gwt.user.cellview.client.RowStyles; -import com.google.gwt.user.client.ui.ComplexPanel; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.HTML; -import com.google.gwt.user.client.ui.HasWidgets; -import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.view.client.CellPreviewEvent; -import com.google.gwt.view.client.HasData; -import com.google.gwt.view.client.ProvidesKey; -import com.google.gwt.view.client.Range; -import com.google.gwt.view.client.RangeChangeEvent; -import com.google.gwt.view.client.RowCountChangeEvent; -import com.google.gwt.view.client.SelectionModel; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Label; -import org.uberfire.ext.widgets.table.client.resources.UFTableResources; - -/** - * A composite Widget that shows rows of data (not-paged) and a "column picker" - * to allow columns to be hidden from view. Columns can also be sorted. - */ -public class UberfireSimpleTable - extends Composite - implements HasData { - - private static Binder uiBinder = GWT.create(Binder.class); - @UiField(provided = true) - public Button columnPickerButton; - @UiField(provided = true) - public DataGrid dataGrid; - @UiField - public ComplexPanel toolbarContainer; - @UiField - public ComplexPanel rightToolbar; - @UiField - public FlowPanel rightActionsToolbar; - @UiField - public FlowPanel leftToolbar; - @UiField - public FlowPanel centerToolbar; - protected UberfireColumnPicker columnPicker; - private String emptyTableCaption; - - public UberfireSimpleTable() { - setupDataGrid(null); - setupGridTable(); - } - - public UberfireSimpleTable(final ProvidesKey providesKey) { - setupDataGrid(providesKey); - setupGridTable(); - } - - protected static native void addDataGridStyles(final JavaScriptObject grid, - final String header, - final String content)/*-{ - $wnd.jQuery(grid).find('table:first').addClass(header); - $wnd.jQuery(grid).find('table:last').addClass(content); - }-*/; - - public void addDataGridStyles(final String header, - final String content) { - addDataGridStyles(dataGrid.getElement(), - header, - content); - } - - protected void setupGridTable() { - setupDataGrid(); - setEmptyTableWidget(); - - setupColumnPicker(); - - columnPickerButton = getColumnPicker().createToggleButton(); - - initWidget(makeWidget()); - } - - protected void setupColumnPicker() { - setColumnPicker(new UberfireColumnPicker<>(dataGrid)); - } - - protected UberfireColumnPicker getColumnPicker() { - return columnPicker; - } - - protected void setColumnPicker(UberfireColumnPicker columnPicker) { - this.columnPicker = columnPicker; - } - - protected void setupDataGrid(ProvidesKey providesKey) { - if (providesKey != null) { - dataGrid = new DataGrid(providesKey); - } else { - dataGrid = new DataGrid(); - } - } - - public void setEmptyTableCaption(final String emptyTableCaption) { - this.emptyTableCaption = emptyTableCaption; - setEmptyTableWidget(); - } - - protected void setupDataGrid() { - dataGrid.setSkipRowHoverCheck(false); - dataGrid.setSkipRowHoverStyleUpdate(false); - dataGrid.addStyleName(UFTableResources.INSTANCE.CSS().dataGridMain()); - dataGrid.addStyleName(UFTableResources.INSTANCE.CSS().dataGrid()); - dataGrid.setRowStyles((row, rowIndex) -> UFTableResources.INSTANCE.CSS().dataGridRow()); - addDataGridStyles(UFTableResources.INSTANCE.CSS().dataGridHeader(), - UFTableResources.INSTANCE.CSS().dataGridContent()); - } - - protected void setEmptyTableWidget() { - String caption = "-----"; - if (!emptyCaptionIsDefined()) { - caption = emptyTableCaption; - } - dataGrid.setEmptyTableWidget(new Label(caption)); - } - - private boolean emptyCaptionIsDefined() { - return emptyTableCaption == null || emptyTableCaption.trim().isEmpty(); - } - - protected Widget makeWidget() { - return uiBinder.createAndBindUi(this); - } - - public void redraw() { - dataGrid.redraw(); - dataGrid.flush(); - } - - public void refresh() { - dataGrid.setVisibleRangeAndClearData(dataGrid.getVisibleRange(), - true); - } - - @Override - public HandlerRegistration addCellPreviewHandler(final CellPreviewEvent.Handler handler) { - return dataGrid.addCellPreviewHandler(handler); - } - - @Override - public HandlerRegistration addRangeChangeHandler(final RangeChangeEvent.Handler handler) { - return dataGrid.addRangeChangeHandler(handler); - } - - @Override - public HandlerRegistration addRowCountChangeHandler(final RowCountChangeEvent.Handler handler) { - return dataGrid.addRowCountChangeHandler(handler); - } - - public int getColumnIndex(final Column column) { - return dataGrid.getColumnIndex(column); - } - - public HandlerRegistration addColumnSortHandler(final ColumnSortEvent.Handler handler) { - return this.dataGrid.addColumnSortHandler(handler); - } - - @Override - public int getRowCount() { - return dataGrid.getRowCount(); - } - - @Override - public void setRowCount(final int count) { - dataGrid.setRowCount(count); - } - - @Override - public Range getVisibleRange() { - return dataGrid.getVisibleRange(); - } - - @Override - public void setVisibleRange(final Range range) { - dataGrid.setVisibleRange(range); - } - - @Override - public boolean isRowCountExact() { - return dataGrid.isRowCountExact(); - } - - @Override - public void setRowCount(final int count, - final boolean isExact) { - dataGrid.setRowCount(count, - isExact); - } - - @Override - public void setVisibleRange(final int start, - final int length) { - dataGrid.setVisibleRange(start, - length); - } - - @Override - public SelectionModel getSelectionModel() { - return dataGrid.getSelectionModel(); - } - - @Override - public void setSelectionModel(final SelectionModel selectionModel) { - dataGrid.setSelectionModel(selectionModel); - } - - @Override - public T getVisibleItem(final int indexOnPage) { - return dataGrid.getVisibleItem(indexOnPage); - } - - @Override - public int getVisibleItemCount() { - return dataGrid.getVisibleItemCount(); - } - - @Override - public Iterable getVisibleItems() { - return dataGrid.getVisibleItems(); - } - - @Override - public void setRowData(final int start, - final List values) { - dataGrid.setRowData(start, - values); - redraw(); - } - - public void setRowData(final List values) { - dataGrid.setRowData(values); - redraw(); - } - - public void setSelectionModel(final SelectionModel selectionModel, - final CellPreviewEvent.Handler selectionEventManager) { - dataGrid.setSelectionModel(selectionModel, - selectionEventManager); - } - - @Override - public void setVisibleRangeAndClearData(final Range range, - final boolean forceRangeChangeEvent) { - dataGrid.setVisibleRangeAndClearData(range, - forceRangeChangeEvent); - } - - @Override - public void setHeight(final String height) { - dataGrid.setHeight(height); - } - - @Override - public void setPixelSize(final int width, - final int height) { - dataGrid.setPixelSize(width, - height); - } - - @Override - public void setSize(final String width, - final String height) { - dataGrid.setSize(width, - height); - } - - @Override - public void setWidth(final String width) { - dataGrid.setWidth(width); - } - - public void setColumnWidth(final Column column, - final double width, - final Style.Unit unit) { - dataGrid.setColumnWidth(column, - width, - unit); - getColumnPicker().adjustColumnWidths(); - } - - public void setToolBarVisible(final boolean visible) { - toolbarContainer.setVisible(visible); - } - - public ColumnSortList getColumnSortList() { - return dataGrid.getColumnSortList(); - } - - public HasWidgets getToolbar() { - return toolbarContainer; - } - - public HasWidgets getRightToolbar() { - return rightToolbar; - } - - public HasWidgets getRightActionsToolbar() { - return rightActionsToolbar; - } - - public HasWidgets getLeftToolbar() { - return leftToolbar; - } - - public HasWidgets getCenterToolbar() { - return centerToolbar; - } - - public void setRowStyles(final RowStyles styles) { - dataGrid.setRowStyles(styles); - } - - public void addTableTitle(String tableTitle) { - getLeftToolbar().add(new HTML("

        " + tableTitle + "

        ")); - } - - public void setAlwaysShowScrollBars(boolean alwaysShowScrollBars) { - dataGrid.setAlwaysShowScrollBars(alwaysShowScrollBars); - } - - public void addColumn(final Column column, - final String caption) { - addColumn(column, - caption, - true); - } - - public void addColumn(final Column column, - final String caption, - final boolean visible) { - ColumnMeta columnMeta = new ColumnMeta(column, - caption, - visible); - addColumn(columnMeta); - } - - public void addColumns(final List> columnMetas) { - for (ColumnMeta columnMeta : columnMetas) { - if (columnMeta.getHeader() == null) { - columnMeta.setHeader(getColumnHeader(columnMeta.getCaption(), - columnMeta.getColumn())); - } - } - getColumnPicker().addColumns(columnMetas); - } - - protected void addColumn(final ColumnMeta columnMeta) { - if (columnMeta.getHeader() == null) { - columnMeta.setHeader(getColumnHeader(columnMeta.getCaption(), - columnMeta.getColumn())); - } - getColumnPicker().addColumn(columnMeta); - } - - protected ResizableMovableHeader getColumnHeader(final String caption, - final Column column) { - final ResizableMovableHeader header = new ResizableMovableHeader(caption, - dataGrid, - columnPicker, - column) { - @Override - protected int getTableBodyHeight() { - return dataGrid.getOffsetHeight(); - } - }; - header.addColumnChangedHandler(new ColumnChangedHandler() { - @Override - public void afterColumnChanged() { - afterColumnChangedHandler(); - } - - @Override - public void beforeColumnChanged() { - - } - }); - return header; - } - - public void setColumnPickerButtonVisible(final boolean show) { - columnPickerButton.setVisible(show); - } - - protected void afterColumnChangedHandler() { - - } - - interface Binder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.ui.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.ui.xml deleted file mode 100644 index 0e722621b79..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTable.ui.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - .dataGridContainer { - padding-top: 10px; - padding-bottom: 10px; - } - - .horizontalContainer { - height: 32px; - } - - .rightToolBar { - float: right; - text-align: right; - } - - .centerToolBar { - text-align: center - } - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableCss.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableCss.java deleted file mode 100644 index 9d8d532db50..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableCss.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client.resources; - -import com.google.gwt.resources.client.CssResource; - -public interface UFTableCss - extends - CssResource { - - @ClassName("dataGrid") - String dataGrid(); - - @ClassName("dataGridRow") - String dataGridRow(); - - @ClassName("dataGridHeader") - String dataGridHeader(); - - @ClassName("dataGridContent") - String dataGridContent(); - - @ClassName("dataGridMain") - String dataGridMain(); - - @ClassName("columnPickerButton") - String columnPickerButton(); - - @ClassName("columnPickerPopup") - String columnPickerPopup(); - - ; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableResources.java deleted file mode 100644 index 335cfac1b4e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UFTableResources.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.ext.widgets.table.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; - -public interface UFTableResources - extends - ClientBundle { - - UFTableResources INSTANCE = GWT.create(UFTableResources.class); - - @Source("css/uftable.css") - UFTableCss CSS(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UberfireSimplePagerResources.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UberfireSimplePagerResources.java deleted file mode 100644 index 62f8dc3a257..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/UberfireSimplePagerResources.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client.resources; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.ImageResource; -import org.uberfire.ext.widgets.table.client.UberfireSimplePager; - -/** - * A ClientBundle that provides images for this widget. - */ -public interface UberfireSimplePagerResources - extends - ClientBundle { - - UberfireSimplePagerResources INSTANCE = GWT.create(UberfireSimplePagerResources.class); - - /** - * The image used to skip ahead multiple pages. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerFastForward.png") - ImageResource simplePagerFastForward(); - - /** - * The disabled "fast forward" image. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerFastForwardDisabled.png") - ImageResource simplePagerFastForwardDisabled(); - - /** - * The image used to go to the first page. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerFirstPage.png") - ImageResource simplePagerFirstPage(); - - /** - * The disabled first page image. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerFirstPageDisabled.png") - ImageResource simplePagerFirstPageDisabled(); - - /** - * The image used to go to the last page. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerLastPage.png") - ImageResource simplePagerLastPage(); - - /** - * The disabled last page image. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerLastPageDisabled.png") - ImageResource simplePagerLastPageDisabled(); - - /** - * The image used to go to the next page. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerNextPage.png") - ImageResource simplePagerNextPage(); - - /** - * The disabled next page image. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerNextPageDisabled.png") - ImageResource simplePagerNextPageDisabled(); - - /** - * The image used to go to the previous page. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerPreviousPage.png") - ImageResource simplePagerPreviousPage(); - - /** - * The disabled previous page image. - */ - @ImageResource.ImageOptions(flipRtl = true) - @Source("images/simplepager/simplePagerPreviousPageDisabled.png") - ImageResource simplePagerPreviousPageDisabled(); - - /** - * The styles used in this widget. - */ - @Source("css/UberfireSimplePager.css") - UberfireSimplePager.Style simplePagerStyle(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.java deleted file mode 100644 index b5ac67ae158..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/java/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client.resources.i18n; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.i18n.client.Messages; - -/** - * - */ -public interface CommonConstants - extends Messages { - - public static final CommonConstants INSTANCE = GWT.create(CommonConstants.class); - - String ColumnPickerButtonTooltip(); - - String Items(); - - String Of(); - - String Over(); -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/ErraiApp.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/ErraiApp.properties deleted file mode 100644 index 68590395344..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/ErraiApp.properties +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# ErraiApp.properties -# -# Do not remove, even if empty! -# - -# This is a marker file. When it is detected inside a JAR or at the -# top of any classpath, the subdirectories are scanned for deployable -# components. As such, all Errai application modules in a project -# should contain an ErraiApp.properties at the root of all classpaths -# that you wish to be scanned. -# -# There are also some configuration options that can be set in this -# file, although it is rarely necessary. See the documentation at -# https://docs.jboss.org/author/display/ERRAI/ErraiApp.properties -# for details. diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/beans.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/beans.xml deleted file mode 100644 index e9c1884ca09..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/UberfireTableWidget.gwt.xml b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/UberfireTableWidget.gwt.xml deleted file mode 100644 index aa838f37bc2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/UberfireTableWidget.gwt.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/UberfireSimplePager.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/UberfireSimplePager.css deleted file mode 100644 index f3e190f2430..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/UberfireSimplePager.css +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.pageDetails { - padding: 4px 8px; - text-align: center; -} - -.button { - padding: 4px; - cursor: pointer; - cursor: hand; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/uftable.css b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/uftable.css deleted file mode 100644 index 03571bf4e9c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/css/uftable.css +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 JBoss, by Red Hat, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -.dataGrid td div { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} - -.dataGridRow:first-child td { - border-top: none; -} -.dataGridHeader { -} - -.dataGridHeader thead th { - overflow: hidden; - text-overflow: ellipsis; -} - -.dataGridContent { - border-top: none; - margin-bottom: 0px; -} - -.dataGridMain { - width: 100%; - height: 300px; -} - -.columnPickerButton { -} - -.columnPickerPopup { - background-color: #ffffff; - padding: 5px; - border: 1px solid #d1d1d1; - z-index: 2000; -} - -@external .checkbox; - -.columnPickerPopup .checkbox { - margin-top: 2px; - margin-bottom: 2px; -} diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.properties deleted file mode 100644 index cf0a9230e70..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ColumnPickerButtonTooltip=Show/hide columns -Items=Items -Of=of -Over=over \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_de.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_de.properties deleted file mode 100644 index 5faaabd9ef1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_de.properties +++ /dev/null @@ -1,4 +0,0 @@ -ColumnPickerButtonTooltip=Spalten einblenden/ausblenden -Items=Posten -Of=von -Over=über diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_es.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_es.properties deleted file mode 100644 index 6dcaca23724..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_es.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ColumnPickerButtonTooltip=Mostrar/ocultar columnas -Items=Ítems -Of=de -Over=sobre \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_fr.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_fr.properties deleted file mode 100644 index ac5ebf7e19c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_fr.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ColumnPickerButtonTooltip=Afficher/masquer les colonnes -Items=Éléments -Of=de -Over=sur \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_ja.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_ja.properties deleted file mode 100644 index e3c9076abc3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_ja.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright 2015 JBoss, by Red Hat, Inc -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ColumnPickerButtonTooltip=カラムの表示/非表示 -Items=アイテム -Of=/ -Over=オーバー \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_pt_BR.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_pt_BR.properties deleted file mode 100644 index ef388ff6a1e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_pt_BR.properties +++ /dev/null @@ -1,4 +0,0 @@ -ColumnPickerButtonTooltip=Mostrar/ esconder colunas -Items=Itens -Of=de -Over=sobre diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_zh_CN.properties b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_zh_CN.properties deleted file mode 100644 index 572bfa3bf39..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/i18n/CommonConstants_zh_CN.properties +++ /dev/null @@ -1,4 +0,0 @@ -ColumnPickerButtonTooltip=显示/隐藏列 -Items=条目 -Of=之 -Over=超出 diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForward.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForward.png deleted file mode 100644 index b6327acb221..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForward.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForwardDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForwardDisabled.png deleted file mode 100644 index 8f6b5ba763e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFastForwardDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPage.png deleted file mode 100644 index 13a2ba296d3..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPageDisabled.png deleted file mode 100644 index 645d305f2a5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerFirstPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPage.png deleted file mode 100644 index db4f865c95a..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPageDisabled.png deleted file mode 100644 index 72cea52f0bf..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerLastPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPage.png deleted file mode 100644 index a0879b6eca5..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPageDisabled.png deleted file mode 100644 index 9f40e9106ba..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerNextPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPage.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPage.png deleted file mode 100644 index d4f15a1fa9e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPage.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png deleted file mode 100644 index aca6318de1e..00000000000 Binary files a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/main/resources/org/uberfire/ext/widgets/table/client/resources/images/simplepager/simplePagerPreviousPageDisabled.png and /dev/null differ diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireColumnPickerTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireColumnPickerTest.java deleted file mode 100644 index f3e73ee6dd1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireColumnPickerTest.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -import java.util.Arrays; - -import com.google.gwt.cell.client.CheckboxCell; -import com.google.gwt.cell.client.TextCell; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwt.user.cellview.client.Header; -import com.google.gwt.user.cellview.client.TextHeader; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwtmockito.GwtMock; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.gwtbootstrap3.client.ui.gwt.DataGrid; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class UberfireColumnPickerTest { - - @Mock - protected org.gwtbootstrap3.client.ui.gwt.DataGrid dataGrid; - @GwtMock - VerticalPanel popupContent; - @InjectMocks - private UberfireColumnPicker uberfireColumnPicker; - private ColumnMeta columnMetaTextCell1; - private ColumnMeta columnMetaTextCell2; - private ColumnMeta columnMetaCheckBoxCell; - - @Before - public void setup() { - columnMetaTextCell1 = createColumnTextCell("val1", "col1"); - columnMetaTextCell2 = createColumnTextCell("val2", "col2"); - columnMetaCheckBoxCell = createColumnCheckboxCell("columnMetaCheckBoxCell"); - uberfireColumnPicker.addColumn(columnMetaCheckBoxCell); - uberfireColumnPicker.addColumn(columnMetaTextCell1); - uberfireColumnPicker.addColumn(columnMetaTextCell2); - } - - @Test - public void testAddThisColumnToPopup() { - assertTrue(uberfireColumnPicker.addThisColumnToPopup(columnMetaTextCell1)); - assertFalse(uberfireColumnPicker.addThisColumnToPopup(columnMetaCheckBoxCell)); - } - - @Test - public void testOnlyAddHeaderStringColumnPickerPopup() { - uberfireColumnPicker.showColumnPickerPopup(0, 0); - verify(popupContent, times(2)).add(any()); - } - - private ColumnMeta createColumnMeta(final String value, - final String dataStoreName, - boolean isVisible, - boolean isVisibleIndex, - int position) { - - final Header header = new TextHeader(value); - ColumnMeta columnMeta = new ColumnMeta(createColumn(value, dataStoreName), dataStoreName); - columnMeta.setHeader(header); - columnMeta.setVisible(isVisible); - columnMeta.setVisibleIndex(isVisibleIndex); - columnMeta.setPosition(position); - return columnMeta; - } - - private Column createColumn(final String value, final String dataStoreName) { - Column testColumn = new Column(new TextCell()) { - @Override - public String getValue(String object) { - return value; - } - }; - testColumn.setSortable(true); - testColumn.setDataStoreName(dataStoreName); - - return testColumn; - } - - private ColumnMeta createColumnTextCell(final String value, String dataStoreName) { - - return createColumnMeta(value, dataStoreName, true, true, -1); - } - - private ColumnMeta createColumnCheckboxCell(String dataStoreName) { - CheckboxCell checkboxCell = new CheckboxCell(true, false); - Column checkColumn = new Column(checkboxCell) { - @Override - public Boolean getValue(String object) { - return true; - } - }; - - Header selectPageHeader = new Header(checkboxCell) { - @Override - public Boolean getValue() { - return true; - } - }; - - checkColumn.setSortable(false); - checkColumn.setDataStoreName(dataStoreName); - ColumnMeta checkColMeta = new ColumnMeta(checkColumn, ""); - checkColMeta.setHeader(selectPageHeader); - return checkColMeta; - } - - @Test - public void testAddColumnBeforeActionsOnAddColumnOnDataGrid() { - UberfireColumnPicker columnPicker = new UberfireColumnPicker<>(new DataGrid<>()); - ColumnMeta name = createColumnMeta("Name", "name", true, true, -1); - ColumnMeta age = createColumnMeta("Age", "age", true, true, -1); - ColumnMeta description = createColumnMeta("Description", "description", false, true, -1); - ColumnMeta actions = createColumnMeta("Actions", "actions", true, false, -1); - ColumnMeta etc = createColumnMeta("Etc", "etc", false, true, -1); - - columnPicker.addColumn(name); - columnPicker.addColumn(age); - columnPicker.addColumn(description); - columnPicker.addColumn(actions); - columnPicker.addColumn(etc); - - assertEquals(3, columnPicker.getDataGrid().getColumnCount()); - assertEquals("name", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); - assertEquals("age", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - - columnPicker.addColumnOnDataGrid(true, etc); - - assertEquals(4, columnPicker.getDataGrid().getColumnCount()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); - - columnPicker.addColumnOnDataGrid(true, description); - - assertEquals(5, columnPicker.getDataGrid().getColumnCount()); - assertEquals("description", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(4).getDataStoreName()); - } - - @Test - public void testAddColumnBeforeActionsOnAddColumn() { - UberfireColumnPicker columnPicker = new UberfireColumnPicker<>(new DataGrid<>()); - ColumnMeta name = createColumnMeta("Name", "name", true, true, -1); - ColumnMeta age = createColumnMeta("Age", "age", true, true, -1); - ColumnMeta description = createColumnMeta("Description", "description", false, true, -1); - ColumnMeta actions = createColumnMeta("Actions", "actions", true, false, -1); - ColumnMeta etc = createColumnMeta("Etc", "etc", true, true, -1); - - columnPicker.addColumn(name); - columnPicker.addColumn(age); - columnPicker.addColumn(description); - columnPicker.addColumn(actions); - columnPicker.addColumn(etc); - - assertEquals(4, columnPicker.getDataGrid().getColumnCount()); - assertEquals("name", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); - assertEquals("age", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); - - ColumnMeta comment = createColumnMeta("comment", "comment", true, true, -1); - columnPicker.addColumn(comment); - assertEquals(5, columnPicker.getDataGrid().getColumnCount()); - assertEquals("name", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); - assertEquals("age", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - assertEquals("comment", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(4).getDataStoreName()); - } - - @Test - public void testAddColumns() { - UberfireColumnPicker columnPicker = new UberfireColumnPicker<>(new DataGrid<>()); - ColumnMeta name = createColumnMeta("Name", "name", true, true, 0); - ColumnMeta age = createColumnMeta("Age", "age", true, true, 3); - ColumnMeta description = createColumnMeta("Description", "description", false, true, 1); - ColumnMeta actions = createColumnMeta("Actions", "actions", true, false, 2); - ColumnMeta etc = createColumnMeta("Etc", "etc", true, true, 4); - - columnPicker.addColumns(Arrays.asList(name, age, description, actions, etc)); - - assertEquals(4, columnPicker.getDataGrid().getColumnCount()); - assertEquals("name", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); - assertEquals("age", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(3).getDataStoreName()); - } - - @Test - public void testRemoveColumns() { - UberfireColumnPicker columnPicker = new UberfireColumnPicker<>(new DataGrid<>()); - ColumnMeta name = createColumnMeta("Name", "name", true, true, 0); - ColumnMeta age = createColumnMeta("Age", "age", true, true, 3); - ColumnMeta description = createColumnMeta("Description", "description", false, true, 1); - ColumnMeta actions = createColumnMeta("Actions", "actions", true, false, 2); - ColumnMeta etc = createColumnMeta("Etc", "etc", true, true, 4); - - columnPicker.addColumns(Arrays.asList(name, age, description, actions, etc)); - - columnPicker.removeColumn(name); - columnPicker.removeColumn(description); - - assertEquals(3, columnPicker.getDataGrid().getColumnCount()); - assertEquals("age", columnPicker.getDataGrid().getColumn(0).getDataStoreName()); - assertEquals("etc", columnPicker.getDataGrid().getColumn(1).getDataStoreName()); - assertEquals("actions", columnPicker.getDataGrid().getColumn(2).getDataStoreName()); - } -} - diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTableTest.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTableTest.java deleted file mode 100644 index 9def14b6f8e..00000000000 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-table/src/test/java/org/uberfire/ext/widgets/table/client/UberfireSimpleTableTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.ext.widgets.table.client; - -import com.google.gwt.cell.client.TextCell; -import com.google.gwt.dom.client.Style; -import com.google.gwt.user.cellview.client.Column; -import com.google.gwtmockito.GwtMockitoTestRunner; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; - -import static org.mockito.Mockito.verify; - -@RunWith(GwtMockitoTestRunner.class) -public class UberfireSimpleTableTest { - - @Mock - protected UberfireColumnPicker columnPickerMock; - - @InjectMocks - private UberfireSimpleTable uberfireSimpleTable; - - @Before - public void setup() { - - } - - @Test - public void testSetColumnWidth() { - Column testColumn = new Column(new TextCell()) { - @Override - public String getValue(String object) { - return "col1"; - } - }; - uberfireSimpleTable.setColumnPicker(columnPickerMock); - uberfireSimpleTable.setColumnWidth(testColumn, - 35, - Style.Unit.PX); - verify(columnPickerMock).adjustColumnWidths(); - } -} - diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/pom.xml b/packages/dashbuilder/appformer/uberfire-testing-utils/pom.xml deleted file mode 100644 index fcfe43bc188..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/pom.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-parent - ${revision} - ../pom.xml - - - uberfire-testing-utils - jar - - UberFire Testing Utils - UberFire Testing Utils - - - - - org.jboss.errai - errai-ioc - - - - org.jboss.errai - errai-common - - - - org.jboss.errai - errai-marshalling - - - - com.google.gwt - gwt-user - provided - - - - org.uberfire - uberfire-api - - - - org.uberfire - uberfire-client-api - - - - org.mockito - mockito-core - - - - com.google.guava - guava - - - - com.google.elemental2 - elemental2-promise - - - - commons-io - commons-io - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerMock.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerMock.java deleted file mode 100644 index a14d14ea0b4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerMock.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import java.lang.reflect.Proxy; - -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; - -public class CallerMock implements Caller { - - private T callerProxy; - private RemoteCallback successCallBack; - private ErrorCallback errorCallBack; - - public CallerMock(T t) { - callerProxy = (T) CallerProxy.newInstance(t); - } - - @Override - public T call() { - final CallerProxy localProxy = ((CallerProxy) Proxy.getInvocationHandler(callerProxy)); - localProxy.setSuccessCallBack(null); - localProxy.setErrorCallBack(null); - return callerProxy; - } - - @Override - public T call(RemoteCallback remoteCallback) { - final CallerProxy localProxy = ((CallerProxy) Proxy.getInvocationHandler(callerProxy)); - localProxy.setSuccessCallBack((RemoteCallback) remoteCallback); - localProxy.setErrorCallBack(null); - return callerProxy; - } - - @Override - public T call(RemoteCallback remoteCallback, - ErrorCallback errorCallback) { - final CallerProxy localProxy = ((CallerProxy) Proxy.getInvocationHandler(callerProxy)); - localProxy.setSuccessCallBack((RemoteCallback) remoteCallback); - localProxy.setErrorCallBack((ErrorCallback) errorCallback); - - return callerProxy; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerProxy.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerProxy.java deleted file mode 100644 index 74a800b4a34..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/CallerProxy.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -import com.google.common.base.Defaults; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; - -public class CallerProxy implements java.lang.reflect.InvocationHandler { - - private Object target; - private RemoteCallback successCallBack; - private ErrorCallback errorCallBack; - - private CallerProxy(final Object target) { - this.target = target; - } - - static Object newInstance(final Object target) { - return java.lang.reflect.Proxy.newProxyInstance(target.getClass().getClassLoader(), - target - .getClass().getInterfaces(), - new CallerProxy(target)); - } - - public void setSuccessCallBack(final RemoteCallback successCallBack) { - this.successCallBack = successCallBack; - } - - public void setErrorCallBack(final ErrorCallback errorCallBack) { - this.errorCallBack = errorCallBack; - } - - public Object invoke(final Object proxy, - final Method m, - final Object[] args) throws Throwable { - Object result = null; - try { - result = m.invoke(target, - args); - } catch (Exception e) { - if (errorCallBack != null) { - if (e instanceof InvocationTargetException) { - errorCallBack.error(result, - ((InvocationTargetException) e).getTargetException()); - } else { - errorCallBack.error(result, - e); - } - } - if (m.getReturnType().isPrimitive()) { - return Defaults.defaultValue(m.getReturnType()); - } else { - return result; - } - } - if (successCallBack != null) { - successCallBack.callback(result); - } - return result; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ConstantsAnswerMock.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ConstantsAnswerMock.java deleted file mode 100644 index ab1b99d4560..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ConstantsAnswerMock.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import org.mockito.invocation.InvocationOnMock; -import org.mockito.stubbing.Answer; - -import static org.mockito.Mockito.RETURNS_DEFAULTS; - -public class ConstantsAnswerMock implements Answer { - - /** - * Mockito Answer to be used when mocking GWT constants classes. - * @param invocation - * @return The method name as a String - * @throws Throwable - */ - @Override - public Object answer(final InvocationOnMock invocation) throws Throwable { - if (String.class.equals(invocation.getMethod().getReturnType())) { - return invocation.getMethod().getName(); - } else { - return RETURNS_DEFAULTS.answer(invocation); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/EventSourceMock.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/EventSourceMock.java deleted file mode 100644 index 2fc5ee5ad2b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/EventSourceMock.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import java.lang.annotation.Annotation; -import java.util.concurrent.CompletionStage; - -import javax.enterprise.event.Event; -import javax.enterprise.event.NotificationOptions; -import javax.enterprise.util.TypeLiteral; - -public class EventSourceMock implements Event { - - @Override - public void fire(T event) { - throw new UnsupportedOperationException("mocking testing class"); - } - - @Override - public Event select(Annotation... qualifiers) { - throw new UnsupportedOperationException("mocking testing class"); - } - - @Override - public Event select(Class subtype, - Annotation... qualifiers) { - throw new UnsupportedOperationException("mocking testing class"); - } - - @Override - public CompletionStage fireAsync(U event) { - throw new UnsupportedOperationException("mocking testing class"); - } - - @Override - public CompletionStage fireAsync(U event, NotificationOptions options) { - throw new UnsupportedOperationException("mocking testing class"); - } - - @Override - public Event select(TypeLiteral subtype, Annotation... qualifiers) { - throw new UnsupportedOperationException("mocking testing class"); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/IocTestingUtils.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/IocTestingUtils.java deleted file mode 100644 index 6fb02ca8410..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/IocTestingUtils.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import org.jboss.errai.ioc.client.container.SyncBeanDef; -import org.jboss.errai.ioc.client.container.SyncBeanManager; - -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.doAnswer; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.mock; - -/** - * Utility class to SyncBeanManager mocking. - */ -public class IocTestingUtils { - - /** - * Mocks a SyncBeanManager to return a mocked bean when lookupBean is called. - * @param iocManager - */ - public static void mockIocManager(SyncBeanManager iocManager) { - doAnswer(invocationOnMock -> createSyncBeanDef((Class) invocationOnMock.getArguments()[0])) - .when(iocManager).lookupBean(any(Class.class)); - } - - private static SyncBeanDef createSyncBeanDef(Class clazz) { - final SyncBeanDef syncBeanDef = mock(SyncBeanDef.class); - doReturn(mock(clazz)).when(syncBeanDef).getInstance(); - doReturn(mock(clazz)).when(syncBeanDef).newInstance(); - - return syncBeanDef; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/MockInstanceImpl.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/MockInstanceImpl.java deleted file mode 100644 index 35c93e5d8fd..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/MockInstanceImpl.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.mocks; - -import java.lang.annotation.Annotation; -import java.util.Iterator; - -import javax.enterprise.inject.Instance; -import javax.enterprise.util.TypeLiteral; - -import com.google.common.collect.Iterators; - -public class MockInstanceImpl implements Instance { - - private final T[] instances; - - public MockInstanceImpl(T... instance) { - this.instances = instance; - } - - @Override - public Instance select(Annotation... annotations) { - return null; - } - - @Override - public boolean isUnsatisfied() { - return false; - } - - @Override - public boolean isAmbiguous() { - return false; - } - - @Override - public void destroy(T instance) { - - } - - @Override - public Instance select(Class aClass, - Annotation... annotations) { - return null; - } - - @Override - public Iterator iterator() { - return Iterators.forArray(this.instances); - } - - @Override - public T get() { - return instances[0]; - } - - @Override - public Instance select(TypeLiteral subtype, Annotation... qualifiers) { - return null; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ParametrizedCommandMock.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ParametrizedCommandMock.java deleted file mode 100644 index 2a881c89040..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/mocks/ParametrizedCommandMock.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.uberfire.mocks; - -import org.mockito.stubbing.Stubber; -import org.uberfire.mvp.ParameterizedCommand; - -import static org.mockito.Mockito.doAnswer; - -public class ParametrizedCommandMock { - - - public static Stubber executeParametrizedCommandWith(int paramIndex, T value) { - return doAnswer(ans -> { - ParameterizedCommand callback = (ParameterizedCommand) ans.getArguments()[paramIndex]; - callback.execute(value); - return null; - }); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/promise/SyncPromises.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/promise/SyncPromises.java deleted file mode 100644 index 8a1aaf57641..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/main/java/org/uberfire/promise/SyncPromises.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.promise; - -import elemental2.promise.IThenable; -import elemental2.promise.Promise; -import org.uberfire.client.promise.Promises; - -import static org.uberfire.promise.SyncPromises.Status.PENDING; -import static org.uberfire.promise.SyncPromises.Status.REJECTED; -import static org.uberfire.promise.SyncPromises.Status.RESOLVED; - -public class SyncPromises extends Promises { - - @Override - public Promise create(final Promise.PromiseExecutorCallbackFn executor) { - return new SyncPromise<>(executor); - } - - public static class SyncPromise extends Promise { - - public Status status; - public T value; - - private SyncPromise(final PromiseExecutorCallbackFn executor) { - super(executor); - status = PENDING; - executor.onInvoke(new Resolver(), new Rejecter()); - } - - @Override - @SuppressWarnings("unchecked") - public Promise then(final ThenOnFulfilledCallbackFn onFulfilled) { - try { - if (status == RESOLVED) { - return (SyncPromise) onFulfilled.onInvoke(value); - } else { - return new SyncPromise<>((res, rej) -> rej.onInvoke(value)); - } - } catch (final Exception e) { - return new SyncPromise<>((res, rej) -> rej.onInvoke(e)); - } - } - - @Override - @SuppressWarnings("unchecked") - public Promise catch_(final CatchOnRejectedCallbackFn onRejected) { - try { - if (status == REJECTED) { - return (SyncPromise) onRejected.onInvoke(this.value); - } else { - return new SyncPromise<>((res, rej) -> res.onInvoke((V) value)); - } - } catch (final Exception e) { - return new SyncPromise<>((res, rej) -> rej.onInvoke(e)); - } - } - - private class Resolver implements PromiseExecutorCallbackFn.ResolveCallbackFn { - - @Override - public void onInvoke(final T value) { - resolve(value); - } - - @Override - public void onInvoke(final IThenable thenable) { - if (thenable == null) { - value = null; - } else { - thenable.then(v -> { - value = v; - return SyncPromise.resolve(v); - }); - } - status = RESOLVED; - } - - @Override - public void onInvoke(final ResolveUnionType value) { - throw new RuntimeException("Not supported"); - } - - private void resolve(final T v) { - value = v; - status = RESOLVED; - } - } - - private class Rejecter implements PromiseExecutorCallbackFn.RejectCallbackFn { - - @Override - @SuppressWarnings("unchecked") - public void onInvoke(final Object error) { - value = (T) error; - status = REJECTED; - } - } - } - - public enum Status { - PENDING, - RESOLVED, - REJECTED; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/CallerMockTest.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/CallerMockTest.java deleted file mode 100644 index 86c0a14478c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/CallerMockTest.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.Caller; -import org.jboss.errai.common.client.api.ErrorCallback; -import org.jboss.errai.common.client.api.RemoteCallback; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.junit.MockitoJUnitRunner; - -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.anyString; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - -@RunWith(MockitoJUnitRunner.class) -public class CallerMockTest { - - SampleTarget sampleTarget; - RemoteCallback successCallBack; - ErrorCallback errorCallBack; - private CallerMock callerMock; - private CallerSampleClient callerSample; - - @Before - public void setup() { - - sampleTarget = mock(SampleTarget.class); - successCallBack = mock(RemoteCallback.class); - errorCallBack = mock(ErrorCallback.class); - } - - @Test - public void callerSampleTest() { - - callerMock = new CallerMock(sampleTarget); - callerSample = new CallerSampleClient(callerMock); - - callerSample.targetCall(); - verify(sampleTarget).targetCall(); - - verify(successCallBack, - never()).callback(anyString()); - verify(errorCallBack, - never()).error(anyString(), - any(SampleException.class)); - } - - @Test - public void callerSampleCallBackSuccessTest() { - when(sampleTarget.targetCall()).thenReturn("callback"); - - callerMock = new CallerMock(sampleTarget); - callerSample = new CallerSampleClient(callerMock, - successCallBack, - errorCallBack); - - callerSample.targetCallWithSuccessCallBack(); - - verify(sampleTarget).targetCall(); - verify(successCallBack).callback("callback"); - verify(errorCallBack, - never()).error(anyString(), - any(SampleException.class)); - } - - @Test - public void callerSampleCallBackErrorTest() throws SampleException { - when(sampleTarget.targetCallWithCheckedException()).thenThrow(SampleException.class); - - callerMock = new CallerMock(sampleTarget); - callerSample = new CallerSampleClient(callerMock, - successCallBack, - errorCallBack); - - callerSample.targetCallWithSuccessAndErrorCallBackCheckedException(); - - verify(sampleTarget).targetCallWithCheckedException(); - verify(errorCallBack).error(any(), - any(SampleException.class)); - verify(successCallBack, - never()).callback(anyString()); - } - - @Test - public void callerSampleCallBackPrimitiveTypeTest() throws SampleException { - when(sampleTarget.targetPrimitiveType()).thenThrow(SampleException.class); - - callerMock = new CallerMock(sampleTarget); - callerSample = new CallerSampleClient(callerMock, - successCallBack, - errorCallBack); - - callerSample.targetPrimitiveType(); - - verify(sampleTarget).targetPrimitiveType(); - verify(errorCallBack).error(any(), - any(SampleException.class)); - verify(successCallBack, - never()).callback(anyString()); - } - - @Test - public void callerSampleCallBackErrorbyRunTimeExceptionTest() { - SampleTarget target = new SampleTarget() { - @Override - public String targetCall() { - throw new RuntimeException(); - } - - @Override - public String targetCallWithCheckedException() throws SampleException { - return null; - } - - @Override - public long targetPrimitiveType() { - return 0; - } - }; - - callerMock = new CallerMock(target); - callerSample = new CallerSampleClient(callerMock, - successCallBack, - errorCallBack); - - callerSample.targetCallWithSuccessAndErrorCallBack(); - - verify(successCallBack, - never()).callback(anyString()); - verify(errorCallBack).error(any(), - any(RuntimeException.class)); - } - - @Test - public void callerMockitoCallBackErrorbyRunTimeExceptionTest() { - - SampleTarget target = mock(SampleTarget.class); - when(target.targetCall()).thenThrow(new RuntimeException()); - - callerMock = new CallerMock<>(target); - callerSample = new CallerSampleClient(callerMock, - successCallBack, - errorCallBack); - - callerSample.targetCallWithSuccessAndErrorCallBack(); - - verify(successCallBack, - never()).callback(anyString()); - verify(errorCallBack).error(any(), - any(RuntimeException.class)); - } - - private interface SampleTarget { - - String targetCall(); - - String targetCallWithCheckedException() throws SampleException; - - long targetPrimitiveType(); - } - - private class CallerSampleClient { - - private RemoteCallback successCallBack; - private ErrorCallback errorCallBack; - private Caller caller; - - @Inject - public CallerSampleClient(Caller caller) { - this.caller = caller; - } - - public CallerSampleClient(CallerMock callerMock, - RemoteCallback successCallBack, - ErrorCallback errorCallBack) { - - this.caller = callerMock; - this.successCallBack = successCallBack; - this.errorCallBack = errorCallBack; - } - - public void targetCall() { - caller.call().targetCall(); - } - - public void targetCallWithSuccessCallBack() { - caller.call(successCallBack).targetCall(); - } - - public void targetCallWithSuccessAndErrorCallBack() { - caller.call(successCallBack, - errorCallBack).targetCall(); - } - - public void targetCallWithSuccessAndErrorCallBackCheckedException() throws SampleException { - caller.call(successCallBack, - errorCallBack).targetCallWithCheckedException(); - } - - public long targetPrimitiveType() { - return caller.call(successCallBack, - errorCallBack).targetPrimitiveType(); - } - } - - private class SampleException extends RuntimeException { - - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ConstantsAnswerMockTest.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ConstantsAnswerMockTest.java deleted file mode 100644 index d848d860777..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ConstantsAnswerMockTest.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNull; -import static org.mockito.Mockito.mock; - -public class ConstantsAnswerMockTest { - - @Test - public void callMethodWithStringReturnTypeTest() { - MockInterface mockedInterface = mock(MockInterface.class, - new ConstantsAnswerMock()); - - assertEquals("stringMethod", - mockedInterface.stringMethod()); - } - - @Test - public void callMethodWithOtherReturnTypesTest() { - MockInterface mockedInterface = mock(MockInterface.class, - new ConstantsAnswerMock()); - - assertEquals(0, - mockedInterface.intMethod()); - assertEquals(false, - mockedInterface.booleanMethod()); - assertNull(mockedInterface.objectMethod()); - } - - interface MockInterface { - - String stringMethod(); - - int intMethod(); - - boolean booleanMethod(); - - MockInterface objectMethod(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/IocTestingUtilsTest.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/IocTestingUtilsTest.java deleted file mode 100644 index a80bd0ce469..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/IocTestingUtilsTest.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.mocks; - -import org.jboss.errai.ioc.client.container.SyncBeanManager; -import org.junit.Test; - -import static org.junit.Assert.assertNotNull; -import static org.mockito.Mockito.mock; - -public class IocTestingUtilsTest { - - private SyncBeanManager iocManager; - - @Test - public void mockIocManagerTest() { - iocManager = mock(SyncBeanManager.class); - IocTestingUtils.mockIocManager(iocManager); - - assertNotNull(iocManager.lookupBean(Object.class).getInstance()); - assertNotNull(iocManager.lookupBean(Object.class).newInstance()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ParametrizedCommandMockTest.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ParametrizedCommandMockTest.java deleted file mode 100644 index 61245a57882..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/mocks/ParametrizedCommandMockTest.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.uberfire.mocks; - -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; -import org.uberfire.mvp.ParameterizedCommand; - -import static org.junit.Assert.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.uberfire.mocks.ParametrizedCommandMock.executeParametrizedCommandWith; - -@RunWith(MockitoJUnitRunner.class) -public class ParametrizedCommandMockTest { - - - private static final String TEST_STR = "TEST"; - private static final String NOT_A_TEST_STR = "NOT A TEST STR"; - - @Mock - UsesParametrizedCommand usesParametrizedCommand; - - @Before - public void setup() { - executeParametrizedCommandWith(0, new Foo(TEST_STR)) - .when(usesParametrizedCommand) - .theKindOfMethodYouWantToMock(any(ParameterizedCommand.class)); - } - - @Test - public void testParametrizedCommandMockTest() { - usesParametrizedCommand - .theKindOfMethodYouWantToMock(foo -> assertEquals(TEST_STR, foo.getStr())); - } - - public static class Foo { - private String str; - - public Foo(String str) { - super(); - this.str = str; - } - - public String getStr() { - return str; - } - } - - public static class UsesParametrizedCommand { - - public void theKindOfMethodYouWantToMock(ParameterizedCommand cmd) { - cmd.execute(new Foo(NOT_A_TEST_STR)); - } - } - -} diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/promise/SyncPromisesTest.java b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/promise/SyncPromisesTest.java deleted file mode 100644 index 86c7228dc3b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/java/org/uberfire/promise/SyncPromisesTest.java +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package org.uberfire.promise; - -import java.util.Arrays; -import java.util.List; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Supplier; - -import elemental2.promise.Promise; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; -import static org.uberfire.promise.SyncPromises.Status.REJECTED; -import static org.uberfire.promise.SyncPromises.Status.RESOLVED; - -public class SyncPromisesTest { - - private final SyncPromises promises = new SyncPromises(); - - @Test - public void testBasicChaining() { - final Promise p = promises.resolve("a").then(a -> { - assertTrue("a".equals(a)); - return promises.resolve("b"); - }).then(b -> { - assertTrue("b".equals(b)); - return promises.resolve(2); - }).catch_(err -> { - fail("Catch should've not been called"); - return promises.resolve(5); - }).then(two -> { - assertTrue(two == 2); - return promises.resolve(3); - }); - - final SyncPromises.SyncPromise sp = (SyncPromises.SyncPromise) p; - assertTrue(sp.value == 3); - assertTrue(sp.status == RESOLVED); - } - - @Test - public void testErrorHandling() { - final Promise p = promises.resolve("a").then(a -> { - assertTrue("a".equals(a)); - return promises.reject("b"); - }).then(b -> { - fail("This 'then' should've been jumped over"); - return promises.resolve(2); - }).catch_(err -> { - assertTrue("b" == err); - return promises.resolve(5); - }).then(five -> { - assertTrue(five == 5); - return promises.reject(8L); - }); - - final SyncPromises.SyncPromise sp = (SyncPromises.SyncPromise) p; - assertTrue(sp.value == 8L); - assertTrue(sp.status == REJECTED); - } - - @Test - public void testErrorHandlingDoubleRejection() { - final Promise p = promises.resolve("a").then(a -> { - assertTrue("a".equals(a)); - return promises.reject("b"); - }).catch_(err -> { - assertTrue("b" == err); - return promises.reject('4'); - }).catch_(four -> { - assertTrue(four.equals('4')); - return promises.resolve(12); - }); - - final SyncPromises.SyncPromise sp = (SyncPromises.SyncPromise) p; - assertTrue(sp.value == 12); - assertTrue(sp.status == RESOLVED); - } - - @Test - public void testErrorHandlingWhenExceptionOccurs() { - final RuntimeException te = new RuntimeException("Test exception"); - - final Promise p = promises.resolve("a").then(a -> { - throw te; - }).then(i -> { - fail("This 'then' should've been jumped over"); - return promises.resolve(); - }).catch_(err -> { - assertEquals(err, te); - return promises.resolve(17); - }); - - final SyncPromises.SyncPromise sp = (SyncPromises.SyncPromise) p; - assertTrue(sp.value == 17); - assertTrue(sp.status == RESOLVED); - } - - @Test - public void testAllWithOneRejection() { - final Promise resolved1 = promises.resolve(1); - final Promise resolved2 = promises.resolve(2); - final Promise rejected = promises.reject(0); - - Arrays.asList( - this.promises.all(rejected, resolved1, resolved2), - this.promises.all(resolved2, rejected, resolved1), - this.promises.all(resolved1, resolved2, rejected)).forEach(p -> { - p.then(i -> { - fail("Promise should've not been resolved!"); - return this.promises.resolve(); - }).catch_(zero -> { - assertEquals(0, zero); - return this.promises.resolve(); - }); - }); - } - - @Test - public void testAllWithNoRejections() { - final Promise resolved1 = promises.resolve(1); - final Promise resolved2 = promises.resolve(2); - final Promise resolved3 = promises.resolve(3); - - promises.all(resolved1, resolved2, resolved3).then(i -> { - assertEquals((Integer) 3, i); - return promises.resolve(); - }).catch_(e -> { - fail("Promise should've been resolved!"); - return promises.resolve(); - }); - } - - @Test - public void testAllMappingWithNoRejections() { - promises.all(Arrays.asList(1, 2, 3, 4), promises::resolve).then(i -> { - assertEquals((Integer) 4, i); - return promises.resolve(); - }).catch_(e -> { - fail("Promise should've not been resolved!"); - return promises.resolve(); - }); - } - - @Test - public void testAllMappingWithOneRejection() { - promises.all(Arrays.asList(1, 2, 3, 4), i -> i == 3 ? promises.reject(i) : promises.resolve(i)).then(i -> { - fail("Promise should've not been resolved!"); - return promises.resolve(); - }).catch_(e -> { - assertEquals(3, e); - return promises.resolve(); - }); - } - - @Test - public void testReduceLazilyWithNoRejections() { - - final AtomicInteger sum = new AtomicInteger(0); - - promises.reduceLazily(Arrays.asList(1, 2, 4, 8), i -> promises.resolve().then(e -> { - assertTrue(sum.get() < i); - sum.addAndGet(i); - return promises.resolve(i); - })).then(i -> { - assertEquals((Integer) 8, i); - return promises.resolve(); - }).catch_(e -> { - fail("Promise should've been resolved!"); - return promises.resolve(); - }).then(ignore -> { - assertEquals((Integer) 15, (Integer) sum.get()); - return promises.resolve(); - }); - } - - @Test - public void testReduceLazilyWithOneRejection() { - - final AtomicInteger sum = new AtomicInteger(0); - - promises.reduceLazily(Arrays.asList(1, 2, 4, 8), i -> i == 4 ? promises.reject(4) : promises.resolve().then(e -> { - assertTrue(sum.get() < i); - sum.addAndGet(i); - return promises.resolve(i); - })).then(i -> { - fail("Promise should've not been resolved!"); - return promises.resolve(); - }).catch_(e -> { - assertEquals((Integer) 4, e); - return promises.resolve(); - }).then(ignore -> { - assertEquals((Integer) 3, (Integer) sum.get()); - return promises.resolve(); - }); - } - - @Test - public void testReduceLazilyChainingWithNoInterruptions() { - - final AtomicInteger sum = new AtomicInteger(0); - - promises.reduceLazilyChaining(Arrays.asList(1, 2, 4, 8, 16), (chain, i) -> { - assertTrue(sum.get() < i); - sum.addAndGet(i); - return promises.resolve(i); - }).catch_(e -> { - fail("Promise should've been resolved!"); - return promises.resolve(); - }).then(chainResult -> { - assertEquals((Integer) 16, chainResult); - assertEquals((Integer) 31, (Integer) sum.get()); - return promises.resolve(); - }); - } - - @Test - @SuppressWarnings("unchecked") - public void testReduceLazilyChainingWithInterruption() { - - final AtomicInteger sum = new AtomicInteger(0); - - promises.reduceLazilyChaining(Arrays.asList(1, 2, 4, 8, 16), (chain, i) -> { - if (i == 4) { - // Skips the '4' step - return promises.reject(chain); - } else { - assertTrue(sum.get() < i); - sum.addAndGet(i); - return promises.resolve(i); - } - }).then(invalid -> { - fail("Promise should've not been resolved!"); - return promises.resolve(); - }).catch_(chain -> { - assertEquals((Integer) 3, (Integer) sum.get()); - return ((Supplier>) chain).get(); - }).then(chainResult -> { - assertNull(chainResult); - assertEquals((Integer) 27, (Integer) sum.get()); - return promises.resolve(); - }).catch_(e -> { - fail("Promise should've been resolved!"); - return promises.resolve(); - }); - } - - @Test - public void reduceWithOrIsTrueOperatorTest() { - final List> promisesToReduce = Arrays.asList(promises.resolve(true), - promises.resolve(false)); - promises.reduce(promises.resolve(false), promisesToReduce, (p1, p2) -> p1.then(resultP1 -> p2.then(resultP2 -> this.promises.resolve(resultP1 || resultP2)))).then(resultIsTrue -> { - assertTrue(resultIsTrue); - return promises.resolve(); - }); - } - - @Test - public void reduceWithOrIsFalseOperatorTest() { - final List> promisesToReduce = Arrays.asList(promises.resolve(false), - promises.resolve(false)); - promises.reduce(promises.resolve(false), promisesToReduce, (p1, p2) -> p1.then(resultP1 -> p2.then(resultP2 -> this.promises.resolve(resultP1 || resultP2)))).then(resultIsTrue -> { - assertFalse(resultIsTrue); - return promises.resolve(); - }); - } - - @Test - public void reduceWithAndIsTrueOperatorTest() { - final List> promisesToReduce = Arrays.asList(promises.resolve(true), - promises.resolve(true)); - promises.reduce(promises.resolve(true), promisesToReduce, (p1, p2) -> p1.then(resultP1 -> p2.then(resultP2 -> this.promises.resolve(resultP1 && resultP2)))).then(resultIsTrue -> { - assertTrue(resultIsTrue); - return promises.resolve(); - }); - } - - @Test - public void reduceWithAndIsFalseOperatorTest() { - final List> promisesToReduce = Arrays.asList(promises.resolve(false), - promises.resolve(true)); - promises.reduce(promises.resolve(true), promisesToReduce, (p1, p2) -> p1.then(resultP1 -> p2.then(resultP2 -> this.promises.resolve(resultP1 && resultP2)))).then(resultIsTrue -> { - assertFalse(resultIsTrue); - return promises.resolve(); - }); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider b/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider deleted file mode 100644 index 851bb558811..00000000000 --- a/packages/dashbuilder/appformer/uberfire-testing-utils/src/test/resources/META-INF/services/org.uberfire.java.nio.file.spi.FileSystemProvider +++ /dev/null @@ -1,18 +0,0 @@ -# -# Copyright 2015 Red Hat, Inc. and/or its affiliates. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -org.uberfire.java.nio.fs.file.SimpleFileSystemProvider # file system provider, also default (1st) -org.uberfire.java.nio.fs.jgit.JGitFileSystemProvider diff --git a/packages/dashbuilder/appformer/uberfire-workbench/pom.xml b/packages/dashbuilder/appformer/uberfire-workbench/pom.xml deleted file mode 100644 index d12ddea9fce..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/pom.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - 4.0.0 - - org.uberfire - uberfire-parent - ${revision} - ../pom.xml - - - uberfire-workbench - pom - - UberFire Workbench - - - uberfire-workbench-client - uberfire-workbench-client-views-patternfly - uberfire-workbench-processors - uberfire-workbench-processors-tests - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/pom.xml b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/pom.xml deleted file mode 100644 index a5684010507..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/pom.xml +++ /dev/null @@ -1,446 +0,0 @@ - - - - - 4.0.0 - - org.uberfire - uberfire-workbench - ${revision} - - - uberfire-workbench-client-views-patternfly - jar - - UberFire Workbench Client Views: PatternFly - UberFire Workbench Client Views: PatternFly - - - - org.uberfire - uberfire-api - - - org.uberfire - uberfire-workbench-client - - - org.uberfire - uberfire-client-api - - - org.uberfire - uberfire-commons - - - org.gwtbootstrap3 - gwtbootstrap3 - - - org.jboss.errai - errai-ui - - - org.jboss.errai - errai-common - - - org.jboss.errai - errai-ioc - - - org.kie.soup - kie-soup-commons - - - com.allen-sauer.gwt.dnd - gwt-dnd - - - com.google.guava - guava - - - com.google.elemental2 - elemental2-dom - - - com.google.jsinterop - jsinterop-annotations - - - com.google.jsinterop - base - - - - com.google.gwt - gwt-user - provided - - - - com.google.gwt.gwtmockito - gwtmockito - test - - - commons-logging - commons-logging - - - - - - org.uberfire - uberfire-commons - sources - test - - - - org.kie.soup - kie-soup-commons - sources - test - - - - org.uberfire - uberfire-api - sources - test - - - - org.uberfire - uberfire-client-api - sources - test - - - - org.uberfire - uberfire-workbench-client - sources - test - - - - org.uberfire - uberfire-testing-utils - test - - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - unpack-patternfly - process-resources - - unpack - - - - - org.webjars.bower - patternfly - ${version.org.webjars.bower.org.patternfly} - jar - true - ${project.build.directory}/patternfly - - - false - true - - - - unpack-bootstrap-select - process-resources - - unpack - - - - - org.webjars.bower - bootstrap-select - ${version.org.webjars.bower.bootstrap-select} - jar - true - ${project.build.directory}/bootstrap-select - - - false - true - - - - unpack-moment - process-resources - - unpack - - - - - org.webjars.npm - moment - ${version.org.webjars.npm.moment} - jar - true - ${project.build.directory}/moment - - - false - true - - - - unpack-moment-timezone - process-resources - - unpack - - - - - org.webjars.npm - moment-timezone - ${version.org.webjars.npm.moment-timezone} - jar - true - ${project.build.directory}/moment-timezone - - - false - true - - - - unpack-bootstrap-daterangepicker - process-resources - - unpack - - - - - org.webjars.bower - bootstrap-daterangepicker - ${version.org.webjars.bower.bootstrap-daterangepicker} - jar - true - ${project.build.directory}/bootstrap-daterangepicker - - - false - true - - - - unpack-d3 - process-resources - - unpack - - - - - org.webjars.bower - d3 - ${version.org.webjars.bower.d3js} - jar - true - ${project.build.directory}/d3 - - - false - true - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-patternfly-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static - - - ${project.build.directory}/patternfly/META-INF/resources/webjars/patternfly/${version.org.webjars.bower.org.patternfly}/dist - - ** - - - tests/** - - - - - - - copy-bootstrap-select-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/bootstrap-select - - - ${project.build.directory}/bootstrap-select/META-INF/resources/webjars/bootstrap-select/${version.org.webjars.bower.bootstrap-select}/dist - - ** - - - - - - - copy-moment-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/moment - - - ${project.build.directory}/moment/META-INF/resources/webjars/moment/${version.org.webjars.npm.moment}/min/ - - moment-with-locales.min.js - - - - - - - copy-moment-timezone-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/moment-timezone - - - ${project.build.directory}/moment-timezone/META-INF/resources/webjars/moment-timezone/${version.org.webjars.npm.moment-timezone}/builds/ - - moment-timezone-with-data-2012-2022.min.js - - - - - - - copy-bootstrap-daterangepicker-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/bootstrap-daterangepicker - - - ${project.build.directory}/bootstrap-daterangepicker/META-INF/resources/webjars/bootstrap-daterangepicker/${version.org.webjars.bower.bootstrap-daterangepicker}/ - - daterangepicker.css - daterangepicker.js - - - - - - - copy-d3-resources - process-resources - - copy-resources - - - ${project.build.outputDirectory}/org/uberfire/client/views/static/d3 - - - ${project.build.directory}/d3/META-INF/resources/webjars/d3/${version.org.webjars.bower.d3js}/ - - d3.min.js - - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - ${basedir}/${profile.testOutputDirectory}/ - ${basedir}/src/main/java/ - ${basedir}/src/main/resources/ - ${basedir}/src/test/java/ - - false - pertest - - -Xmx1500m -Derrai.devel.nocache=true -Derrai.hosted_mode_testing=true -Derrai.ioc.experimental.infer_dependent_by_reachability=true -Dorg.jboss.errai.bus.do_long_poll=false - - - - - errai.hosted_mode_testing - true - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/PatternFlyEntryPoint.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/PatternFlyEntryPoint.java deleted file mode 100644 index ccdae353653..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/PatternFlyEntryPoint.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly; - -import javax.annotation.PostConstruct; - -import org.jboss.errai.ioc.client.api.EntryPoint; -import org.jboss.errai.ui.shared.api.annotations.Bundle; -import org.uberfire.client.views.pfly.sys.PatternFlyBootstrapper; - -@EntryPoint -@Bundle("resources/i18n/Constants.properties") -public class PatternFlyEntryPoint { - - @PostConstruct - public void init() { - PatternFlyBootstrapper.ensurePatternFlyIsAvailable(); - } - - public native String getPatternFlyVersion()/*-{ - return $wnd.patternfly.version; - }-*/; - - public native String getMomentLocale()/*-{ - return $wnd.moment.locale(); - }-*/; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.java deleted file mode 100644 index 2e9753d94af..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.java +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.views.pfly.dnd; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.ApplicationScoped; - -import com.allen_sauer.gwt.dnd.client.DragContext; -import com.allen_sauer.gwt.dnd.client.VetoDragException; -import com.allen_sauer.gwt.dnd.client.util.CoordinateArea; -import com.allen_sauer.gwt.dnd.client.util.CoordinateLocation; -import com.allen_sauer.gwt.dnd.client.util.Location; -import com.allen_sauer.gwt.dnd.client.util.WidgetArea; -import com.google.gwt.core.client.GWT; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Style; -import com.google.gwt.dom.client.Style.Display; -import com.google.gwt.dom.client.Style.Unit; -import com.google.gwt.dom.client.Style.Visibility; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.DockLayoutPanel; -import com.google.gwt.user.client.ui.PopupPanel; -import com.google.gwt.user.client.ui.Widget; -import org.uberfire.client.resources.WorkbenchResources; -import org.uberfire.client.workbench.widgets.dnd.CompassWidget; -import org.uberfire.workbench.model.CompassPosition; -import org.uberfire.workbench.model.Position; - -/** - * A pop-up widget with arrows in the four cardinal directions, each of which is a separate drop target. The center of - * the widget is a fifth drop target representing the parent widget itself. The compass centers itself over its parent's - * Drop Target when displayed. - */ -@ApplicationScoped -public class CompassWidgetImpl implements CompassWidget { - - public static final String FA_ACTIVE = "fa-active"; - private static CompassWidgetBinder uiBinder = GWT.create(CompassWidgetBinder.class); - @UiField - DockLayoutPanel container; - @UiField - PopupPanel popup; - @UiField - Widget south; - @UiField - Widget north; - @UiField - Widget west; - @UiField - Widget east; - @UiField - Widget centre; - private Element dropTargetHighlight; - private CompassPosition dropTargetPosition = CompassPosition.NONE; - - @PostConstruct - private void init() { - popup = uiBinder.createAndBindUi(this); - - //Setup drop indicator - if (dropTargetHighlight == null) { - dropTargetHighlight = Document.get().createDivElement(); - dropTargetHighlight.getStyle().setPosition(Style.Position.ABSOLUTE); - dropTargetHighlight.getStyle().setVisibility(Visibility.HIDDEN); - dropTargetHighlight.setClassName(WorkbenchResources.INSTANCE.CSS().dropTargetHighlight()); - Document.get().getBody().appendChild(dropTargetHighlight); - } - - north.ensureDebugId("CompassWidget-north"); - south.ensureDebugId("CompassWidget-south"); - east.ensureDebugId("CompassWidget-east"); - west.ensureDebugId("CompassWidget-west"); - centre.ensureDebugId("CompassWidget-centre"); - } - - @Override - public void onEnter(DragContext context) { - show(context); - } - - @Override - public void onLeave(DragContext context) { - popup.hide(); - } - - @Override - public void onMove(DragContext context) { - final Location l = new CoordinateLocation(context.mouseX, - context.mouseY); - final WidgetArea northWidgetArea = new WidgetArea(north, - null); - final WidgetArea southWidgetArea = new WidgetArea(south, - null); - final WidgetArea eastWidgetArea = new WidgetArea(east, - null); - final WidgetArea westWidgetArea = new WidgetArea(west, - null); - final WidgetArea centreWidgetArea = new WidgetArea(centre, - null); - CompassPosition p = CompassPosition.NONE; - if (northWidgetArea.intersects(l)) { - p = CompassPosition.NORTH; - } else if (southWidgetArea.intersects(l)) { - p = CompassPosition.SOUTH; - } else if (eastWidgetArea.intersects(l)) { - p = CompassPosition.EAST; - } else if (westWidgetArea.intersects(l)) { - p = CompassPosition.WEST; - } else if (centreWidgetArea.intersects(l)) { - p = CompassPosition.SELF; - } - if (p != dropTargetPosition) { - dropTargetPosition = p; - showDropTarget(context, - p); - } - } - - @Override - public Position getDropPosition() { - return this.dropTargetPosition; - } - - @Override - public Widget getDropTarget() { - throw new UnsupportedOperationException(); - } - - @Override - public void onDrop(DragContext context) { - this.dropTargetPosition = CompassPosition.NONE; - highlightActiveDropTarget(null); - hideDropTarget(); - } - - @Override - public void onPreviewDrop(DragContext context) throws VetoDragException { - throw new UnsupportedOperationException(); - } - - private void show(final DragContext context) { - - //Get centre of DropTarget - final Widget dropTargetParent = context.dropController.getDropTarget(); - int cxmin = dropTargetParent.getElement().getAbsoluteLeft(); - int cymin = dropTargetParent.getElement().getAbsoluteTop(); - int cxmax = dropTargetParent.getElement().getAbsoluteRight(); - int cymax = dropTargetParent.getElement().getAbsoluteBottom(); - - final CoordinateArea ca = new CoordinateArea(cxmin, - cymin, - cxmax, - cymax); - - //Display Compass if not already visible - if (!popup.isAttached()) { - popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { - - @Override - public void setPosition(int offsetWidth, - int offsetHeight) { - popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2), - ca.getCenter().getTop() - (offsetHeight / 2)); - } - }); - } else { - popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2), - ca.getCenter().getTop() - (popup.getOffsetHeight() / 2)); - } - } - - private void showDropTarget(final DragContext context, - final CompassPosition p) { - int x = 0; - int y = 0; - int width = 0; - int height = 0; - final Widget dropTargetParent = context.dropController.getDropTarget(); - switch (p) { - case SELF: - x = dropTargetParent.getAbsoluteLeft(); - y = dropTargetParent.getAbsoluteTop(); - width = dropTargetParent.getOffsetWidth(); - height = dropTargetParent.getOffsetHeight(); - highlightActiveDropTarget(centre); - showDropTarget(x, - y, - width, - height); - break; - case NORTH: - x = dropTargetParent.getAbsoluteLeft(); - y = dropTargetParent.getAbsoluteTop(); - width = dropTargetParent.getOffsetWidth(); - height = (int) (dropTargetParent.getOffsetHeight() * 0.50); - highlightActiveDropTarget(north); - showDropTarget(x, - y, - width, - height); - break; - case SOUTH: - x = dropTargetParent.getAbsoluteLeft(); - height = (int) (dropTargetParent.getOffsetHeight() * 0.50); - y = dropTargetParent.getOffsetHeight() + dropTargetParent.getAbsoluteTop() - height; - width = dropTargetParent.getOffsetWidth(); - highlightActiveDropTarget(south); - showDropTarget(x, - y, - width, - height); - break; - case EAST: - width = (int) (dropTargetParent.getOffsetWidth() * 0.50); - x = dropTargetParent.getOffsetWidth() + dropTargetParent.getAbsoluteLeft() - width; - y = dropTargetParent.getAbsoluteTop(); - height = dropTargetParent.getOffsetHeight(); - highlightActiveDropTarget(east); - showDropTarget(x, - y, - width, - height); - break; - case WEST: - x = dropTargetParent.getAbsoluteLeft(); - y = dropTargetParent.getAbsoluteTop(); - width = (int) (dropTargetParent.getOffsetWidth() * 0.50); - height = dropTargetParent.getOffsetHeight(); - highlightActiveDropTarget(west); - showDropTarget(x, - y, - width, - height); - break; - default: - highlightActiveDropTarget(null); - hideDropTarget(); - } - } - - private void highlightActiveDropTarget(final Widget target) { - south.removeStyleName(FA_ACTIVE); - north.removeStyleName(FA_ACTIVE); - west.removeStyleName(FA_ACTIVE); - east.removeStyleName(FA_ACTIVE); - centre.removeStyleName(FA_ACTIVE); - if (target != null) { - target.addStyleName(FA_ACTIVE); - } - } - - private void showDropTarget(int x, - int y, - int width, - int height) { - dropTargetHighlight.getStyle().setLeft(x, - Unit.PX); - dropTargetHighlight.getStyle().setWidth(width, - Unit.PX); - dropTargetHighlight.getStyle().setTop(y, - Unit.PX); - dropTargetHighlight.getStyle().setHeight(height, - Unit.PX); - dropTargetHighlight.getStyle().setVisibility(Visibility.VISIBLE); - dropTargetHighlight.getStyle().setDisplay(Display.BLOCK); - } - - private void hideDropTarget() { - dropTargetHighlight.getStyle().setVisibility(Visibility.HIDDEN); - dropTargetHighlight.getStyle().setDisplay(Display.NONE); - dropTargetPosition = CompassPosition.NONE; - } - - interface CompassWidgetBinder extends UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.ui.xml b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.ui.xml deleted file mode 100644 index 2ef65a3453c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dnd/CompassWidgetImpl.ui.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dropdown/ListDropdown.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dropdown/ListDropdown.java deleted file mode 100644 index 97be41d18f9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/dropdown/ListDropdown.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.dropdown; - -import java.util.Iterator; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.ComplexPanel; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.DropDown; -import org.gwtbootstrap3.client.ui.DropDownMenu; -import org.gwtbootstrap3.client.ui.ListItem; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.Toggle; - -/** - * Utility component for creating dropdown menus. - * It also allows to determine if dropdown should shown when there is a single element in the list. - */ -public class ListDropdown extends DropDown { - - protected Button button = GWT.create(Button.class); - protected DropDownMenu dropDownMenu = GWT.create(DropDownMenu.class); - protected boolean hideOnSingleElement = true; - - public ListDropdown() { - super.add(button); - super.add(dropDownMenu); - button.setType(ButtonType.LINK); - this.addStyleName("uf-list-dropdown"); - } - - @Override - public void add(final Widget child) { - if (child instanceof ListItem) { - dropDownMenu.add(child); - addCaretToText(); - } - } - - public void setText(final Widget text) { - removeChildWidgets(button); - button.add(text); - addCaretToText(); - } - - @Override - public boolean remove(final Widget w) { - final boolean remove = dropDownMenu.remove(w); - addCaretToText(); - return remove; - } - - public void setHideOnSingleElement(boolean hide) { - this.hideOnSingleElement = hide; - } - - @Override - public void clear() { - removeChildWidgets(button); - removeChildWidgets(dropDownMenu); - } - - private void removeChildWidgets(final ComplexPanel panel) { - final Iterator iterator = panel.iterator(); - while (iterator.hasNext()) { - iterator.next(); - iterator.remove(); - } - } - - /** - * Checks whether or not caret should be added/removed - */ - protected void addCaretToText() { - if (hideOnSingleElement && dropDownMenu.getWidgetCount() == 1) { - button.setToggleCaret(false); - button.setDataToggle(null); - this.removeStyleName("open"); - toggleStyles(true); - } else if ((dropDownMenu.getWidgetCount() > 1 || hideOnSingleElement == false && dropDownMenu.getWidgetCount() == 1)) { - button.setToggleCaret(true); - button.setDataToggle(Toggle.DROPDOWN); - button.setDataTargetWidget(this); - toggleStyles(false); - } - } - - private void toggleStyles(boolean single) { - this.removeStyleName("uf-list-dropdown-single"); - this.removeStyleName("uf-list-dropdown-multi"); - this.addStyleName(single ? "uf-list-dropdown-single" : "uf-list-dropdown-multi"); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.java deleted file mode 100644 index f98b942194b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.java +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.views.pfly.listbar; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.event.logical.shared.BeforeSelectionEvent; -import com.google.gwt.event.logical.shared.BeforeSelectionHandler; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.FocusPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.RequiresResize; -import com.google.gwt.user.client.ui.ResizeComposite; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.ButtonGroup; -import org.gwtbootstrap3.client.ui.Panel; -import org.gwtbootstrap3.client.ui.PanelBody; -import org.gwtbootstrap3.client.ui.PanelHeader; -import org.jboss.errai.ioc.client.container.IOCResolutionException; -import org.uberfire.client.util.CSSLocatorsUtils; -import org.uberfire.client.util.Layouts; -import org.uberfire.client.views.pfly.maximize.MaximizeToggleButton; -import org.uberfire.client.workbench.PanelManager; -import org.uberfire.client.workbench.panels.MaximizeToggleButtonPresenter; -import org.uberfire.client.workbench.panels.WorkbenchPanelPresenter; -import org.uberfire.client.workbench.part.WorkbenchPartPresenter; -import org.uberfire.client.workbench.widgets.dnd.WorkbenchDragAndDropManager; -import org.uberfire.client.workbench.widgets.listbar.ListBarWidget; -import org.uberfire.client.workbench.widgets.listbar.ListbarPreferences; -import org.uberfire.client.workbench.widgets.listbar.ResizeFocusPanel; -import org.uberfire.commons.data.Pair; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.PartDefinition; - -import static com.google.gwt.dom.client.Style.Display.BLOCK; -import static com.google.gwt.dom.client.Style.Display.NONE; - -/** - * Implementation of ListBarWidget based on PatternFly components. - */ -@Dependent -public class ListBarWidgetImpl - extends ResizeComposite implements ListBarWidget { - - private static ListBarWidgetBinder uiBinder = GWT.create(ListBarWidgetBinder.class); - final Map partContentView = new HashMap(); - /** - * Preferences bean that applications can optionally provide. If this injection is unsatisfied, default settings are used. - */ - @Inject - Instance optionalListBarPrefs; - - @Inject - PanelManager panelManager; - @UiField - FocusPanel container; - @UiField - PartListDropdown titleDropDown; - @UiField - PanelHeader header; - @UiField - Panel panel; - @UiField - ButtonGroup contextMenu; - @UiField - Button closeButton; - @UiField - ButtonGroup toolBar; - @UiField - MaximizeToggleButton maximizeButton; - /** - * Wraps maximizeButton, which is the view. - */ - MaximizeToggleButtonPresenter maximizeButtonPresenter; - @UiField - PanelBody content; - WorkbenchPanelPresenter presenter; - LinkedList parts = new LinkedList<>(); - Pair currentPart; - - @PostConstruct - void postConstruct() { - initWidget(uiBinder.createAndBindUi(this)); - maximizeButtonPresenter = new MaximizeToggleButtonPresenter(maximizeButton); - titleDropDown.setHideOnSingleElement(getListbarPreferences().isHideTitleDropDownOnSingleElement()); - setupEventHandlers(); - - Layouts.setToFillParent(this); - scheduleResize(); - } - - void setupEventHandlers() { - this.container.addMouseOutHandler(event -> titleDropDown.removeStyleName("open")); - - this.container.addFocusHandler(event -> { - if (currentPart != null && currentPart.getK1() != null) { - selectPart(currentPart.getK1()); - } - }); - - this.maximizeButton.addClickHandler(event -> { - if (maximizeButton.isMaximized()) { - panelManager.onPartMaximized(currentPart.getK1()); - } else { - panelManager.onPartMinimized(currentPart.getK1()); - } - }); - - closeButton.addClickHandler(event -> { - if (currentPart != null) { - if (maximizeButton.isMaximized()) { - panelManager.onPartMinimized(currentPart.getK1()); - } - panelManager.closePart(currentPart.getK1()); - } - }); - - titleDropDown.addSelectionHandler(event -> selectPart(event.getSelectedItem())); - - titleDropDown.addCloseHandler(event -> panelManager.closePart(event.getTarget())); - } - - ListbarPreferences getListbarPreferences() { - try { - return optionalListBarPrefs.isUnsatisfied() ? new ListbarPreferences() : optionalListBarPrefs.get(); - } catch (IOCResolutionException e) { - return new ListbarPreferences(); - } - } - - @Override - public void enableDnd() { - titleDropDown.enableDragAndDrop(); - } - - @Override - public void disableDnd() { - titleDropDown.disableDragAndDrop(); - } - - @Override - public void setPresenter(final WorkbenchPanelPresenter presenter) { - this.presenter = presenter; - } - - @Override - public void setDndManager(final WorkbenchDragAndDropManager dndManager) { - this.titleDropDown.setDndManager(dndManager); - } - - @Override - public void clear() { - contextMenu.clear(); - header.setVisible(false); - content.clear(); - - parts.clear(); - partContentView.clear(); - titleDropDown.clear(); - currentPart = null; - } - - @Override - public void addPart(final WorkbenchPartPresenter.View view) { - final PartDefinition partDefinition = view.getPresenter().getDefinition(); - if (parts.contains(partDefinition)) { - selectPart(partDefinition); - return; - } - - parts.addFirst(partDefinition); - - final FlowPanel panel = new FlowPanel(); - setupCSSLocators(view, - panel); - Layouts.setToFillParent(panel); - panel.add(view); - content.add(panel); - - // IMPORTANT! if you change what goes in this map, update the remove(PartDefinition) method - partContentView.put(partDefinition, - panel); - - if (partDefinition.isSelectable()) { - titleDropDown.addPart(view); - } - - header.setVisible(true); - - resizePanelBody(); - scheduleResize(); - } - - void setupCSSLocators(WorkbenchPartPresenter.View view, - FlowPanel panel) { - if (view.getPresenter() != null || view.getPresenter().getTitle() != null) { - panel.getElement().addClassName(CSSLocatorsUtils.buildLocator("qe-list-bar-content", - view.getPresenter().getTitle())); - } - } - - @Override - public void changeTitle(final PartDefinition part, - final String title, - final IsWidget titleDecoration) { - if (part.isSelectable()) { - titleDropDown.changeTitle(part, - title, - titleDecoration); - } - } - - @Override - public boolean selectPart(final PartDefinition part) { - if (!parts.contains(part)) { - //not necessary to check if current is part - return false; - } - - if (currentPart != null) { - if (currentPart.getK1().equals(part)) { - return true; - } - parts.addFirst(currentPart.getK1()); - panelManager.onPartHidden(currentPart.getK1()); - currentPart.getK2().getElement().getStyle().setDisplay(NONE); - } - - currentPart = Pair.newPair(part, - partContentView.get(part)); - currentPart.getK2().getElement().getStyle().setDisplay(BLOCK); - parts.remove(currentPart.getK1()); - - if (part.isSelectable()) { - titleDropDown.selectPart(part); - header.setVisible(true); - } else { - header.setVisible(false); - } - - scheduleResize(); - resizePanelBody(); - - SelectionEvent.fire(ListBarWidgetImpl.this, - part); - - return true; - } - - @Override - public boolean remove(final PartDefinition part) { - if (part.isSelectable()) { - titleDropDown.removePart(part); - } - - if (currentPart != null && currentPart.getK1().asString().equals(part.asString())) { - PartDefinition nextPart = getNextPart(part); - - if (nextPart != null) { - presenter.selectPart(nextPart); - } else { - panelManager.onPartHidden(currentPart.getK1()); - clear(); - } - } - - boolean removed = parts.remove(part); - FlowPanel view = partContentView.remove(part); - if (view != null) { - // FIXME null check should not be necessary, but sometimes the entry in partContentView is missing! - content.remove(view); - } - - if (currentPart == null) { - header.setVisible(false); - } - - resizePanelBody(); - scheduleResize(); - - return removed; - } - - PartDefinition getNextPart(PartDefinition currentSelectedPart) { - PartDefinition nextPart = null; - for (PartDefinition p : getUnselectedParts()) { - if (!currentSelectedPart.asString().equals(p.asString())) { - if (nextPart == null || p.isSelectable()) { - nextPart = p; - } - - if (p.isSelectable()) { - break; - } - } - } - return nextPart; - } - - @Override - public void setFocus(final boolean hasFocus) {} - - @Override - public void addOnFocusHandler(final Command command) {} - - @Override - public int getPartsSize() { - if (currentPart == null) { - return 0; - } - return parts.size() + 1; - } - - @Override - public Collection getParts() { - if (currentPart == null) { - return parts; - } - - LinkedList allParts = new LinkedList<>(); - allParts.addAll(parts); - allParts.addFirst(currentPart.getK1()); - - return Collections.unmodifiableList(allParts); - } - - @Override - public HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler handler) { - return addHandler(handler, - BeforeSelectionEvent.getType()); - } - - @Override - public HandlerRegistration addSelectionHandler(final SelectionHandler handler) { - return addHandler(handler, - SelectionEvent.getType()); - } - - @Override - public void onResize() { - if (!isAttached()) { - return; - } - - super.onResize(); - - // FIXME only need to do this for the one visible part .. need to call onResize() when switching parts anyway - for (int i = 0; i < content.getWidgetCount(); i++) { - final FlowPanel container = (FlowPanel) content.getWidget(i); - final Widget containedWidget = container.getWidget(0); - if (containedWidget instanceof RequiresResize) { - ((RequiresResize) containedWidget).onResize(); - } - } - } - - private void scheduleResize() { - Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { - - @Override - public void execute() { - onResize(); - } - }); - } - - void resizePanelBody() { - //When an Item is added to the PanelHeader recalculate the PanelBody size. - //This cannot be performed in either the @PostConstruct or onAttach() methods as at - //these times the PanelHeader may not have any content and hence have no size. - if (currentPart != null && !currentPart.getK1().isSelectable()) { - content.getElement().getStyle().setProperty("height", - "100%"); - } else { - content.getElement().getStyle().setProperty("height", - "calc(100% - " + header.getOffsetHeight() + "px)"); - } - } - - /** - * Returns the toggle button, that can be used to trigger maximizing and unmaximizing - * of the panel containing this list bar. Make the button visible by calling {@link Widget#setVisible(boolean)} - * and set its maximize and unmaximize actions with {@link MaximizeToggleButton#setMaximizeCommand(Command)} and - * {@link MaximizeToggleButton#setUnmaximizeCommand(Command)}. - */ - @Override - public MaximizeToggleButtonPresenter getMaximizeButton() { - return maximizeButtonPresenter; - } - - @Override - public boolean isDndEnabled() { - return this.titleDropDown.isDndEnabled(); - } - - @Override - public void enableClosePart() { - closeButton.setVisible(true); - } - - @Override - public void disableClosePart() { - closeButton.setVisible(false); - } - - @Override - public void disableExpandPart() { - maximizeButton.setVisible(false); - } - - Collection getUnselectedParts() { - return parts; - } - - interface ListBarWidgetBinder - extends - UiBinder { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.ui.xml b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.ui.xml deleted file mode 100644 index 62e859afa8c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/ListBarWidgetImpl.ui.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/PartListDropdown.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/PartListDropdown.java deleted file mode 100644 index b45e1caff7b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/listbar/PartListDropdown.java +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.listbar; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.dom.client.Document; -import com.google.gwt.dom.client.SpanElement; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.dom.client.DragStartEvent; -import com.google.gwt.event.dom.client.DragStartHandler; -import com.google.gwt.event.dom.client.MouseDownEvent; -import com.google.gwt.event.dom.client.MouseDownHandler; -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.logical.shared.HasCloseHandlers; -import com.google.gwt.event.logical.shared.HasSelectionHandlers; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Image; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.Anchor; -import org.gwtbootstrap3.client.ui.Icon; -import org.gwtbootstrap3.client.ui.ListItem; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.gwtbootstrap3.client.ui.constants.Styles; -import org.gwtbootstrap3.client.ui.html.Span; -import org.gwtbootstrap3.client.ui.html.Text; -import org.uberfire.client.util.CSSLocatorsUtils; -import org.uberfire.client.views.pfly.dropdown.ListDropdown; -import org.uberfire.client.workbench.part.WorkbenchPartPresenter; -import org.uberfire.client.workbench.widgets.dnd.DragArea; -import org.uberfire.client.workbench.widgets.dnd.WorkbenchDragAndDropManager; -import org.uberfire.workbench.model.PartDefinition; - -public class PartListDropdown extends ListDropdown implements HasSelectionHandlers, - HasCloseHandlers { - - public static final String DEBUG_TITLE_PREFIX = "PartList-title-"; - - private Map partOptions = new HashMap(); - private Map partTitles = new HashMap(); - private Map partView = new HashMap(); - private HandlerRegistration noDragHandler; - private WorkbenchDragAndDropManager dndManager; - private boolean dndEnabled = true; - - public PartListDropdown() { - super(); - this.addDomHandler(new NoMouseDownHandler(), - MouseDownEvent.getType()); - } - - public void setDndManager(final WorkbenchDragAndDropManager dndManager) { - this.dndManager = dndManager; - } - - public void addPart(final WorkbenchPartPresenter.View view) { - final PartDefinition part = view.getPresenter().getDefinition(); - partView.put(part, - view); - buildWidgets(part, - view.getPresenter().getTitle(), - view.getPresenter().getTitleDecoration()); - - if (partTitles.size() == 1) { - selectPart(part); - } - } - - private void buildWidgets(final PartDefinition part, - final String partTitle, - final IsWidget titleDecoration) { - if (partTitles.containsKey(part)) { - final DragArea title = partTitles.get(part); - title.getElement().getFirstChildElement().removeFromParent(); - title.add(buildTitleTextWidget(partTitle, - titleDecoration)); - } else { - final DragArea title = buildTitleWidget(partTitle, - titleDecoration); - partTitles.put(part, - title); - } - - if (partOptions.containsKey(part)) { - final ListItem option = partOptions.get(part); - option.setText(partTitle); - } else { - final ListItem option = buildTitleDropdownMenuItem(partTitle, - part); - partOptions.put(part, - option); - this.add(option); - } - } - - public void removePart(final PartDefinition part) { - partTitles.remove(part); - partView.remove(part); - final Widget option = partOptions.remove(part); - this.remove(option); - } - - public void selectPart(final PartDefinition part) { - final Widget title = partTitles.get(part); - this.setText(title); - for (final Map.Entry entry : partOptions.entrySet()) { - if (entry.getKey().asString().equals(part.asString())) { - entry.getValue().addStyleName("uf-part-list-dropdown-selected"); - } else { - entry.getValue().removeStyleName("uf-part-list-dropdown-selected"); - } - } - if (dndEnabled) { - makeDraggable(title, - partView.get(part)); - } - } - - public void changeTitle(final PartDefinition part, - final String title, - final IsWidget titleDecoration) { - buildWidgets(part, - title, - titleDecoration); - } - - private DragArea buildTitleWidget(final String title, - final IsWidget titleDecoration) { - final SpanElement spanElement = buildTitleTextWidget(title, - titleDecoration); - final DragArea dragArea = new DragArea(); - dragArea.add(spanElement); - dragArea.ensureDebugId(DEBUG_TITLE_PREFIX + title); - dragArea.addMouseDownHandler(new NoMouseDownHandler()); - return dragArea; - } - - private SpanElement buildTitleTextWidget(final String title, - final IsWidget titleDecoration) { - final SpanElement spanElement = Document.get().createSpanElement(); - spanElement.addClassName("uf-listbar-panel-header-title-text"); - spanElement.addClassName(CSSLocatorsUtils.buildLocator("qe-list-bar-header", - title)); - final String titleWidget = (titleDecoration instanceof Image) ? titleDecoration.toString() : ""; - spanElement.setInnerHTML(titleWidget + " " + title.replaceAll(" ", - "\u00a0")); - spanElement.setTitle(title); - return spanElement; - } - - private ListItem buildTitleDropdownMenuItem(final String title, - final PartDefinition part) { - final Span span = new Span(); - span.add(new Text(title)); - final ListItem li = new ListItem() { - @Override - public void setText(String text) { - span.clear(); - span.add(new Text(text)); - } - }; - li.addDomHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - SelectionEvent.fire(PartListDropdown.this, - part); - } - }, - ClickEvent.getType()); - - final Icon icon = new Icon(IconType.TIMES); - icon.addDomHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - CloseEvent.fire(PartListDropdown.this, - part); - //Keep dropdown menu open when removing parts - boolean openMenu = PartListDropdown.this.getElement().hasClassName("open"); - if (openMenu) { - Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() { - @Override - public void execute() { - PartListDropdown.this.getElement().addClassName("open"); - } - }); - } - } - }, - ClickEvent.getType()); - icon.addStyleName(Styles.PULL_RIGHT); - final Anchor anchor = new Anchor(); - anchor.add(icon); - anchor.add(span); - li.add(anchor); - return li; - } - - public void enableDragAndDrop() { - this.dndEnabled = true; - if (noDragHandler != null) { - noDragHandler.removeHandler(); - noDragHandler = null; - } - - for (final Map.Entry entry : partTitles.entrySet()) { - final Widget title = entry.getValue(); - final WorkbenchPartPresenter.View view = partView.get(entry.getKey()); - makeDraggable(title, - view); - } - } - - void makeDraggable(final Widget title, - final WorkbenchPartPresenter.View view) { - if (this.dndManager == null || this.dndEnabled == false) { - return; - } - dndManager.makeDraggable(view, - title); - } - - public void disableDragAndDrop() { - this.dndEnabled = false; - // Prevent from dragging title element around - if (noDragHandler == null) { - noDragHandler = this.addDomHandler(new DragStartHandler() { - @Override - public void onDragStart(DragStartEvent event) { - event.preventDefault(); - } - }, - DragStartEvent.getType()); - } - } - - public boolean isDndEnabled() { - return dndEnabled; - } - - @Override - public void clear() { - super.clear(); - partOptions.clear(); - partTitles.clear(); - partView.clear(); - } - - @Override - public HandlerRegistration addSelectionHandler(final SelectionHandler handler) { - return super.addHandler(handler, - SelectionEvent.getType()); - } - - @Override - public HandlerRegistration addCloseHandler(final CloseHandler handler) { - return super.addHandler(handler, - CloseEvent.getType()); - } - - private class NoMouseDownHandler implements MouseDownHandler { - - @Override - public void onMouseDown(MouseDownEvent event) { -// Prevents drag from propagating to text elements - event.preventDefault(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/maximize/MaximizeToggleButton.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/maximize/MaximizeToggleButton.java deleted file mode 100644 index b9bbed638d9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/maximize/MaximizeToggleButton.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.maximize; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.constants.ButtonSize; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.uberfire.client.resources.i18n.WorkbenchConstants; -import org.uberfire.client.workbench.panels.MaximizeToggleButtonPresenter; -import org.uberfire.client.workbench.panels.MaximizeToggleButtonPresenter.View; -import org.uberfire.mvp.Command; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -public class MaximizeToggleButton extends Button implements View { - - private MaximizeToggleButtonPresenter presenter; - private boolean maximized; - private Command maximizeCommand; - private Command unmaximizeCommand; - - public MaximizeToggleButton() { - setMaximized(maximized); - addClickHandler(new ClickHandler() { - @Override - public void onClick(ClickEvent event) { - presenter.handleClick(); - } - }); - setSize(ButtonSize.SMALL); - } - - @Override - public HandlerRegistration addClickHandler(ClickHandler handler) { - return this.addDomHandler(handler, - ClickEvent.getType()); - } - - @Override - public void init(MaximizeToggleButtonPresenter presenter) { - this.presenter = checkNotNull("presenter", - presenter); - } - - /** - * Normally invoked automatically when this button gets clicked. Exposed for testing purposes. - */ - public void click() { - final boolean wasMaximized = maximized; - setMaximized(!wasMaximized); - if (wasMaximized) { - if (unmaximizeCommand != null) { - unmaximizeCommand.execute(); - } - } else { - if (maximizeCommand != null) { - maximizeCommand.execute(); - } - } - } - - /** - * Returns the currently registered maximize command. Can be used to check if there is currently a maximize command registered. - */ - public Command getMaximizeCommand() { - return maximizeCommand; - } - - /** - * Sets the command to invoke upon each transition from unmaximized to maximized. - */ - public void setMaximizeCommand(Command maximizeCommand) { - this.maximizeCommand = maximizeCommand; - } - - /** - * Returns the currently registered unmaximize command. Can be used to check if there is currently an unmaximize command registered. - */ - public Command getUnmaximizeCommand() { - return unmaximizeCommand; - } - - /** - * Sets the command to invoke upon each transition from maximized to unmaximized. - */ - public void setUnmaximizeCommand(Command unmaximizeCommand) { - this.unmaximizeCommand = unmaximizeCommand; - } - - /** - * Reports whether this button is currently in the maximized state. If true, the next click will return to the - * normal unmaximized state. If false, the next click will transition to the maximized state. - */ - public boolean isMaximized() { - return maximized; - } - - /** - * Changes the maximized state of this button without calling the commands. This can be used to notify the - * button that some external process has already maximized the thing in question. It is permissible but not necessary - * to call this method from the maximizeCommadn and unmaximizeCommand. - * - * @param maximized the new maximized state to set. - */ - public void setMaximized(boolean maximized) { - this.maximized = maximized; - if (maximized) { - setIcon(IconType.COMPRESS); - setTitle(WorkbenchConstants.INSTANCE.minimizePanel()); - } else { - setIcon(IconType.EXPAND); - setTitle(WorkbenchConstants.INSTANCE.maximizePanel()); - } - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/Bs3Modal.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/Bs3Modal.java deleted file mode 100644 index 11d206dab51..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/Bs3Modal.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.modal; - -import javax.enterprise.context.Dependent; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.user.client.DOM; -import com.google.gwt.user.client.ui.IsWidget; -import org.gwtbootstrap3.client.shared.event.ModalHiddenEvent; -import org.gwtbootstrap3.client.shared.event.ModalHiddenHandler; -import org.gwtbootstrap3.client.shared.event.ModalShownEvent; -import org.gwtbootstrap3.client.shared.event.ModalShownHandler; -import org.gwtbootstrap3.client.ui.Button; -import org.gwtbootstrap3.client.ui.Modal; -import org.gwtbootstrap3.client.ui.ModalBody; -import org.gwtbootstrap3.client.ui.ModalFooter; -import org.gwtbootstrap3.client.ui.constants.Attributes; -import org.gwtbootstrap3.client.ui.constants.ButtonDismiss; -import org.gwtbootstrap3.client.ui.constants.ButtonType; -import org.gwtbootstrap3.client.ui.constants.ModalBackdrop; -import org.uberfire.client.resources.WorkbenchResources; -import org.uberfire.mvp.Command; -import org.uberfire.mvp.Commands; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * A modal dialog that floats above the workbench. Each instance can only be shown once. - */ -@Dependent -public class Bs3Modal extends Modal { - - private final ModalBody body = GWT.create(ModalBody.class); - - /** - * Used for enforcing the "only show one time" rule. - */ - boolean hasBeenShown; - - public Bs3Modal() { - setup(); - } - - protected void setup() { - this.add(body); - this.setDataBackdrop(ModalBackdrop.STATIC); - this.setFade(true); - this.setRemoveOnHide(true); - this.getElement().setAttribute(Attributes.ROLE, - "dialog"); - this.getElement().setAttribute(Attributes.TABINDEX, - "-1"); - this.addStyleName(WorkbenchResources.INSTANCE.CSS().modal()); - this.setId(DOM.createUniqueId()); - } - - @Override - protected void onAttach() { - super.onAttach(); - initFooter(this.getId()); - } - - private native void initFooter(final String id) /*-{ - var footer = $wnd.jQuery('#' + id + ' .modal-footer'); - if (footer.length == 0) { - this.@org.uberfire.client.views.pfly.modal.Bs3Modal::addDefaultFooter()(); - } - }-*/; - - /** - * Shows this modal dialog above the current workbench. - * - * @param afterShown the action to perform once the dialog has been shown. Not null. Use {@link Commands#DO_NOTHING} if you don't have an "after show" action. - * @param afterClosed the action to perform once the dialog has been dismissed. Not null. Use {@link Commands#DO_NOTHING} if you don't have an "after close" action. - */ - public void show(final Command afterShown, - final Command afterClosed) { - - checkNotNull("afterShown", - afterShown); - checkNotNull("afterClosed", - afterClosed); - this.addShownHandler(new ModalShownHandler() { - @Override - public void onShown(final ModalShownEvent showEvent) { - if (afterShown != null) { - afterShown.execute(); - } - } - }); - this.addHiddenHandler(new ModalHiddenHandler() { - @Override - public void onHidden(final ModalHiddenEvent hiddenEvent) { - if (afterClosed != null) { - afterClosed.execute(); - } - } - }); - this.show(); - } - - @Override - public void show() { - if (hasBeenShown) { - throw new IllegalStateException("This modal has already been shown. Create a new instance if you want to show another modal."); - } - super.show(); - } - - /** - * Replaces the contents within the main body area of the modal. By default, the main body area is empty. - * - * @param content the new content for the main body area. - */ - public void setContent(IsWidget content) { - body.clear(); - body.add(content); - } - - protected void addDefaultFooter() { - final Button close = GWT.create(Button.class); - close.setText("OK"); - close.setDataDismiss(ButtonDismiss.MODAL); - close.setType(ButtonType.PRIMARY); - setFooterContent(close); - } - - public void setModalTitle(final String title) { - this.setTitle(SafeHtmlUtils.htmlEscape(title)); - } - - /** - * Replaces the current contents of the footer area with the given widget. By default (if you do not call this - * method), the footer contains an OK button that dismisses the dialog when clicked. - * - * @param content the new content for the footer area. - */ - public void setFooterContent(IsWidget content) { - final ModalFooter footer = GWT.create(ModalFooter.class); - this.add(footer); - footer.add(content); - } - - /** - * Sets the pixel height of the main content container. - */ - public void setBodyHeight(int height) { - body.setHeight(height + "px"); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/ErrorPopupView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/ErrorPopupView.java deleted file mode 100644 index 5159308f599..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/modal/ErrorPopupView.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.views.pfly.modal; - -import javax.enterprise.context.Dependent; -import javax.enterprise.inject.Instance; -import javax.inject.Inject; - -import com.google.gwt.safehtml.shared.SafeHtmlUtils; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.HTML; -import org.uberfire.client.workbench.widgets.common.ErrorPopupPresenter; -import org.uberfire.mvp.Command; - -/** - * A popup that shows an error message - */ -@Dependent -public class ErrorPopupView extends Composite implements ErrorPopupPresenter.View { - - @Inject - private Instance modalFactory; - - @Override - public void showMessage(final String msg, - final Command afterShow, - final Command afterClose) { - - final Bs3Modal modal = modalFactory.get(); - modal.setModalTitle("Error"); - modal.setContent(new HTML(SafeHtmlUtils.fromString(msg))); - modal.show(afterShow, - afterClose); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.html deleted file mode 100644 index bbde0deeec5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.html +++ /dev/null @@ -1 +0,0 @@ -
        diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.java deleted file mode 100644 index cb9ba1c3a15..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenPartWidget.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.multiscreen; - -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; - -import com.google.gwt.event.logical.shared.BeforeSelectionEvent; -import com.google.gwt.event.logical.shared.BeforeSelectionHandler; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import elemental2.dom.HTMLDivElement; -import org.jboss.errai.ioc.client.api.ManagedInstance; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.workbench.PanelManager; -import org.uberfire.client.workbench.panels.MultiPartWidget; -import org.uberfire.client.workbench.panels.WorkbenchPanelPresenter; -import org.uberfire.client.workbench.part.WorkbenchPartPresenter; -import org.uberfire.client.workbench.widgets.dnd.WorkbenchDragAndDropManager; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.PartDefinition; - -@Dependent -@Named("MultiScreenPartWidget") -@Templated -public class MultiScreenPartWidget extends Composite implements MultiPartWidget { - - @Inject - @DataField("parts") - HTMLDivElement content; - - @Inject - ManagedInstance multiScreenViews; - - @Inject - PanelManager panelManager; - - private HashMap parts = new LinkedHashMap<>(); - - @Override - public void setPresenter(final WorkbenchPanelPresenter presenter) { - //no-op - } - - @Override - public void setDndManager(WorkbenchDragAndDropManager dndManager) { - //no-op - } - - @Override - public void clear() { - multiScreenViews.destroyAll(); - parts.values().forEach(s -> content.removeChild(s.getElement())); - parts.clear(); - } - - @Override - public void addPart(final WorkbenchPartPresenter.View view) { - final PartDefinition partDefinition = view.getPresenter().getDefinition(); - if (parts.containsKey(partDefinition) == false) { - final MultiScreenView screen = multiScreenViews.get(); - screen.setContent(view); - screen.setTitle(view.getPresenter().getTitle()); - if (view.getPresenter().getTitleDecoration() != null) { - screen.setTitleWidget(view.getPresenter().getTitleDecoration()); - } - if (parts.isEmpty() && partDefinition.getParentPanel().getPosition() == null) { - screen.disableClose(); - } - screen.setCloseHandler(() -> panelManager.closePart(partDefinition)); - - content.appendChild(screen.getElement()); - parts.put(partDefinition, - screen); - } - - selectPart(partDefinition); - } - - @Override - public void changeTitle(final PartDefinition part, - final String title, - final IsWidget titleDecoration) { - final MultiScreenView screen = parts.get(part); - if (screen != null) { - screen.setTitle(title); - if (titleDecoration != null) { - screen.setTitleWidget(titleDecoration); - } - } - } - - @Override - public boolean selectPart(final PartDefinition part) { - if (parts.containsKey(part) == false) { - return false; - } - - parts.entrySet().forEach(e -> { - if (e.getKey().equals(part)) { - e.getValue().show(); - } else { - e.getValue().hide(); - } - }); - return true; - } - - @Override - public boolean remove(final PartDefinition part) { - final MultiScreenView screen = parts.remove(part); - if (screen == null) { - return false; - } - - multiScreenViews.destroy(screen); - content.removeChild(screen.getElement()); - - parts.values().stream().reduce((f, s) -> s).ifPresent(s -> s.show()); - - return true; - } - - @Override - public void setFocus(boolean hasFocus) { - //no-op - } - - @Override - public void addOnFocusHandler(final Command doWhenFocused) { - //no-op - } - - @Override - public int getPartsSize() { - return parts.size(); - } - - @Override - public Collection getParts() { - return Collections.unmodifiableSet(parts.keySet()); - } - - @Override - public HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler handler) { - return addHandler(handler, - BeforeSelectionEvent.getType()); - } - - @Override - public HandlerRegistration addSelectionHandler(final SelectionHandler handler) { - return addHandler(handler, - SelectionEvent.getType()); - } - - @Override - public Widget asWidget() { - return this; - } - - @Override - public void onResize() { - parts.values().stream().filter(s -> s.isVisible()).forEach(s -> s.onResize()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.html deleted file mode 100644 index 1ed8dce61ef..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.html +++ /dev/null @@ -1,15 +0,0 @@ -
        -
        -
        -
        -
        -
        -
        - -
        -
        -
        -
        -
        -
        -
        diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.java deleted file mode 100644 index af4779e56b0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.multiscreen; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.RequiresResize; -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLDocument; -import elemental2.dom.HTMLElement; -import jsinterop.base.Js; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.views.pfly.widgets.Button; -import org.uberfire.client.workbench.widgets.listbar.ResizeFlowPanel; -import org.uberfire.mvp.Command; - -@Dependent -@Templated -public class MultiScreenView implements IsElement, - RequiresResize { - - @Inject - @DataField("screen") - HTMLDivElement screen; - - @Inject - @DataField("content") - ResizeFlowPanel content; - - @Inject - @DataField("title") - HTMLDivElement title; - - @Inject - @DataField("actions") - HTMLDivElement actions; - - HTMLDivElement actionsMenu; - - @Inject - @DataField("close") - Button close; - - @Inject - @DataField("close-group") - HTMLDivElement closeGroup; - - @Inject - HTMLDocument document; - - @Override - public HTMLElement getElement() { - return screen; - } - - public void setContent(final IsWidget widget) { - content.add(widget); - } - - public void setCloseHandler(final Command closeHandler) { - this.close.setClickHandler(closeHandler); - } - - public void setTitle(final String title) { - this.title.textContent = title; - } - - public void setTitleWidget(final IsWidget widget) { - final HTMLElement element = Js.cast(widget.asWidget().getElement()); - HTMLDivElement div = (HTMLDivElement) document.createElement("div"); - div.style.setProperty("display", - "inline-block"); - div.style.setProperty("padding-left", - "10px"); - div.style.setProperty("vertical-align", - "middle"); - div.appendChild(element); - this.title.appendChild(div); - } - - public void show() { - screen.classList.remove("hidden"); - } - - public boolean isVisible(){ - return screen.classList.contains("hidden") == false; - } - - public void hide() { - screen.classList.add("hidden"); - } - - public void addMenus(final HTMLElement element) { - if (actionsMenu == null) { - actionsMenu = (HTMLDivElement) document.createElement("div"); - actionsMenu.classList.add("form-group"); - if (actions.hasChildNodes()) { - actions.insertBefore(actionsMenu, - actions.childNodes.item(0)); - } else { - actions.appendChild(actionsMenu); - } - } - actionsMenu.appendChild(element); - } - - public void disableClose() { - actions.removeChild(closeGroup); - } - - @Override - public void onResize() { - content.onResize(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.less b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.less deleted file mode 100644 index d3db9758016..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/multiscreen/MultiScreenView.less +++ /dev/null @@ -1,98 +0,0 @@ -@import "/org/uberfire/client/views/static/uberfire-variables.less"; - -.multi-screen { - background-color: @color-pf-white; - height: 100%; - - // Page Content - .page-content-kie { - background-color: @color-pf-white; - padding-bottom: 1em; - } - - .fixed-header + .page-content-kie { - padding-top: 4em; - } - - .page-content-kie:after { - content: " "; - display: table; - clear: both; - } - - .main-container .multi-screen-toolbar-pf { - background-color: @color-pf-white; - padding: 0.8em 0; - border: 0; - } - - .multi-screen-toolbar-pf { - padding: 0.8em 1.5em; - } - - .multi-screen-toolbar-pf .form-group, - .multi-screen-toolbar-pf .btn-group { - margin-bottom: 0; - display: flex; - } - - .multi-screen-toolbar-pf .form-group { - padding-right: 10px; - } - - .multi-screen-toolbar-pf .form-group:last-of-type { - border-right: none; - } - - .multi-screen-toolbar-pf .toolbar-pf-actions { - margin-bottom: 0; - display: flex; - justify-content: space-between; - align-items: center; - } - - .multi-screen-toolbar-pf .toolbar-pf-action-right .form-group .btn + .btn { - margin-left: 10px; - } - - .multi-screen-toolbar-pf .form-group .btn-link { - color: @color-pf-blue; - font-size: 1em; - } - - .multi-screen-toolbar-pf .form-group .btn-link .pficon, - .multi-screen-toolbar-pf .form-group .btn-link .fa { - font-size: 1.3em; - margin-left: 5px; - } - - .multi-screen-toolbar-pf .form-group .btn-link .pficon-close:not(:hover) { - color: @color-pf-black; - } - - // Title for toolbar inside content section - .toolbar-data-title-kie { - display: table-cell; - float: left; - font-size: 1.5em; - margin-right: 1em; - } - - .btn-group button { - margin: 0px 4px; - } - - .btn-group .separator-left { - margin-left: 4px !important; - padding-left: 8px; - border-left: 1px solid #d1d1d1; - } - - .gwt-container { - position: relative; - top: 0px; - left: 0px; - width: 100%; - height: 100%; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.html deleted file mode 100644 index 125b91785c1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.html +++ /dev/null @@ -1,19 +0,0 @@ - - -
        -

        Activity Not Found:

        -
        diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.java deleted file mode 100644 index b15297909f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notfound/ActivityNotFoundView.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.views.pfly.notfound; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.ui.Composite; -import org.gwtbootstrap3.client.ui.html.Span; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.workbench.widgets.notfound.ActivityNotFoundPresenter; - -/** - * Gets shown inside a popup activity when the PlaceManager can't find a particular place. - */ -@Dependent -@Templated -public class ActivityNotFoundView extends Composite implements ActivityNotFoundPresenter.View { - - private ActivityNotFoundPresenter presenter; - - @Inject - @DataField - private Span identifier = new Span(); - - @Override - public void init(final ActivityNotFoundPresenter presenter) { - this.presenter = presenter; - } - - @Override - public void setRequestedPlaceIdentifier(final String identifier) { - this.identifier.setHTML(identifier); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupView.java deleted file mode 100644 index d16aa81a0cf..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupView.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.notifications; - -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.DecoratedPopupPanel; -import org.gwtbootstrap3.client.ui.Alert; -import org.gwtbootstrap3.client.ui.Anchor; -import org.gwtbootstrap3.client.ui.constants.AlertType; -import org.uberfire.client.resources.WorkbenchResources; -import org.uberfire.client.workbench.widgets.animations.LinearFadeInAnimation; -import org.uberfire.client.workbench.widgets.animations.Pause; -import org.uberfire.client.workbench.widgets.animations.Sequencer; -import org.uberfire.workbench.events.NotificationEvent; - -/** - * The view for an individual newly created notification message. - */ -public class NotificationPopupView extends DecoratedPopupPanel { - - private final Alert notification = new Alert(); - - public NotificationPopupView() { - setStyleName(WorkbenchResources.INSTANCE.CSS().notification()); - setWidget(notification); - notification.setDismissable(true); - } - - /** - * Set the text to display - * @param text - */ - public void setNotification(final String text) { - notification.setText(text); - } - - public void setType(final NotificationEvent.NotificationType type) { - AlertType bs3Type; - switch (type) { - case ERROR: - bs3Type = AlertType.DANGER; - break; - case DEFAULT: - bs3Type = AlertType.INFO; - break; - default: - bs3Type = AlertType.valueOf(type.toString()); - break; - } - notification.setType(bs3Type); - } - - /** - * Set the width of the Notification pop-up - * @param width - */ - public void setNotificationWidth(final String width) { - //Setting the width of the DecoratedPopupPanel causes it to be rendered incorrectly. - //We therefore set the size of an internal element that holds the actual content. - notification.setWidth(width); - } - - public void show(final Command onCompleteCommand) { - show(onCompleteCommand, - true); - } - - /** - * Show the Notification pop-up. This consists of fading the pop-up into - * view and pausing. Once complete the onCompleteCommand will be executed. - * @param onCompleteCommand - */ - public void show(final Command onCompleteCommand, - final boolean autoHide) { - - final LinearFadeInAnimation fadeInAnimation = new LinearFadeInAnimation(this) { - @Override - public void onStart() { - super.onStart(); - NotificationPopupView.this.show(); - } - }; - - final Pause pauseAnimation = new Pause() { - @Override - public void onComplete() { - super.onComplete(); - onCompleteCommand.execute(); - } - }; - - final Sequencer s = new Sequencer(); - s.add(fadeInAnimation, 250); - - if (autoHide) { - s.add(pauseAnimation, 2000); - } else { - notification.addCloseHandler(evt -> onCompleteCommand.execute()); - } - - s.run(); - } - - public void addNavigation(String text, Command command) { - Anchor nav = new Anchor(); - nav.setText(text); - nav.addClickHandler(evt -> command.execute()); - nav.setMarginLeft(15); - notification.add(nav); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupsManagerView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupsManagerView.java deleted file mode 100644 index 2c00a87f8f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/notifications/NotificationPopupsManagerView.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.notifications; - -import java.util.ArrayList; -import java.util.List; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.user.client.Command; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.jboss.errai.ioc.client.container.SyncBeanDef; -import org.kie.soup.commons.validation.PortablePreconditions; -import org.uberfire.client.mvp.Activity; -import org.uberfire.client.mvp.ActivityBeansCache; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.workbench.widgets.animations.LinearFadeOutAnimation; -import org.uberfire.client.workbench.widgets.notifications.NotificationManager; -import org.uberfire.client.workbench.widgets.notifications.NotificationManager.NotificationPopupHandle; -import org.uberfire.workbench.events.NotificationEvent; - -@Dependent -public class NotificationPopupsManagerView implements NotificationManager.View { - - private final int SPACING = 48; - private final List activeNotifications = new ArrayList(); - private final List pendingRemovals = new ArrayList(); - //When true we are in the process of removing a notification message - private boolean removing = false; - private int initialSpacing = SPACING; - private IsWidget container; - @Inject - private PlaceManager placeManager; - @Inject - private ActivityBeansCache activityBeansCache; - - @Override - public void setContainer(final IsWidget container) { - this.container = PortablePreconditions.checkNotNull("container", - container); - } - - @Override - public void setInitialSpacing(int spacing) { - this.initialSpacing = spacing; - } - - @Override - public NotificationPopupHandle show(NotificationEvent event, - Command hideCommand) { - if (container == null) { - throw new IllegalStateException("The setContainer() method hasn't been called!"); - } - - final NotificationPopupView view = new NotificationPopupView(); - final PopupHandle popupHandle = new PopupHandle(view, - event); - - activeNotifications.add(popupHandle); - int size = activeNotifications.size(); - int topMargin = (size == 1) ? initialSpacing : (size * SPACING) - (SPACING - initialSpacing); - view.setPopupPosition(getLeftPosition(container.asWidget()) + getMargin(), - getTopPosition(container.asWidget()) + topMargin); - view.setNotification(event.getNotification()); - view.setType(event.getType()); - view.setNotificationWidth(getWidth() + "px"); - - if (event.hasNavigation()) { - final String identifier = event.getNavigationPlace().getIdentifier(); - final SyncBeanDef syncBeanDefActivity = activityBeansCache.getActivity(identifier); - view.addNavigation( - event.getNavigationText(), - () -> { - hideCommand.execute(); - placeManager.goTo(event.getNavigationPlace()); - }); - } - - view.show(hideCommand, - event.autoHide()); - - return popupHandle; - } - - private int getTopPosition(final Widget widget) { - int top = widget.getAbsoluteTop(); - // if top is negative (due to scrolling) we try to align with the parent - // to make sure the notifications are always visible - if (top < 0 && widget.getParent() != null) { - top = getTopPosition(widget.getParent()); - } - return Math.max(top, - 0); - } - - private int getLeftPosition(final Widget widget) { - int left = widget.getAbsoluteLeft(); - // if left is negative (due to scrolling) we try to align with the parent - // to make sure the notifications are always visible - if (left < 0 && widget.getParent() != null) { - left = getLeftPosition(widget.getParent()); - } - return Math.max(left, - 0); - } - - @Override - public void hide(final NotificationPopupHandle handle) { - if (container == null) { - throw new IllegalStateException("The setContainer() method hasn't been called!"); - } - - final int removingIndex = activeNotifications.indexOf(handle); - if (removingIndex == -1) { - return; - } - if (removing) { - pendingRemovals.add((PopupHandle) handle); - return; - } - removing = true; - final NotificationPopupView view = ((PopupHandle) handle).view; - final LinearFadeOutAnimation fadeOutAnimation = new LinearFadeOutAnimation(view) { - - @Override - public void onUpdate(double progress) { - super.onUpdate(progress); - for (int i = removingIndex; i < activeNotifications.size(); i++) { - NotificationPopupView v = activeNotifications.get(i).view; - final int left = v.getPopupLeft(); - final int top = (int) (((i + 1) * SPACING) - (progress * SPACING)) - (SPACING - initialSpacing) + - getTopPosition(container.asWidget()); - v.setPopupPosition(left, - top); - } - } - - @Override - public void onComplete() { - super.onComplete(); - view.hide(); - activeNotifications.remove(handle); - removing = false; - if (pendingRemovals.size() > 0) { - PopupHandle popupHandle = pendingRemovals.remove(0); - hide(popupHandle); - } - } - }; - fadeOutAnimation.run(500); - } - - @Override - public void hideAll() { - for (NotificationPopupHandle handle : activeNotifications) { - hide(handle); - } - } - - @Override - public boolean isShowing(NotificationEvent event) { - for (PopupHandle handle : activeNotifications) { - if (handle.event.equals(event)) { - return true; - } - } - return false; - } - - //80% of container width - private int getWidth() { - return (int) (container.asWidget().getElement().getClientWidth() * 0.8); - } - - //10% of container width - private int getMargin() { - return (container.asWidget().getElement().getClientWidth() - getWidth()) / 2; - } - - private static class PopupHandle implements NotificationPopupHandle { - - final NotificationPopupView view; - final NotificationEvent event; - - PopupHandle(NotificationPopupView view, - NotificationEvent event) { - this.view = PortablePreconditions.checkNotNull("view", - view); - this.event = PortablePreconditions.checkNotNull("event", - event); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/popup/PopupViewImpl.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/popup/PopupViewImpl.java deleted file mode 100644 index 2822fb256fd..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/popup/PopupViewImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.uberfire.client.views.pfly.popup; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.event.logical.shared.CloseEvent; -import com.google.gwt.event.logical.shared.CloseHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.SimplePanel; -import org.gwtbootstrap3.client.shared.event.ModalHiddenEvent; -import org.gwtbootstrap3.client.shared.event.ModalHiddenHandler; -import org.gwtbootstrap3.client.shared.event.ModalHideEvent; -import org.gwtbootstrap3.client.shared.event.ModalHideHandler; -import org.gwtbootstrap3.client.ui.ModalSize; -import org.uberfire.client.annotations.WorkbenchPopup.WorkbenchPopupSize; -import org.uberfire.client.views.pfly.modal.Bs3Modal; -import org.uberfire.client.workbench.widgets.popup.PopupView; - -@Dependent -public class PopupViewImpl extends Composite implements PopupView { - - @Inject - private Bs3Modal modal; - - @PostConstruct - public void init() { - final SimplePanel panel = new SimplePanel(modal); - initWidget(panel); - } - - @Override - public void setContent(final IsWidget widget) { - modal.setContent(widget); - } - - @Override - public void setSize(final WorkbenchPopupSize size) { - ModalSize modalSize = ModalSize.MEDIUM; - switch (size) { - case LARGE: - modalSize = ModalSize.LARGE; - break; - case MEDIUM: - modalSize = ModalSize.MEDIUM; - break; - case SMALL: - modalSize = ModalSize.SMALL; - break; - } - modal.setSize(modalSize); - } - - @Override - public void setTitle(final String title) { - modal.setTitle(title); - } - - @Override - public void show() { - modal.show(); - - modal.addHiddenHandler(new ModalHiddenHandler() { - @Override - public void onHidden(final ModalHiddenEvent hiddenEvent) { - CloseEvent.fire(PopupViewImpl.this, - PopupViewImpl.this, - false); - } - }); - - modal.addHideHandler(new ModalHideHandler() { - @Override - public void onHide(ModalHideEvent evt) { - CloseEvent.fire(PopupViewImpl.this, - PopupViewImpl.this, - false); - } - }); - } - - @Override - public void hide() { - modal.hide(); - } - - @Override - public HandlerRegistration addCloseHandler(final CloseHandler handler) { - return addHandler(handler, - CloseEvent.getType()); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/resources/i18n/Constants.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/resources/i18n/Constants.java deleted file mode 100644 index 306e1600b0d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/resources/i18n/Constants.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.resources.i18n; - -import org.jboss.errai.ui.shared.api.annotations.TranslationKey; - -public interface Constants { - - @TranslationKey(defaultValue = "") - String Actions = "Actions"; - - @TranslationKey(defaultValue = "") - String ApplyLabel = "ApplyLabel"; - - @TranslationKey(defaultValue = "") - String CancelLabel = "CancelLabel"; - - @TranslationKey(defaultValue = "") - String FromLabel = "FromLabel"; - - @TranslationKey(defaultValue = "") - String ToLabel = "ToLabel"; - - @TranslationKey(defaultValue = "") - String CustomRangeLabel = "CustomRangeLabel"; - - @TranslationKey(defaultValue = "") - String WeekLabel = "WeekLabel"; - - @TranslationKey(defaultValue = "") - String SundayShort = "SundayShort"; - - @TranslationKey(defaultValue = "") - String MondayShort = "MondayShort"; - - @TranslationKey(defaultValue = "") - String TuesdayShort = "TuesdayShort"; - - @TranslationKey(defaultValue = "") - String WednesdayShort = "WednesdayShort"; - - @TranslationKey(defaultValue = "") - String ThursdayShort = "ThursdayShort"; - - @TranslationKey(defaultValue = "") - String FridayShort = "FridayShort"; - - @TranslationKey(defaultValue = "") - String SaturdayShort = "SaturdayShort"; - - @TranslationKey(defaultValue = "") - String January = "January"; - - @TranslationKey(defaultValue = "") - String February = "February"; - - @TranslationKey(defaultValue = "") - String March = "March"; - - @TranslationKey(defaultValue = "") - String April = "April"; - - @TranslationKey(defaultValue = "") - String May = "May"; - - @TranslationKey(defaultValue = "") - String June = "June"; - - @TranslationKey(defaultValue = "") - String July = "July"; - - @TranslationKey(defaultValue = "") - String August = "August"; - - @TranslationKey(defaultValue = "") - String September = "September"; - - @TranslationKey(defaultValue = "") - String October = "October"; - - @TranslationKey(defaultValue = "") - String November = "November"; - - @TranslationKey(defaultValue = "") - String December = "December"; - - @TranslationKey(defaultValue = "") - String Menu = "Menu"; - - @TranslationKey(defaultValue = "") - String Home = "Home"; - - @TranslationKey(defaultValue = "") - String ErrorPopupView_ShowDetailLabel = "ErrorPopupView.ShowDetailLabel"; - - @TranslationKey(defaultValue = "") - String ErrorPopupView_CloseDetailLabel = "ErrorPopupView.CloseDetailLabel"; - - @TranslationKey(defaultValue = "Cancel") - String ConfirmPopup_Cancel = "ConfirmPopup.Cancel"; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/ElementHelper.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/ElementHelper.java deleted file mode 100644 index 047befd53fe..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/ElementHelper.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import elemental2.dom.Node; - -public class ElementHelper { - - public static void insertAfter(final Node newNode, - final Node referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); - } - - public static void insertBefore(final Node newNode, - final Node referenceNode) { - referenceNode.parentNode.insertBefore(newNode, referenceNode); - } - - public static void remove(final Node element) { - element.parentNode.removeChild(element); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuery.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuery.java deleted file mode 100644 index 2b7428da33d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuery.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import com.google.gwt.core.client.JavaScriptObject; -import elemental2.dom.Element; -import elemental2.dom.Node; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -import static jsinterop.annotations.JsPackage.GLOBAL; - -@JsType(isNative = true) -public abstract class JQuery { - - @JsProperty(namespace = GLOBAL, name = "jQuery") - public static JQuery $; - - @JsMethod(namespace = GLOBAL, name = "jQuery") - public native static JQuery $(final Node selector); - - @JsMethod(namespace = GLOBAL, name = "jQuery") - public native static JQuery $(final String selector); - - public native JQuery animate(final JavaScriptObject properties, - final int duration); - - public native JQuery on(final String event, - final CallbackFunction callbackFunction); - - public native JQuery append(final JQuery jQueryElement); - - public native JQuery css(final JavaScriptObject properties); - - public native JQuery detach(); - - public native JQueryList filter(final String selector); - - public native JQueryElementOffset offset(); - - public native boolean contains(final Element container, - final Element contained); - - @JsFunction - public interface CallbackFunction { - - void call(final JQueryEvent event); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryElementOffset.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryElementOffset.java deleted file mode 100644 index e7b7394a378..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryElementOffset.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.uberfire.client.views.pfly.selectpicker; - -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQueryElementOffset { - - public double top; - - public double left; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryEvent.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryEvent.java deleted file mode 100644 index 51cee2f3fd7..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import elemental2.dom.Element; -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQueryEvent { - - public Element target; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryList.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryList.java deleted file mode 100644 index eaa56b55fc4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQueryList.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQueryList { - - public int length; - - public abstract T get(final int index); -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPicker.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPicker.java deleted file mode 100644 index 6cdc2102a64..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPicker.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import elemental2.dom.Element; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsType; - -import static jsinterop.annotations.JsPackage.GLOBAL; - -@JsType(isNative = true) -public abstract class JQuerySelectPicker { - - @JsMethod(namespace = GLOBAL, name = "jQuery") - public native static JQuerySelectPicker $(final Element selector); - - @JsMethod(namespace = GLOBAL, name = "jQuery") - public native static JQuerySelectPicker $(final String selector); - - public native JQuerySelectPicker selectpicker(final String method); - - public native JQuerySelectPicker selectpicker(final String method, - final String value); - - public native JQuerySelectPicker on(final String event, - final CallbackFunction callbackFunction); - - public native JQuerySelectPicker off(final String event); - - public native String val(); - - @JsFunction - public interface CallbackFunction { - - void call(final JQuerySelectPickerEvent event); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerEvent.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerEvent.java deleted file mode 100644 index 926ecb72bea..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQuerySelectPickerEvent { - - public JQuerySelectPickerTarget target; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerTarget.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerTarget.java deleted file mode 100644 index 6cce0b817b3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/selectpicker/JQuerySelectPickerTarget.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.selectpicker; - -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQuerySelectPickerTarget { - - public String value; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/style/PatternFlyStyles.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/style/PatternFlyStyles.java deleted file mode 100644 index d178eb2a94d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/style/PatternFlyStyles.java +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.style; - -public class PatternFlyStyles { - - public static final String NAV_ITEM_ICONIC = "nav-item-iconic"; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/MomentUtils.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/MomentUtils.java deleted file mode 100644 index b0bf2ea781c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/MomentUtils.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.sys; - -import java.util.Optional; - -import com.google.gwt.i18n.client.LocaleInfo; - -public class MomentUtils { - - protected static void setMomentLocale(){ - setMomentLocale(getLocaleName(LocaleInfo.getCurrentLocale().getLocaleName())); - } - - /** - * Transform GWT locale to moment.js locale - * See moment.js - * @return - */ - protected static String getLocaleName(final String gwtLocale) { - final String locale = Optional.of(gwtLocale).get().toLowerCase().replace("_", - "-"); - - if (locale.isEmpty() || "default".equals(locale)) { - return "en"; - } else { - return locale; - } - } - - public static native void setMomentLocale(final String locale) /*-{ - $wnd.moment.locale(locale); - }-*/; - -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyBootstrapper.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyBootstrapper.java deleted file mode 100644 index d9cdece85c8..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyBootstrapper.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.sys; - -import com.google.gwt.core.client.ScriptInjector; -import org.gwtbootstrap3.client.GwtBootstrap3ClientBundle; - -import static org.uberfire.client.views.pfly.sys.MomentUtils.setMomentLocale; - -/** - * Utilities for ensuring the PatternFly/BS3 system is working early enough that the app can start correctly. - */ -public class PatternFlyBootstrapper { - - private static boolean isPrettifyLoaded = false; - - private static boolean isBootstrapSelectLoaded = false; - - private static boolean isBootstrapDateRangePickerLoaded = false; - - private static boolean isMomentLoaded = false; - - private static boolean isMomentTimeZoneLoaded = false; - - private static boolean isPatternFlyLoaded = false; - - private static boolean isD3Loaded = false; - - private static boolean isJQueryUILoaded = false; - - /** - * Uses GWT's ScriptInjector to put jQuery in the page if it isn't already. All Errai IOC beans that rely on - * GWTBootstrap 3 widgets should call this before creating their first such widget. - */ - public static void ensurejQueryIsAvailable() { - if (!isjQueryLoaded()) { - ScriptInjector.fromString(GwtBootstrap3ClientBundle.INSTANCE.jQuery().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - } - } - - public static void ensureBootstrapSelectIsAvailable() { - if (!isBootstrapSelectLoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.bootstrapSelect().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isBootstrapSelectLoaded = true; - } - } - - public static void ensurePatternFlyIsAvailable() { - ensurejQueryIsAvailable(); - ensureBootstrapSelectIsAvailable(); - if (!isPatternFlyLoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.patternFly().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isPatternFlyLoaded = true; - } - } - - public static void ensureMomentIsAvailable() { - if (!isMomentLoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.moment().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isMomentLoaded = true; - } - setMomentLocale(); - } - - public static void ensureMomentTimeZoneIsAvailable() { - if (!isMomentTimeZoneLoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.momentTimeZone().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isMomentTimeZoneLoaded = true; - } - } - - public static void ensureBootstrapDateRangePickerIsAvailable() { - ensureMomentIsAvailable(); - if (!isBootstrapDateRangePickerLoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.bootstrapDateRangePicker().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isBootstrapDateRangePickerLoaded = true; - } - } - - public static void ensureD3IsAvailable() { - if (!isD3Loaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.d3().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isD3Loaded = true; - } - } - - public static void ensureJQueryUIIsAvailable() { - if (!isJQueryUILoaded) { - ScriptInjector.fromString(PatternFlyClientBundle.INSTANCE.jQueryUI().getText()) - .setWindow(ScriptInjector.TOP_WINDOW) - .inject(); - isJQueryUILoaded = true; - } - } - - /** - * Checks to see if jQuery is already present. - * - * @return true is jQuery is loaded, false otherwise. - */ - private static native boolean isjQueryLoaded() /*-{ - return (typeof $wnd['jQuery'] !== 'undefined'); - }-*/; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyClientBundle.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyClientBundle.java deleted file mode 100644 index e6223b6d1f5..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/sys/PatternFlyClientBundle.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.sys; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.resources.client.ClientBundle; -import com.google.gwt.resources.client.TextResource; - -public interface PatternFlyClientBundle extends ClientBundle { - - PatternFlyClientBundle INSTANCE = GWT.create(PatternFlyClientBundle.class); - - @Source("org/uberfire/client/views/static/bootstrap-select/js/bootstrap-select.min.js") - TextResource bootstrapSelect(); - - @Source("org/uberfire/client/views/static/js/patternfly.min.js") - TextResource patternFly(); - - @Source("org/uberfire/client/views/static/moment/moment-with-locales.min.js") - TextResource moment(); - - @Source("org/uberfire/client/views/static/moment-timezone/moment-timezone-with-data-2012-2022.min.js") - TextResource momentTimeZone(); - - @Source("org/uberfire/client/views/static/bootstrap-daterangepicker/daterangepicker.js") - TextResource bootstrapDateRangePicker(); - - @Source("org/uberfire/client/views/static/d3/d3.min.js") - TextResource d3(); - - @Source("org/uberfire/client/views/static/jquery-ui/jquery-ui.min.js") - TextResource jQueryUI(); - -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/Resize.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/Resize.java deleted file mode 100644 index ea98d2d9593..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/Resize.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2016 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.tab; - -import java.lang.annotation.Retention; - -import javax.inject.Qualifier; - -import static java.lang.annotation.RetentionPolicy.RUNTIME; - -@Qualifier -@Retention(RUNTIME) -public @interface Resize { - -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/ResizeTabPanel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/ResizeTabPanel.java deleted file mode 100644 index 73fa4962d12..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/ResizeTabPanel.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.tab; - -import javax.enterprise.context.Dependent; - -import com.google.gwt.user.client.ui.ProvidesResize; -import com.google.gwt.user.client.ui.RequiresResize; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.TabPane; -import org.uberfire.client.resources.WorkbenchResources; -import org.uberfire.client.util.Layouts; - -@Dependent -@Resize -public class ResizeTabPanel extends TabPanelWithDropdowns implements RequiresResize, - ProvidesResize { - - @Override - public void onResize() { - final Widget parent = this.getParent(); - - int width = parent.getOffsetWidth(); - int height = parent.getOffsetHeight(); - - if (width == 0 && height == 0) { - //it's `invisible` = makes no sense try to resize - return; - } - - height = height - getTabBarHeight(); - Layouts.setToFillParent(this); - - // TabContent is just a container for all the TabPane divs, one of which is made visible at a time. - // For compatibility with GWT LayoutPanel, we have to set both layers of children to fill their parents. - // We do it in onResize() to get to the TabPanes no matter how they were added. - for (Widget child : tabContent) { - child.setPixelSize(width, - height); - Layouts.setToFillParent(child); - if (child instanceof TabPane) { - final TabPane tabPane = (TabPane) child; - if (tabPane.isActive()) { - for (int i = 0; i < tabPane.getWidgetCount(); i++) { - final Widget tabChild = tabPane.getWidget(i); - tabChild.setPixelSize(width, - height); - Layouts.setToFillParent(tabChild); - if (tabChild instanceof RequiresResize) { - ((RequiresResize) tabChild).onResize(); - } - } - } - } - } - } - - /** - * Returns the height (in pixels) taken up by the tab bar. - */ - public int getTabBarHeight() { - return tabBar.getOffsetHeight(); - } - - /** - * Makes the tab panel look more or less prominent. - * @param hasFocus if true, the tab panel will look more prominent. If false, the tab panel will look normal. - */ - public void setFocus(boolean hasFocus) { - if (hasFocus) { - tabBar.addStyleName(WorkbenchResources.INSTANCE.CSS().activeNavTabs()); - } else { - tabBar.removeStyleName(WorkbenchResources.INSTANCE.CSS().activeNavTabs()); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelEntry.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelEntry.java deleted file mode 100644 index 96cc9b7902a..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelEntry.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.tab; - -import java.util.function.Consumer; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.dom.client.HasClickHandlers; -import com.google.gwt.event.dom.client.HasMouseDownHandlers; -import com.google.gwt.event.dom.client.MouseDownEvent; -import com.google.gwt.event.dom.client.MouseDownHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.ui.TabListItem; -import org.gwtbootstrap3.client.ui.TabPane; -import org.gwtbootstrap3.client.ui.base.HasActive; -import org.uberfire.client.workbench.ouia.OuiaAttribute; -import org.uberfire.client.workbench.ouia.OuiaComponent; -import org.uberfire.client.workbench.ouia.OuiaComponentIdAttribute; -import org.uberfire.client.workbench.ouia.OuiaComponentTypeAttribute; - -/** - * Represents an entry in a {@link TabPanelWithDropdowns}. Keeps track of the current title, the tab widget (which could - * be one of two different types depending on whether the entry is at top-level tab or nested in a dropdown tab), and - * the associated content widget. - */ -public class TabPanelEntry implements HasActive { - - private final DropDownTabListItem tab; - /** - * Container for {@link #contents}. - */ - private final TabPane contentPane; - /** - * The application-provided content widget that should show up when the tab is clicked. - */ - private final Widget contents; - private String title; - - public TabPanelEntry(String title, - Widget contents) { - this.title = title; - this.tab = GWT.create(DropDownTabListItem.class); - this.tab.setText(title); - this.tab.initOuiaComponentAttributes(); - this.contents = contents; - - contentPane = GWT.create(TabPane.class); - contentPane.add(contents); - - tab.setDataTargetWidget(contentPane); - } - - public DropDownTabListItem getTabWidget() { - return tab; - } - - public Widget getContents() { - return contents; - } - - /** - * Returns the intermediate container that holds the real contents. - */ - public TabPane getContentPane() { - return contentPane; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - tab.setText(title); - } - - public void setInDropdown(boolean inDropdown) { - tab.setInDropdown(inDropdown); - } - - /** - * Returns true if this tab panel entry believes it's currently the active (displayed) tab in its tab panel. - */ - @Override - public boolean isActive() { - return contentPane.isActive(); - } - - /** - * Sets or clears the active state on this tab. Does not actually cause the tab to hide or show. - */ - @Override - public void setActive(boolean b) { - tab.setActive(b); - contentPane.setActive(b); - } - - /** - * Makes this tab show itself and become the active tab, replacing whatever tab was previously active. - */ - public void showTab() { - tab.showTab(false); - } - - @Override - public String toString() { - return "TabPanelEntry \"" + title + "\""; - } - - /** - * Represents the tab widget that lives in the tab bar or under a dropdown tab. - */ - public static class DropDownTabListItem extends TabListItem implements HasClickHandlers, - HasMouseDownHandlers, - OuiaComponent { - - public DropDownTabListItem() { - this(null); - } - - public DropDownTabListItem(String label) { - super(label); - addStyleName("uf-dropdown-tab-list-item"); - } - - /** - * Sets this tab for use in the top-level tab bar (isDropdown false) or inside a dropdown tab (isDropdown true). - */ - public void setInDropdown(boolean inDropdown) { - anchor.setTabIndex(inDropdown ? -1 : 0); - } - - /** - * Adds the given widget as a child of the anchor within the tab. - */ - public void addToAnchor(Widget w) { - anchor.add(w); - } - - @Override - public HandlerRegistration addClickHandler(ClickHandler handler) { - return addDomHandler(handler, - ClickEvent.getType()); - } - - @Override - public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { - return addDomHandler(handler, - MouseDownEvent.getType()); - } - - @Override - public OuiaComponentTypeAttribute ouiaComponentType() { - return new OuiaComponentTypeAttribute("editor-nav-tab"); - } - - @Override - public OuiaComponentIdAttribute ouiaComponentId() { - return new OuiaComponentIdAttribute(getText()); - } - - @Override - public Consumer ouiaAttributeRenderer() { - return ouiaAttribute -> getElement().setAttribute(ouiaAttribute.getName(), - ouiaAttribute.getValue()); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java deleted file mode 100644 index 0f6df17232c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java +++ /dev/null @@ -1,458 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.tab; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; - -import com.google.common.collect.HashMultimap; -import com.google.common.collect.Multimap; -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.HorizontalPanel; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.shared.event.TabShowEvent; -import org.gwtbootstrap3.client.shared.event.TabShowHandler; -import org.gwtbootstrap3.client.shared.event.TabShownEvent; -import org.gwtbootstrap3.client.shared.event.TabShownHandler; -import org.gwtbootstrap3.client.ui.AnchorListItem; -import org.gwtbootstrap3.client.ui.DropDownMenu; -import org.gwtbootstrap3.client.ui.NavTabs; -import org.gwtbootstrap3.client.ui.TabContent; -import org.gwtbootstrap3.client.ui.TabListItem; -import org.gwtbootstrap3.client.ui.TabPane; -import org.gwtbootstrap3.client.ui.TabPanel; -import org.gwtbootstrap3.client.ui.constants.IconPosition; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.gwtbootstrap3.client.ui.constants.Styles; -import org.gwtbootstrap3.client.ui.constants.Toggle; - -import static com.google.gwt.i18n.client.HasDirection.Direction.LTR; -import static com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant.endOf; - -/** - * A Bootstrap3 TabPanel which supports a mix of normal tabs and tabs that are dropdown menus. Selecting an item from a - * dropdown menu tab causes that item's associated content to display in the tab panel's content area. - */ -@Dependent -public class TabPanelWithDropdowns extends Composite { - - private static TabPanelWithDropdownsBinder uiBinder = GWT.create(TabPanelWithDropdownsBinder.class); - /** - * Widgets we have created that can have the CSS style name "active" added to them. When a new tab is selected, all - * of these widgets get the "active" style removed from them. - */ - private final Set activatableWidgets = new HashSet(); - /** - * Removes the "active" style class from all widgets in {@link #activatableWidgets}, then propagates the event to - * the panel-level listeners. - */ - private final TabShowHandler individualTabShowHandler = new TabShowHandler() { - - @Override - public void onShow(TabShowEvent showEvent) { - for (Widget w : activatableWidgets) { - if (showEvent.getTab().asWidget() != w) { - w.removeStyleName(Styles.ACTIVE); - } - } - TabPanelWithDropdowns.this.fireEvent(showEvent); - } - }; - /** - * Propagates the event to the panel-level listeners. - */ - private final TabShownHandler individualTabShownHandler = new TabShownHandler() { - @Override - public void onShown(TabShownEvent shownEvent) { - TabPanelWithDropdowns.this.fireEvent(shownEvent); - } - }; - /** - * These are our own registrations on the events from the individual tabs, which must be removed when the associated - * tab is removed. This is not a record of registrations we've handed out at the panel level: those are - * managed by this widget's HandlerManager. - */ - private final Multimap tabHandlerRegistrations = HashMultimap.create(); - /** - * All tabs (both top-level and nested) that have content associated with them. In other words, everything except - * the dropdown tabs themselves. - */ - private final Set allContentTabs = new HashSet(); - /** - * The area that contains the tab bar and any additional custom widgets - */ - @UiField - protected HorizontalPanel tabBarPanel; - /** - * The bar at the top where the tabs sit. - */ - @UiField - protected NavTabs tabBar; - /** - * The area where custom widgets can be added to the right end of the tab bar - */ - @UiField - protected HorizontalPanel widgetsPanel; - /** - * The content area that shows the content for the currently selected tab. - */ - @UiField - protected TabContent tabContent; - - /** - * Registers a handler that is notified just before any tab in this panel (nested under a dropdown or not) is shown. - * @param tabShowHandler the handler that will receive the notifications. - */ - public HandlerRegistration addShowHandler(TabShowHandler tabShowHandler) { - return addHandler(tabShowHandler, - TabShowEvent.getType()); - } - - /** - * Registers a handler that is notified just after any tab in this panel (nested under a dropdown or not) is shown. - * @param tabShownHandler the handler that will receive the notifications. - */ - public HandlerRegistration addShownHandler(TabShownHandler tabShownHandler) { - return addHandler(tabShownHandler, - TabShownEvent.getType()); - } - - /** - * Creates an empty tab panel. - */ - @PostConstruct - public void init() { - initWidget(uiBinder.createAndBindUi(this)); - } - - /** - * Adds a normal tab (not a dropdown) with the given label and contents. - * @param label the label for the tab itself. - * @param content the contents that should appear in the content area when the tab is selected. - * @return the newly created entry object that ties together the tab widget and its contents. - */ - public TabPanelEntry addItem(String label, - Widget content) { - TabPanelEntry tab = new TabPanelEntry(label, - content); - addItem(tab); - return tab; - } - - /** - * Adds a normal tab (not a dropdown) with the given label and contents (at the end of the tab bar). - * @param tab the label and contents associated with the new tab. - */ - public void addItem(final TabPanelEntry tab) { - - final int index = getAllContentTabs().size(); - - insertItem(tab, index); - } - - /** - * Adds a normal tab (not a dropdown) with the given label and contents (in a specific index). - * @param tab the label and contents associated with the new tab. - */ - public void insertItem(final TabPanelEntry tab, - final int index) { - - registerTabHandlers(tab); - insertTabAndContent(tab, index); - resizeTabContent(); - } - - void insertTabAndContent(final TabPanelEntry tab, - final int index) { - - final TabPanelEntry.DropDownTabListItem tabWidget = tab.getTabWidget(); - final TabPane tabContentPane = tab.getContentPane(); - - getTabBar().insert(tab.getTabWidget(), index); - - getAllContentTabs().add(tab); - getTabContent().add(tabContentPane); - getActivatableWidgets().add(tabWidget); - } - - void registerTabHandlers(final TabPanelEntry tab) { - - final Multimap registrations = getTabHandlerRegistrations(); - final TabPanelEntry.DropDownTabListItem tabWidget = tab.getTabWidget(); - - registrations.put(tab, tabWidget.addShowHandler(getIndividualTabShowHandler())); - registrations.put(tab, tabWidget.addShownHandler(getIndividualTabShownHandler())); - } - - TabShowHandler getIndividualTabShowHandler() { - return individualTabShowHandler; - } - - TabShownHandler getIndividualTabShownHandler() { - return individualTabShownHandler; - } - - Multimap getTabHandlerRegistrations() { - return tabHandlerRegistrations; - } - - Set getAllContentTabs() { - return allContentTabs; - } - - Set getActivatableWidgets() { - return activatableWidgets; - } - - public NavTabs getTabBar() { - return tabBar; - } - - TabContent getTabContent() { - return tabContent; - } - - HorizontalPanel getWidgetsPanel() { - return widgetsPanel; - } - - /** - * Removes the given tab and its associated contents that were previously added with - * {@link #addItem(String, Widget)}. Has no effect if the item is not currently in this tab panel. - * @param tab the item to remove. - */ - public boolean remove(TabPanelEntry tab) { - for (HandlerRegistration registration : tabHandlerRegistrations.removeAll(tab)) { - registration.removeHandler(); - } - boolean removed = tabBar.remove(tab.getTabWidget()); - tabContent.remove(tab.getContentPane()); - activatableWidgets.remove(tab.getTabWidget()); - allContentTabs.remove(tab); - resizeTabContent(); - return removed; - } - - void resizeTabContent() { - //When an Item is added to the TabBar recalculate the TabContent size. - //This cannot be performed in either the @PostConstruct or onAttach() methods as at - //these times the TabBar may not have any content and hence have no size. - tabContent.getElement().getStyle().setProperty("height", - "calc(100% - " + tabBar.getOffsetHeight() + "px)"); - } - - /** - * Adds a new tab to this panel that doesn't have any contents itself, but can contain multiple items that appear in - * a dropdown menu when the tab is clicked. This dropdown menu is initially empty. Items can be added and removed - * using the {@link DropDownTab#addItem(String, Widget)} and - * {@link DropDownTab#removeItem(String, Widget)} methods. - * @param label The text that should appear on the dropdown tab. - * @return the container for the items that appear when the tab is clicked. - */ - public DropDownTab addDropdownTab(String label) { - - AnchorListItem tab = new AnchorListItem(label); - - // FIXME should actually subclass AnchorListItem and add a to the anchor elem - tab.setIcon(IconType.ANGLE_DOWN); - tab.setIconPosition(IconPosition.RIGHT); - - tab.addStyleName(Styles.DROPDOWN_TOGGLE); - tab.setDataToggle(Toggle.DROPDOWN); - - DropDownTab dropDownTab = new DropDownTab(tab); - tab.add(dropDownTab); - addDropdownTab(dropDownTab); - - return dropDownTab; - } - - /** - * Adds a pre-made dropdown tab to this tab panel. This can be used for re-attaching a dropdown tab that was - * previously added with {@link #addDropdownTab(String)} and then removed. - * @param tab the tab to add back - */ - public void addDropdownTab(DropDownTab contents) { - AnchorListItem tab = contents.owningTab; - - // TODO for each contained tab, reattach handlers and add to allContentTabs list - - // gets set to active when one of the menu items is selected - activatableWidgets.add(tab); - tabBar.add(tab); - } - - /** - * Removes all tabs and content from this tab panel. - */ - public void clear() { - for (HandlerRegistration registration : tabHandlerRegistrations.values()) { - registration.removeHandler(); - } - tabHandlerRegistrations.clear(); - tabBar.clear(); - activatableWidgets.clear(); - tabContent.clear(); - allContentTabs.clear(); - } - - /** - * Returns the tab whose contents are currently being displayed. The tab widget itself may be a top-level tab, or - * nested under a dropdown tab. - * @return the currently selected (active) tab. If no tab has been displayed yet, returns null. - */ - public TabPanelEntry getActiveTab() { - for (TabPanelEntry entry : allContentTabs) { - if (entry.isActive()) { - return entry; - } - } - return null; - } - - /** - * Returns the tab index associated with the current selected tab. - * @return the currently selected (active) tab index. -1 If there is no active tab - */ - public int getSelectedTabIndex() { - final TabPanelEntry activeTab = getActiveTab(); - if (activeTab == null) { - return -1; - } else { - return tabBar.getWidgetIndex(activeTab.getTabWidget()); - } - } - - public void selectTabIndex(int index) { - final TabListItem item = (TabListItem) tabBar.getWidget(index); - if (item != null) { - item.showTab(); - } - } - - /** - * Finds the TabPanelEntry associated with the given tab widget, even if it's nested in a DropdownTab. - */ - public TabPanelEntry findEntryForTabWidget(final TabListItem tabWidget) { - for (TabPanelEntry entry : allContentTabs) { - if (entry.getTabWidget() == tabWidget) { - return entry; - } - } - return null; - } - - public void addTabBarWidget(final IsWidget customWidget) { - this.getWidgetsPanel().add(customWidget); - this.getWidgetsPanel().setCellHorizontalAlignment(customWidget, endOf(LTR)); - } - - interface TabPanelWithDropdownsBinder - extends - UiBinder { - - } - - /** - * Container for the menu items that appear when the dropdown tab is clicked. Normally, should only be created by - * {@link TabPanelWithDropdowns#addDropdownTab(String)}. - */ - public class DropDownTab extends DropDownMenu { - - private final AnchorListItem owningTab; - private final List contents = new ArrayList(); - private final Multimap tabHandlerRegistrations = HashMultimap.create(); - - public DropDownTab(AnchorListItem owningTab) { - this.owningTab = owningTab; - addStyleName("uf-dropdown-tab-menu-container"); - } - - public TabPanelEntry addItem(String label, - Widget content) { - TabPanelEntry tab = new TabPanelEntry(label, - content); - addItem(tab); - return tab; - } - - public void addItem(TabPanelEntry tab) { - tab.setInDropdown(true); - contents.add(tab); - allContentTabs.add(tab); - - TabListItem tabWidget = tab.getTabWidget(); - activatableWidgets.add(tabWidget); - tabHandlerRegistrations.put(tab, - tabWidget.addShowHandler(individualTabShowHandler)); - tabHandlerRegistrations.put(tab, - tabWidget.addShownHandler(individualTabShownHandler)); - tabHandlerRegistrations.put(tab, - tabWidget.addShownHandler(new TabShownHandler() { - - @Override - public void onShown(TabShownEvent event) { - DropDownTab.this.getParent().addStyleName(Styles.ACTIVE); - } - })); - - add(tabWidget); - tabContent.add(tab.getContentPane()); - } - - /** - * Sets the text that appears on this dropdown's main tab. - * @param text the new label for the dropdown tab. - */ - public void setText(String text) { - owningTab.setText(text); - } - - @Override - public void clear() { - for (TabPanelEntry tab : contents) { - tab.getContentPane().removeFromParent(); - tab.getTabWidget().removeFromParent(); - - for (HandlerRegistration handlerRegistration : tabHandlerRegistrations.removeAll(tab)) { - handlerRegistration.removeHandler(); - } - - activatableWidgets.remove(tab.getTabWidget()); - allContentTabs.remove(tab); - } - contents.clear(); - } - - /** - * Returns the offset width of the dropdown tab widget itself ({@link #getOffsetWidth()} returns the width of the popup window). - */ - public int getTabWidth() { - return owningTab.getOffsetWidth(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.ui.xml b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.ui.xml deleted file mode 100644 index b7da0d37280..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.ui.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/UberTabPanel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/UberTabPanel.java deleted file mode 100644 index 48c95241148..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/UberTabPanel.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.tab; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.event.dom.client.ClickEvent; -import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.event.logical.shared.BeforeSelectionEvent; -import com.google.gwt.event.logical.shared.BeforeSelectionHandler; -import com.google.gwt.event.logical.shared.SelectionEvent; -import com.google.gwt.event.logical.shared.SelectionHandler; -import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.ui.Button; -import com.google.gwt.user.client.ui.IsWidget; -import com.google.gwt.user.client.ui.RequiresResize; -import com.google.gwt.user.client.ui.ResizeComposite; -import com.google.gwt.user.client.ui.Widget; -import org.gwtbootstrap3.client.shared.event.TabShowEvent; -import org.gwtbootstrap3.client.shared.event.TabShowHandler; -import org.gwtbootstrap3.client.shared.event.TabShownEvent; -import org.gwtbootstrap3.client.shared.event.TabShownHandler; -import org.uberfire.client.mvp.PlaceManager; -import org.uberfire.client.resources.WorkbenchResources; -import org.uberfire.client.views.pfly.tab.TabPanelWithDropdowns.DropDownTab; -import org.uberfire.client.workbench.panels.MultiPartWidget; -import org.uberfire.client.workbench.panels.WorkbenchPanelPresenter; -import org.uberfire.client.workbench.part.WorkbenchPartPresenter; -import org.uberfire.client.workbench.part.WorkbenchPartPresenter.View; -import org.uberfire.client.workbench.widgets.dnd.WorkbenchDragAndDropManager; -import org.uberfire.mvp.Command; -import org.uberfire.workbench.model.PartDefinition; - -import static org.kie.soup.commons.validation.PortablePreconditions.checkNotNull; - -/** - * A wrapper around {@link TabPanelWithDropdowns} that adds the following capabilities: - *
          - *
        • Tabs that don't fit in the tab bar are automatically collapsed into a dropdown - *
        • Each tab gets a close button - *
        • Obeys the RequiresResize/ProvidesResize contract (onResize() calls are propagated - * to the visible tab content widgets) - *
        • Participates in UberFire's panel focus system - *
        - */ -@Dependent -public class UberTabPanel extends ResizeComposite implements MultiPartWidget, - ClickHandler { - - private static final int MARGIN = 20; - final List parts = new ArrayList(); - final Map tabIndex = new HashMap(); - final Map tabInvertedIndex = new HashMap(); - final Map partTabIndex = new HashMap(); - private final List focusGainedHandlers = new ArrayList(); - WorkbenchDragAndDropManager dndManager; - private ResizeTabPanel tabPanel; - private DropDownTab dropdownTab; - /** - * Flag protecting {@link #updateDisplayedTabs()} from recursively invoking itself through events that it causes. - */ - private boolean updating; - private boolean hasFocus = false; - private PlaceManager panelManager; - - @Inject - public UberTabPanel(final PlaceManager panelManager, - final @Resize ResizeTabPanel tabPanel) { - this.panelManager = checkNotNull("panelManager", - panelManager); - this.tabPanel = checkNotNull("tabPanel", - tabPanel); - } - - @PostConstruct - public void init() { - this.dropdownTab = tabPanel.addDropdownTab("More..."); - - tabPanel.addShowHandler(new TabShowHandler() { - - @Override - public void onShow(TabShowEvent e) { - if (e.getTab() != null) { - final TabPanelEntry selected = tabPanel.findEntryForTabWidget(e.getTab()); - BeforeSelectionEvent - .fire(UberTabPanel.this, - tabInvertedIndex.get(selected).getPresenter().getDefinition()); - } - } - }); - tabPanel.addShownHandler(new TabShownHandler() { - - @Override - - public void onShown(TabShownEvent e) { - onResize(); - if (e.getTab() != null) { - final TabPanelEntry selected = tabPanel.findEntryForTabWidget(e.getTab()); - SelectionEvent - .fire(UberTabPanel.this, - tabInvertedIndex.get(selected).getPresenter().getDefinition()); - } - } - }); - - tabPanel.addDomHandler(UberTabPanel.this, - ClickEvent.getType()); - - initWidget(tabPanel); - } - - @Override - public void clear() { - parts.clear(); - tabPanel.clear(); - dropdownTab.clear(); - partTabIndex.clear(); - tabIndex.clear(); - tabInvertedIndex.clear(); - } - - /** - * Updates the {@link #tabPanel} to contain a tab for each part in {@link #parts} in the order the parts - */ - private void updateDisplayedTabs() { - if (updating) { - return; - } - try { - updating = true; - tabPanel.clear(); - dropdownTab.clear(); - - if (parts.size() == 0) { - return; - } - - int availableSpace = tabPanel.getOffsetWidth(); - TabPanelEntry selectedTab = null; - - // the number of regular (not dropdown) tabs in the tab bar - int regularTabCount = 0; - - // add and measure all tabs - for (int i = 0; i < parts.size(); i++) { - WorkbenchPartPresenter part = parts.get(i); - TabPanelEntry tabPanelEntry = partTabIndex.get(part.getDefinition()); - if (tabPanelEntry.isActive()) { - selectedTab = tabPanelEntry; - } - tabPanelEntry.setActive(false); - tabPanel.addItem(tabPanelEntry); - regularTabCount++; - availableSpace -= tabPanelEntry.getTabWidget().getOffsetWidth(); - } - - // if we didn't find any selected tab, let's select the first one - if (selectedTab == null) { - TabPanelEntry firstTab = getTab(0); - selectedTab = firstTab; - } - - // now work from right to left to find out how many tabs we have to collapse into the dropdown - if (availableSpace < 0) { - LinkedList newDropdownContents = new LinkedList(); - dropdownTab.setText("More..."); - tabPanel.addDropdownTab(dropdownTab); - while (availableSpace - dropdownTab.getTabWidth() < 0 && regularTabCount > 1) { - // get the last tab that isn't the dropdown tab - TabPanelEntry tab = getTab(--regularTabCount); - availableSpace += tab.getTabWidget().getOffsetWidth(); - tabPanel.remove(tab); - newDropdownContents.addFirst(tab); - if (tab == selectedTab) { - dropdownTab.setText(selectedTab.getTitle()); - } - } - - for (TabPanelEntry l : newDropdownContents) { - dropdownTab.addItem(l); - } - } - - selectedTab.showTab(); - } finally { - updating = false; - } - } - - private TabPanelEntry getTab(int i) { - return checkNotNull("part entry in map", - partTabIndex.get(parts.get(i).getDefinition())); - } - - @Override - public boolean selectPart(final PartDefinition id) { - final TabPanelEntry tab = partTabIndex.get(id); - if (tab != null) { - tab.showTab(); - } - return false; - } - - @Override - public boolean remove(final PartDefinition id) { - final TabPanelEntry tab = partTabIndex.get(id); - if (tab == null) { - return false; - } - final boolean wasActive = tab.isActive(); - - View partView = tabInvertedIndex.remove(tab); - int removedTabIndex = parts.indexOf(partView.getPresenter()); - parts.remove(removedTabIndex); - tabIndex.remove(partView); - partTabIndex.remove(id); - - updateDisplayedTabs(); - - if (removedTabIndex >= 0 && wasActive && parts.size() > 0) { - selectPart(parts.get(removedTabIndex <= 0 ? 0 : removedTabIndex - 1).getDefinition()); - } - - return true; - } - - @Override - public void changeTitle(final PartDefinition id, - final String title, - final IsWidget titleDecoration) { - final TabPanelEntry tab = partTabIndex.get(id); - if (tab != null) { - tab.setTitle(title); - } - } - - @Override - public HandlerRegistration addBeforeSelectionHandler(final BeforeSelectionHandler handler) { - return addHandler(handler, - BeforeSelectionEvent.getType()); - } - - @Override - public HandlerRegistration addSelectionHandler(final SelectionHandler handler) { - return addHandler(handler, - SelectionEvent.getType()); - } - - @Override - public void setPresenter(final WorkbenchPanelPresenter presenter) { - // not needed - } - - @Override - public void addPart(final WorkbenchPartPresenter.View view) { - if (!tabIndex.containsKey(view)) { - final TabPanelEntry tab = tabPanel.addItem(view.getPresenter().getTitle(), - view.asWidget()); - - resizeIfNeeded(view.asWidget()); - - tabIndex.put(view, - tab); - tabInvertedIndex.put(tab, - view); - partTabIndex.put(view.getPresenter().getDefinition(), - tab); - - dndManager.makeDraggable(view, - tab.getTabWidget()); - addCloseToTab(tab); - - parts.add(view.getPresenter()); - tabIndex.put(view, - tab); - updateDisplayedTabs(); - } - } - - /** - * The GwtBootstrap3 TabPanel doesn't support the RequiresResize/ProvidesResize contract, and UberTabPanel fills in - * the gap. This helper method allows us to call onResize() on the widgets that need it. - * - * @param widget the widget that has just been resized - */ - private void resizeIfNeeded(final Widget widget) { - if (isAttached() && widget instanceof RequiresResize) { - ((RequiresResize) widget).onResize(); - } - } - - @Override - public void onResize() { - updateDisplayedTabs(); - tabPanel.onResize(); - } - - private void addCloseToTab(final TabPanelEntry tab) { - final Button close = new Button("×"); - close.setStyleName("close"); - close.addStyleName(WorkbenchResources.INSTANCE.CSS().tabCloseButton()); - close.addClickHandler(new ClickHandler() { - @Override - public void onClick(final ClickEvent event) { - final WorkbenchPartPresenter.View partToDeselect = tabInvertedIndex.get(tab); - panelManager.closePlace(partToDeselect.getPresenter().getDefinition().getPlace()); - } - }); - - tab.getTabWidget().addToAnchor(close); - } - - @Override - public void setDndManager(final WorkbenchDragAndDropManager dndManager) { - this.dndManager = dndManager; - } - - @Override - public void setFocus(final boolean hasFocus) { - this.hasFocus = hasFocus; - tabPanel.setFocus(hasFocus); - } - - @Override - public void onClick(final ClickEvent event) { - if (!hasFocus) { - fireFocusGained(); - View view = getSelectedPart(); - if (view != null) { - SelectionEvent.fire(UberTabPanel.this, - view.getPresenter().getDefinition()); - } - } - } - - private View getSelectedPart() { - return tabInvertedIndex.get(tabPanel.getActiveTab()); - } - - private void fireFocusGained() { - for (int i = focusGainedHandlers.size() - 1; i >= 0; i--) { - focusGainedHandlers.get(i).execute(); - } - } - - @Override - public void addOnFocusHandler(final Command doWhenFocused) { - focusGainedHandlers.add(checkNotNull("doWhenFocused", - doWhenFocused)); - } - - @Override - public int getPartsSize() { - return partTabIndex.size(); - } - - @Override - public Collection getParts() { - return Collections.unmodifiableSet(partTabIndex.keySet()); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Button.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Button.java deleted file mode 100644 index f72e4a06336..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Button.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.stream.Stream; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import elemental2.dom.Document; -import elemental2.dom.HTMLButtonElement; -import elemental2.dom.HTMLElement; -import elemental2.dom.Text; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.uberfire.mvp.Command; - -@Dependent -public class Button implements IsElement { - - @Inject - private HTMLButtonElement button; - - @Inject - private Document document; - - private Text textNode; - - public void setText(final String text) { - if (textNode == null) { - textNode = document.createTextNode(text); - getElement().appendChild(textNode); - } else { - textNode.textContent = text; - } - } - - public void setClickHandler(final Command clickHandler) { - button.addEventListener("click", - (e) -> clickHandler.execute()); - } - - public void setType(final ButtonType type) { - button.type = type.name().toLowerCase(); - } - - public void setButtonStyleType(final ButtonStyleType type) { - removeClass("btn"); - Stream.of(ButtonStyleType.values()).forEach(buttonStyleType -> removeClass(buttonStyleType.getCssClass())); - addClass(button, - "btn", - type.getCssClass()); - } - - public void setEnabled(final boolean enabled) { - button.disabled = !enabled; - if (enabled) { - button.classList.remove("disabled"); - } else { - button.classList.add("disabled"); - } - } - - public void hide() { - button.classList.add("hidden"); - } - - public void show() { - button.classList.remove("hidden"); - } - - public void addIcon(final String... classes) { - final HTMLElement span = (HTMLElement) document.createElement("span"); - addClass(span, - classes); - button.appendChild(span); - } - - @Override - public HTMLElement getElement() { - return button; - } - - private void addClass(final HTMLElement element, - final String... classes) { - for (String cssClass : classes) { - if (element.classList.contains(cssClass) == false) { - element.classList.add(cssClass); - } - } - } - - private void removeClass(final String cssClass) { - if (getElement().classList.contains(cssClass)) { - getElement().classList.remove(cssClass); - } - } - - public enum ButtonType { - BUTTON, - SUBMIT, - RESET - } - - public enum ButtonStyleType { - - DEFAULT("btn-default"), - PRIMARY("btn-primary"), - SUCCESS("btn-success"), - INFO("btn-info"), - WARNING("btn-warning"), - DANGER("btn-danger"), - LINK("btn-link"); - - private final String cssClass; - - ButtonStyleType(final String cssClass) { - this.cssClass = cssClass; - } - - public String getCssClass() { - return cssClass; - } - - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.html deleted file mode 100644 index 0c20cdae120..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.html +++ /dev/null @@ -1,24 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.java deleted file mode 100644 index a97a2d57886..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ConfirmPopup.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.MouseEvent; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.ui.client.local.spi.TranslationService; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.ForEvent; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.views.pfly.resources.i18n.Constants; -import org.uberfire.mvp.Command; - -@Dependent -@Templated -public class ConfirmPopup { - - @Inject - @DataField("confirm-title") - Span modalTitle; - - @Inject - @DataField("confirm-inline-notification") - InlineNotification confirmInlineNotification; - - @Inject - @DataField("confirm-message") - Span modalConfirmationMessageLabel; - - @Inject - @DataField("confirm-cancel") - Button cancelButton; - - @Inject - @DataField("confirm-ok") - Button okButton; - - @Inject - @DataField("modal") - private Modal modal; - - @Inject - private TranslationService translationService; - - private Command okCommand; - - @PostConstruct - public void init() { - cancelButton.setText(translationService.getTranslation(Constants.ConfirmPopup_Cancel)); - } - - public void show(final String title, - final String okButtonText, - final String confirmMessage, - final Command okCommand) { - show(title, - null, - null, - okButtonText, - Button.ButtonStyleType.DANGER, - confirmMessage, - okCommand); - } - - public void show(final String title, - final String inlineNotificationMessage, - final InlineNotification.InlineNotificationType inlineNotificationType, - final String okButtonText, - final Button.ButtonStyleType okButtonType, - final String confirmMessage, - final Command okCommand) { - this.okCommand = okCommand; - modalTitle.setTextContent(title); - if (inlineNotificationMessage != null && inlineNotificationType != null) { - confirmInlineNotification.setMessage(inlineNotificationMessage); - confirmInlineNotification.setType(inlineNotificationType); - confirmInlineNotification.getElement().getStyle().removeProperty("display"); - } else { - confirmInlineNotification.getElement().getStyle().setProperty("display", - "none"); - } - okButton.setText(okButtonText); - if (okButtonType != null) { - okButton.setButtonStyleType(okButtonType); - } - modalConfirmationMessageLabel.setTextContent(confirmMessage); - modal.show(); - } - - public void hide() { - modal.hide(); - } - - public HTMLElement getElement() { - return modal.getElement(); - } - - @EventHandler("confirm-ok") - public void onOkClick(final @ForEvent("click") MouseEvent event) { - if (okCommand != null) { - okCommand.execute(); - } - hide(); - } - - @EventHandler("confirm-cancel") - public void onCancelClick(final @ForEvent("click") MouseEvent event) { - hide(); - } - - @EventHandler("confirm-close") - public void onCloseClick(final @ForEvent("click") MouseEvent event) { - hide(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/D3.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/D3.java deleted file mode 100644 index 9fd4c6ed265..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/D3.java +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import com.google.gwt.dom.client.Element; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public interface D3 { - - Selection selection(); - - Selection select(String path); - - Selection select(Object object); - - Selection selectAll(String path); - - Zoom zoom(); - - CallbackFunction on(String event, CallbackFunction callbackFn); - - D3 on(String event, CallbackFunctionWithData callbackFn); - - D3 call(CallbackFunction function, Object... args); - - D3 attr(String name, Object value); - - D3 attr(String name, CallbackFunctionWithData callbackFn); - - Object attr(String name); - - Object style(String name); - - D3 style(String name, Object value); - - D3 style(String name, CallbackFunctionWithData callbackFn); - - D3 append(String content); - - D3 html(String content); - - D3 text(String content); - - D3 text(CallbackFunctionWithData callbackFn); - - D3 enter(); - - D3 join(String obj); - - D3 data(Object[] data); - - D3 data(Object data); - - boolean geoContains(Object object, Double[] point); - - Node node(); - - @JsProperty - Transform getZoomIdentity(); - - @JsProperty - T getEvent(); - - Transition transition(); - - Scale scaleQuantize(); - - Scale scaleLinear(); - - Scale scaleSqrt(); - - @JsProperty - String[][] getSchemeBlues(); - - @JsProperty - String[][] getSchemeReds(); - - @JsProperty - String[][] getSchemeGreens(); - - @JsFunction - @FunctionalInterface - interface CallbackFunction { - - void execute(); - } - - @JsFunction - @FunctionalInterface - interface CallbackFunctionWithData { - - Object execute(Object data, int index, Element[] elements); - } - - @JsType(isNative = true) - interface Selection extends D3 { - - boolean empty(); - - int size(); - - Selection filter(String path); - - } - - @JsType(isNative = true) - interface Zoom extends D3 { - - void scaleBy(D3 element, double scale); - - void scaleTo(D3 element, double scale); - - void scaleExtent(double[] scaleExtent); - - void translateExtent(double[][] translateExtent); - - void transform(D3 selection, Transform transform); - } - - @JsType(isNative = true) - interface Transform extends D3 { - - @JsProperty - double getX(); - - @JsProperty - double getY(); - - @JsProperty - double getK(); - - @JsProperty - void setX(double x); - - @JsProperty - void setY(double y); - } - - @JsType(isNative = true) - interface Transition extends D3 { - - D3 duration(double milis); - } - - @JsType(isNative = true) - interface Event { - - @JsProperty - Object getCurrentTarget(); - - @JsProperty - int getPageX(); - - @JsProperty - int getPageY(); - } - - @JsType(isNative = true) - interface ZoomEvent { - - @JsProperty - Transform getTransform(); - } - - @JsType(isNative = true) - interface Node { - - DOMRect getBoundingClientRect(); - - } - - @JsType(isNative = true) - interface DOMRect { - - @JsProperty - double getX(); - - @JsProperty - double getY(); - - @JsProperty - double getWidth(); - - @JsProperty - double getHeight(); - } - - @JsType(isNative = true) - interface Scale { - - Scale domain(Object[] domain); - - Object[] domain(); - - Scale range(Object[] colors); - - Scale rangeRound(Object[] colors); - - Object[] range(); - - String call(Scale self, Object... args); - - Object[] invertExtent(Object value); - } - - class Builder { - - @JsProperty(name = "d3", namespace = JsPackage.GLOBAL) - public static native D3 get(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePicker.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePicker.java deleted file mode 100644 index 61b8374f457..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePicker.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.Event; -import org.jboss.errai.common.client.dom.TextInput; -import org.jboss.errai.ui.client.local.spi.TranslationService; - -import static org.uberfire.client.views.pfly.resources.i18n.Constants.ApplyLabel; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.April; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.August; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.CancelLabel; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.CustomRangeLabel; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.December; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.February; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.FridayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.FromLabel; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.January; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.July; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.June; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.March; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.May; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.MondayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.November; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.October; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.SaturdayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.September; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.SundayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.ThursdayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.ToLabel; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.TuesdayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.WednesdayShort; -import static org.uberfire.client.views.pfly.resources.i18n.Constants.WeekLabel; - -/** - * Wrapper component for Date Range Picker - */ -@Dependent -public class DateRangePicker implements IsElement { - - @Inject - private TextInput input; - - @Inject - private JQueryProducer.JQuery jQuery; - - @Inject - private TranslationService translationService; - - public void setup(final DateRangePickerOptions options, - final DateRangePickerCallback callback) { - setupI18n(options); - jQuery.wrap(getElement()).daterangepicker(options, - callback); - } - - protected void setupI18n(final DateRangePickerOptions options) { - options.setApplyLabel(translationService.format(ApplyLabel)); - options.setCancelLabel(translationService.format(CancelLabel)); - options.setCustomRangeLabel(translationService.format(CustomRangeLabel)); - options.setFromLabel(translationService.format(FromLabel)); - options.setToLabel(translationService.format(ToLabel)); - options.setWeekLabel(translationService.format(WeekLabel)); - options.setDaysOfWeek(new String[]{ - translationService.format(SundayShort), - translationService.format(MondayShort), - translationService.format(TuesdayShort), - translationService.format(WednesdayShort), - translationService.format(ThursdayShort), - translationService.format(FridayShort), - translationService.format(SaturdayShort) - }); - - options.setMonthNames(new String[]{ - translationService.format(January), - translationService.format(February), - translationService.format(March), - translationService.format(April), - translationService.format(May), - translationService.format(June), - translationService.format(July), - translationService.format(August), - translationService.format(September), - translationService.format(October), - translationService.format(November), - translationService.format(December), - }); - } - - public void addApplyListener(final DateTimePickerEventCallback callback) { - jQuery.wrap(getElement()).on("apply.daterangepicker", - callback); - } - - @Override - public TextInput getElement() { - return input; - } - - @JsType(isNative = true) - public interface JQueryDateRangePickerElement extends JQueryProducer.JQueryElement { - - DateRangePickerElement daterangepicker(DateRangePickerOptions options, - DateRangePickerCallback callback); - - void on(String event, - DateTimePickerEventCallback callback); - } - - @JsFunction - @FunctionalInterface - public interface DateRangePickerCallback { - - void update(Moment start, - Moment end, - String label); - } - - @JsFunction - @FunctionalInterface - public interface DateTimePickerEventCallback { - - void onEvent(Event event, - DateRangePickerElement picker); - } - - @JsType(isNative = true) - public interface DateRangePickerElement { - - @JsProperty - Moment getStartDate(); - - void setStartDate(Moment startDate); - - @JsProperty - Moment getEndDate(); - - void setEndDate(Moment endDate); - - @JsProperty - String getChosenLabel(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePickerOptions.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePickerOptions.java deleted file mode 100644 index 0e15f7fa732..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DateRangePickerOptions.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsOverlay; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) -public class DateRangePickerOptions { - - private DateRangePickerOptions() { - } - - @JsOverlay - public static final DateRangePickerOptions create() { - final DateRangePickerOptions options = new DateRangePickerOptions(); - - options.setApplyClass("btn-primary"); - options.setLocale(new Object()); - options.setFormat("lll"); - - options.setRanges(new DateRangePickerOptions.Range()); - - return options; - } - - @JsProperty - public native void setApplyClass(String applyClass); - - @JsProperty - public native void setStartDate(Moment startDate); - - @JsProperty - public native void setEndDate(Moment endDate); - - @JsProperty - public native void setMinDate(Moment minDate); - - @JsProperty - public native void setMaxDate(Moment maxDate); - - @JsProperty - public native void setAutoApply(Boolean autoApply); - - @JsProperty - public native void setAutoUpdateInput(Boolean autoUpdateInput); - - @JsProperty - public native void setShowCustomRangeLabel(Boolean showCustomRangeLabel); - - @JsProperty - public native void setTimePicker(Boolean timePicker); - - @JsProperty - public native void setTimePickerIncrement(int timePickerIncrement); - - @JsProperty - public native void setTimePicker24Hour(Boolean timePicker24Hour); - - @JsProperty - public native void setSingleDatePicker(Boolean singleDatePicker); - - @JsProperty - public native void setDrops(String drops); - - @JsProperty - public native void setParentEl(String parentEl); - - @JsProperty - protected native void setLocale(Object locale); - - @JsProperty(name = "locale.format") - public native void setFormat(String format); - - @JsProperty(name = "locale.customRangeLabel") - public native void setCustomRangeLabel(String customRangeLabel); - - @JsProperty(name = "locale.applyLabel") - public native void setApplyLabel(String applyLabel); - - @JsProperty(name = "locale.cancelLabel") - public native void setCancelLabel(String cancelLabel); - - @JsProperty(name = "locale.fromLabel") - public native void setFromLabel(String fromLabel); - - @JsProperty(name = "locale.toLabel") - public native void setToLabel(String toLabel); - - @JsProperty(name = "locale.weekLabel") - public native void setWeekLabel(String weekLabel); - - @JsProperty(name = "locale.daysOfWeek") - public native void setDaysOfWeek(String[] daysOfWeek); - - @JsProperty(name = "locale.monthNames") - public native void setMonthNames(String[] monthNames); - - @JsProperty - protected native Range getRanges(); - - @JsProperty - protected native void setRanges(Range range); - - @JsOverlay - public final void addRange(final String key, - final Moment startRange, - final Moment endRange) { - getRanges().addRange(key, - startRange, - endRange); - } - - @JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) - private static class Range { - - public static native void defineProperty(Range range, - String property, - PropertyDescriptor descriptor); - - @JsOverlay - public final void addRange(final String key, - final Moment startRange, - final Moment endRange) { - final PropertyDescriptor descriptor = new PropertyDescriptor(); - final Moment[] value = new Moment[]{startRange, endRange}; - descriptor.setValue(value); - descriptor.setEnumerable(true); - defineProperty(this, - key, - descriptor); - } - } - - @JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) - private static class PropertyDescriptor { - - @JsProperty - public native void setValue(Object value); - - @JsProperty - public native void setEnumerable(boolean enumerable); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.html deleted file mode 100644 index 69be6b40e1b..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.java deleted file mode 100644 index 16a2ba493f3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenu.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; -import javax.inject.Named; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLLIElement; -import elemental2.dom.HTMLUListElement; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Dependent -@Templated -public class DropdownMenu implements IsElement { - - @Inject - @DataField("dropdown") - HTMLDivElement dropdown; - - @Inject - @DataField("text") - @Named("span") - HTMLElement text; - - @Inject - @DataField("dropdown-menu") - HTMLUListElement dropdownMenu; - - public void setText(final String text) { - this.text.textContent = text; - } - - public void addDropdownItem(final HTMLLIElement item) { - dropdownMenu.appendChild(item); - } - - public void setItemsAlignment(final ItemsAlignment alighment) { - if (alighment == ItemsAlignment.RIGHT) { - dropdownMenu.classList.add("dropdown-menu-right"); - } - } - - @Override - public HTMLElement getElement() { - return dropdown; - } - - public enum ItemsAlignment { - LEFT, - RIGHT - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.html deleted file mode 100644 index 26437f570c4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.html +++ /dev/null @@ -1,3 +0,0 @@ -
      • - -
      • diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.java deleted file mode 100644 index 0a692267dc0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/DropdownMenuItem.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import elemental2.dom.Event; -import elemental2.dom.HTMLAnchorElement; -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLLIElement; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.ForEvent; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.mvp.Command; - -@Dependent -@Templated -public class DropdownMenuItem implements IsElement { - - @Inject - @DataField("dropdown-item") - HTMLLIElement item; - - @Inject - @DataField("anchor") - HTMLAnchorElement anchor; - - Command clickHandler; - - @Override - public HTMLElement getElement() { - return item; - } - - public void setText(final String text) { - anchor.textContent = text; - } - - public void setClickHandler(final Command clickHandler) { - this.clickHandler = clickHandler; - } - - @EventHandler("anchor") - public void onClick(@ForEvent("click") Event event) { - if (clickHandler != null) { - clickHandler.execute(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Duration.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Duration.java deleted file mode 100644 index 5401345a95f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Duration.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsType; - -/** - * Wrapper class for Moment.js library - */ -@JsType(isNative = true) -public interface Duration { - - String humanize(); - - String humanize(boolean suffix); - - class Builder { - - @JsMethod(name = "moment.duration", namespace = JsPackage.GLOBAL) - public static native Duration duration(); - - @JsMethod(name = "moment.duration", namespace = JsPackage.GLOBAL) - public static native Duration duration(int milliseconds); - - @JsMethod(name = "moment.duration", namespace = JsPackage.GLOBAL) - public static native Duration duration(int time, - String measurement); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Elemental2Producer.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Elemental2Producer.java deleted file mode 100644 index 556fe37a340..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Elemental2Producer.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.ApplicationScoped; -import javax.enterprise.inject.Produces; - -import elemental2.dom.DomGlobal; -import elemental2.dom.HTMLDocument; - -@ApplicationScoped -public class Elemental2Producer { - - @Produces - public HTMLDocument produceDocument() { - return DomGlobal.document; - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopup.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopup.java deleted file mode 100644 index cc5022cffad..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopup.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.client.mvp.UberElement; - -@Dependent -public class ErrorPopup { - - public interface View - extends UberElement { - - HTMLElement getInlineNotification(); - - HTMLElement getStandardNotification(); - - void setInlineNotificationValue(final String message); - - void setStandardNotificationValue(final String message); - - void setNotification(final HTMLElement notification); - - void showDetailPanel(final boolean show); - - void setDetailValue(final String message); - - boolean isDetailCollapsed(); - - void setCollapseDetailIcon(final boolean collapsed); - - void setCollapseDetailPanel(final boolean collapsed); - - void setDetailLabel(final String label); - - String getShowDetailLabel(); - - String getCloseDetailLabel(); - - void show(); - - void hide(); - } - - public enum DisplayMode { - STANDARD, - PATTERN_FLY - } - - private final View view; - - @Inject - public ErrorPopup(final View view) { - this.view = view; - } - - @PostConstruct - public void init() { - view.init(this); - } - - public void showError(final String message) { - showError(message, - DisplayMode.PATTERN_FLY); - } - - public void showError(final String message, - final DisplayMode displayMode) { - setMessage(message, - displayMode); - view.setDetailValue(""); - showDetailPanel(false); - view.show(); - } - - public void showError(final String message, - final String detail) { - showError(message, - detail, - DisplayMode.PATTERN_FLY); - } - - public void showError(final String message, - final String detail, - final DisplayMode displayMode) { - setMessage(message, - displayMode); - view.setDetailValue(detail); - showDetailPanel(true); - view.show(); - } - - private void setMessage(final String message, - final DisplayMode displayMode) { - if (displayMode == DisplayMode.STANDARD) { - view.setNotification(view.getStandardNotification()); - view.setStandardNotificationValue(message); - } else { - view.setNotification(view.getInlineNotification()); - view.setInlineNotificationValue(message); - } - } - - private void showDetailPanel(boolean show) { - view.setCollapseDetailIcon(true); - view.setCollapseDetailPanel(true); - view.setDetailLabel(view.getShowDetailLabel()); - view.showDetailPanel(show); - } - - protected void onOk() { - view.hide(); - } - - protected void onClose() { - view.hide(); - } - - protected void onDetail() { - boolean detailCollapsed = view.isDetailCollapsed(); - view.setCollapseDetailIcon(!detailCollapsed); - if (detailCollapsed) { - view.setDetailLabel(view.getCloseDetailLabel()); - } else { - view.setDetailLabel(view.getShowDetailLabel()); - } - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.html deleted file mode 100644 index 2d9824ba712..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.html +++ /dev/null @@ -1,42 +0,0 @@ - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.java deleted file mode 100644 index ef41e9b1340..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/ErrorPopupView.java +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.annotation.PostConstruct; -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.dom.Anchor; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.MouseEvent; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.common.client.dom.TextArea; -import org.jboss.errai.ui.client.local.spi.TranslationService; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.ForEvent; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.client.views.pfly.resources.i18n.Constants; - -import static org.jboss.errai.common.client.dom.DOMUtil.addCSSClass; -import static org.jboss.errai.common.client.dom.DOMUtil.hasCSSClass; -import static org.jboss.errai.common.client.dom.DOMUtil.removeAllChildren; -import static org.jboss.errai.common.client.dom.DOMUtil.removeCSSClass; - -@Dependent -@Templated -public class ErrorPopupView - implements org.jboss.errai.ui.client.local.api.IsElement, - ErrorPopup.View { - - private static final String DETAIL_COLLAPSED_ICON = "fa-angle-right"; - - private static final String DETAIL_EXPANDED_ICON = "fa-angle-down"; - - private static final String IN = "in"; - - @Inject - @DataField("message-container") - private Div messageContainer; - - @Inject - @DataField("inline-notification") - private InlineNotification inlineNotification; - - @Inject - @DataField("standard-notification") - private Span standardNotification; - - @Inject - @DataField("detail-container") - private Div detailContainer; - - @Inject - @DataField("detail-area") - private TextArea detailArea; - - @Inject - @DataField("detail-area-container") - private Div detailAreaContainer; - - @Inject - @DataField("detail-anchor-icon") - private Span detailAnchorIcon; - - @Inject - @DataField("detail-anchor") - private Anchor detailAnchor; - - @Inject - @DataField("modal") - private Modal modal; - - @Inject - private TranslationService translationService; - - private ErrorPopup presenter; - - @PostConstruct - public void init() { - inlineNotification.setType(InlineNotification.InlineNotificationType.DANGER); - } - - @Override - public void init(final ErrorPopup presenter) { - this.presenter = presenter; - } - - @Override - public HTMLElement getInlineNotification() { - return inlineNotification.getElement(); - } - - @Override - public HTMLElement getStandardNotification() { - return standardNotification; - } - - @Override - public void setInlineNotificationValue(final String message) { - inlineNotification.setMessage(message); - } - - @Override - public void setStandardNotificationValue(final String message) { - standardNotification.setTextContent(message); - } - - @Override - public void setNotification(HTMLElement notification) { - removeAllChildren(messageContainer); - messageContainer.appendChild(notification); - } - - @Override - public void showDetailPanel(boolean show) { - if (!show) { - detailContainer.getStyle().setProperty("display", - "none"); - } else { - detailContainer.getStyle().removeProperty("display"); - } - } - - @Override - public void setDetailValue(final String detail) { - detailArea.setValue(detail); - } - - @Override - public boolean isDetailCollapsed() { - return hasCSSClass(detailAnchorIcon, - DETAIL_COLLAPSED_ICON); - } - - @Override - public void setCollapseDetailIcon(boolean collapsed) { - removeCSSClass(detailAnchorIcon, - DETAIL_COLLAPSED_ICON); - removeCSSClass(detailAnchorIcon, - DETAIL_EXPANDED_ICON); - if (collapsed) { - addCSSClass(detailAnchorIcon, - DETAIL_COLLAPSED_ICON); - } else { - addCSSClass(detailAnchorIcon, - DETAIL_EXPANDED_ICON); - } - } - - @Override - public void setCollapseDetailPanel(boolean collapsed) { - removeCSSClass(detailAreaContainer, - IN); - if (!collapsed) { - addCSSClass(detailAreaContainer, - IN); - } - } - - @Override - public void setDetailLabel(final String label) { - detailAnchor.setTextContent(label); - } - - @Override - public String getShowDetailLabel() { - return translationService.getTranslation(Constants.ErrorPopupView_ShowDetailLabel); - } - - @Override - public String getCloseDetailLabel() { - return translationService.getTranslation(Constants.ErrorPopupView_CloseDetailLabel); - } - - @Override - public void show() { - modal.show(); - } - - @Override - public void hide() { - modal.hide(); - } - - @EventHandler("ok-button") - private void onOkClick(final @ForEvent("click") MouseEvent event) { - presenter.onOk(); - } - - @EventHandler("close-button") - private void onCloseClick(final @ForEvent("click") MouseEvent event) { - presenter.onClose(); - } - - @EventHandler("detail-anchor") - private void onDetailClick(final @ForEvent("click") MouseEvent event) { - presenter.onDetail(); - } -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormGroup.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormGroup.java deleted file mode 100644 index 58d807d6860..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormGroup.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.Arrays; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.HTMLElement; - -import static org.jboss.errai.common.client.dom.DOMUtil.addCSSClass; -import static org.jboss.errai.common.client.dom.DOMUtil.removeCSSClass; - -@Dependent -public class FormGroup implements IsElement { - - @Inject - private Div div; - - public void clearValidationState() { - Arrays.stream(ValidationState.values()).forEach(v -> removeCSSClass(div, - v.getCssName())); - } - - public void setValidationState(final ValidationState state) { - clearValidationState(); - addCSSClass(div, - state.getCssName()); - } - - @Override - public HTMLElement getElement() { - return div; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabel.java deleted file mode 100644 index 5025724ea80..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabel.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.CSSStyleDeclaration; -import org.jboss.errai.common.client.dom.Document; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.Label; - -import static org.jboss.errai.common.client.dom.DOMUtil.addCSSClass; - -@Dependent -public class FormLabel implements IsElement { - - @Inject - private Document document; - - @Inject - private Label label; - - @Override - public HTMLElement getElement() { - return label; - } - - public void addRequiredIndicator() { - final HTMLElement e = document.createElement("i"); - addCSSClass(e, - "fa"); - addCSSClass(e, - "fa-star"); - final CSSStyleDeclaration css = e.getStyle(); - css.setProperty("font-size", - "6px"); - css.setProperty("padding-right", - "5px"); - css.setProperty("padding-left", - "2px"); - css.setProperty("color", - "#b94a48"); - final HTMLElement sup = document.createElement("sup"); - sup.appendChild(e); - label.appendChild(sup); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabelHelp.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabelHelp.java deleted file mode 100644 index 94ac7f4edb9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/FormLabelHelp.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import com.google.gwt.core.client.GWT; -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.HasText; -import org.gwtbootstrap3.client.ui.FormLabel; - -public class FormLabelHelp extends Composite implements HasText { - - private final FormLabel formLabel; - private final FlowPanel panel; - - private HelpIcon helpIcon; - - public FormLabelHelp() { - this(new FormLabel(), - new FlowPanel()); - } - - // Defined for testing purposes - FormLabelHelp(FormLabel formLabel, - FlowPanel panel) { - this.formLabel = formLabel; - this.panel = panel; - - init(); - } - - private void init() { - initWidget(panel); - addStyleName("uf-form-label"); - panel.add(formLabel); - } - - public void setHelpTitle(final String title) { - if (title != null) { - getHelpIcon().setHelpTitle(title); - } - } - - public void setHelpContent(final String content) { - if (content != null) { - getHelpIcon().setHelpContent(content); - } - } - - private HelpIcon getHelpIcon() { - if (helpIcon == null) { - helpIcon = GWT.create(HelpIcon.class); - panel.add(helpIcon); - } - return helpIcon; - } - - @Override - public String getText() { - return formLabel.getText(); - } - - @Override - public void setText(final String text) { - formLabel.setText(text); - } - - public void setFor(final String forValue) { - formLabel.setFor(forValue); - } - - public void setShowRequiredIndicator(final boolean required) { - formLabel.setShowRequiredIndicator(required); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/HelpIcon.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/HelpIcon.java deleted file mode 100644 index 99bfe1f815c..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/HelpIcon.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.SimplePanel; -import org.gwtbootstrap3.client.ui.Icon; -import org.gwtbootstrap3.client.ui.Popover; -import org.gwtbootstrap3.client.ui.constants.IconType; -import org.gwtbootstrap3.client.ui.constants.Placement; - -public class HelpIcon extends Composite { - - private Icon icon; - private SimplePanel panel; - private Popover popover; - - public HelpIcon() { - this(new Icon(), - new SimplePanel(), - new Popover()); - } - - // Defined for testing purposes - HelpIcon(Icon icon, - SimplePanel panel, - Popover popover) { - this.icon = icon; - this.popover = popover; - this.panel = panel; - - init(); - } - - private void init() { - initWidget(panel); - addStyleName("uf-help-icon"); - - icon.setType(IconType.INFO_CIRCLE); - - popover.setWidget(icon); - popover.setContainer("body"); - popover.setIsHtml(true); - popover.setPlacement(Placement.AUTO); - - panel.setWidget(popover); - } - - public void setHelpTitle(final String title) { - popover.setTitle(title); - popover.reconfigure(); - } - - public void setHelpContent(final String content) { - popover.setContent(content); - popover.reconfigure(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.css b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.css deleted file mode 100644 index 9b3b079318d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.css +++ /dev/null @@ -1,3 +0,0 @@ -.list-unstyled { - margin-bottom: 0px; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.html deleted file mode 100644 index 3aab75e11ce..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.html +++ /dev/null @@ -1,7 +0,0 @@ -
        - - - -
        diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.java deleted file mode 100644 index c3fd08537ed..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InlineNotification.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.List; -import java.util.stream.Stream; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.Button; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.Document; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.Span; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -import static org.jboss.errai.common.client.dom.DOMUtil.addCSSClass; -import static org.jboss.errai.common.client.dom.DOMUtil.removeAllElementChildren; -import static org.jboss.errai.common.client.dom.DOMUtil.removeCSSClass; - -@Templated(stylesheet = "InlineNotification.css") -@Dependent -public class InlineNotification implements IsElement { - - @Inject - @DataField("alert") - private Div alert; - - @Inject - @DataField("message") - private Span message; - - @Inject - @DataField("icon") - private Span icon; - - @Inject - @DataField("dismiss") - private Button dismiss; - - @Inject - private Document document; - - @Override - public HTMLElement getElement() { - return alert; - } - - public void setMessage(final String message) { - this.message.setTextContent(message); - } - - public void setMessage(final List messages) { - removeAllElementChildren(this.message); - final HTMLElement ul = document.createElement("ul"); - addCSSClass(ul, - "list-unstyled"); - for (String message : messages) { - final HTMLElement li = document.createElement("li"); - li.setTextContent(message); - ul.appendChild(li); - } - this.message.appendChild(ul); - } - - public void setDismissable() { - addCSSClass(alert, - "alert-dismissable"); - removeCSSClass(dismiss, - "hidden"); - } - - public void setType(final InlineNotificationType type) { - Stream.of(InlineNotificationType.values()).forEach(availableType -> { - removeCSSClass(alert, availableType.getCssClass()); - removeCSSClass(icon, availableType.getIcon()); - }); - addCSSClass(alert, - type.getCssClass()); - addCSSClass(icon, - type.getIcon()); - } - - public enum InlineNotificationType { - - SUCCESS("alert-success", - "pficon-ok"), - INFO("alert-info", - "pficon-info"), - WARNING("alert-warning", - "pficon-warning-triangle-o"), - DANGER("alert-danger", - "pficon-error-circle-o"); - - private String cssClass; - - private String icon; - - InlineNotificationType(final String cssClass, - final String icon) { - this.cssClass = cssClass; - this.icon = icon; - } - - public String getCssClass() { - return cssClass; - } - - public String getIcon() { - return icon; - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.html deleted file mode 100644 index eb17a5650ff..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.html +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.java deleted file mode 100644 index c58189ceca4..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocomplete.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.List; -import java.util.function.Supplier; - -import javax.inject.Inject; - -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLInputElement; -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -public class InputAutocomplete implements IsElement { - - @Inject - @DataField("input") - HTMLInputElement input; - - @Inject - private JQueryElementalProducer.JQuery jQuery; - - public void setup(final Supplier> optionsSupplier) { - final InputAutocompleteOptions inputAutocompleteOptions = new InputAutocompleteOptions(); - List options = optionsSupplier.get(); - if (options != null) { - String[] optionsArray = options.stream() - .toArray(String[]::new); - inputAutocompleteOptions.setSource(optionsArray); - } - - jQuery.wrap(getElement()).autocomplete(inputAutocompleteOptions); - } - - public void setValue(final String value) { - this.input.value = value; - } - - public String getValue() { - return this.input.value; - } - - @JsType(isNative = true) - public interface InputAutocompleteElement extends JQueryElementalProducer.JQueryElement { - - void autocomplete(InputAutocompleteOptions options); - } - - @Override - public HTMLElement getElement() { - return input; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocompleteOptions.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocompleteOptions.java deleted file mode 100644 index 81ed982a3f2..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/InputAutocompleteOptions.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) -public class InputAutocompleteOptions { - - @JsProperty - public native void setSource(String[] source); -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryElementalProducer.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryElementalProducer.java deleted file mode 100644 index de451231188..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryElementalProducer.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.inject.Produces; - -import elemental2.dom.HTMLElement; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -@JsType(isNative = true) -public abstract class JQueryElementalProducer { - - /** - *

        - * Declares a producer for the JQuery function, allowing it to be injected via Errai IoC. - *

        - *

        - * {@link JsProperty} is used so that GWT translates method calls to property access of the globally-scoped {@code $} symbol. - */ - @Produces - @JsProperty(name = "$", namespace = JsPackage.GLOBAL) - public static native JQuery get(); - - /** - *

        - * The JQuery function, used to enhance regular elements. - */ - @JsFunction - @FunctionalInterface - public interface JQuery { - - T wrap(HTMLElement element); - } - - /** - *

        - * Interface for enhanced JQuery elements. - *

        - *

        - */ - @JsType(isNative = true) - public interface JQueryElement { - - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryProducer.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryProducer.java deleted file mode 100644 index 1e6292f8b6f..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/JQueryProducer.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.inject.Produces; - -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; -import org.jboss.errai.common.client.dom.Element; -import org.jboss.errai.common.client.dom.HTMLElement; - -@JsType(isNative = true) -public abstract class JQueryProducer { - - /** - *

        - * Declares a producer for the JQuery function, allowing it to be injected via Errai IoC. - *

        - *

        - * {@link JsProperty} is used so that GWT translates method calls to property access of the globally-scoped {@code $} symbol. - */ - @Produces - @JsProperty(name = "$", namespace = JsPackage.GLOBAL) - public static native JQuery get(); - - /** - *

        - * The JQuery function, used to enhance regular elements. - */ - @JsFunction - @FunctionalInterface - public interface JQuery { - - T wrap(Element element); - } - - /** - *

        - * Interface for enhanced JQuery elements, exposing API for some convenient methods for getting children or inserting - * sibling elements. - *

        - *

        - */ - @JsType(isNative = true) - public interface JQueryElement extends HTMLElement { - - void after(HTMLElement element); - - void before(HTMLElement element); - - JQueryArray children(); - - JQueryArray children(String selector); - } - - /** - *

        - * Interface for an element array returned by some {@link JQueryElement} methods. - */ - @JsType(isNative = true) - public interface JQueryArray { - - JQueryElement first(); - - JQueryElement get(int index); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.html deleted file mode 100644 index 3c75683dbe0..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.html +++ /dev/null @@ -1,13 +0,0 @@ -

        diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.java deleted file mode 100644 index 01d0d4d65c3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenu.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import elemental2.dom.HTMLDivElement; -import elemental2.dom.HTMLDocument; -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLLIElement; -import elemental2.dom.HTMLUListElement; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.Templated; - -@Templated -@Dependent -public class KebabMenu implements IsElement { - - @Inject - @DataField("kebab") - HTMLDivElement kebab; - - @Inject - @DataField("dropdown-menu") - HTMLUListElement dropdownMenu; - - @Inject - HTMLDocument document; - - @Override - public HTMLElement getElement() { - return kebab; - } - - public void addKebabItem(final HTMLLIElement item) { - dropdownMenu.appendChild(item); - } - - public void addSeparator() { - final HTMLLIElement separator = (HTMLLIElement) document.createElement("li"); - separator.classList.add("divider"); - addKebabItem(separator); - } - - public void setItemsAlignment(final ItemsAlignment alignment) { - if (alignment == ItemsAlignment.RIGHT) { - dropdownMenu.classList.add("dropdown-menu-right"); - } - } - - public void setDropPosition(final DropPosition position) { - if (position == DropPosition.UP) { - kebab.classList.remove("dropdown"); - kebab.classList.add("dropup"); - } else { - kebab.classList.remove("dropup"); - kebab.classList.add("dropdown"); - } - } - - public enum ItemsAlignment { - LEFT, - RIGHT - } - - public enum DropPosition { - UP, - DOWN - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.html b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.html deleted file mode 100644 index dfcf8b97a57..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.html +++ /dev/null @@ -1 +0,0 @@ -
      • diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.java deleted file mode 100644 index dd008cb9fa9..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/KebabMenuItem.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import elemental2.dom.Event; -import elemental2.dom.HTMLAnchorElement; -import elemental2.dom.HTMLElement; -import elemental2.dom.HTMLLIElement; -import org.jboss.errai.common.client.api.elemental2.IsElement; -import org.jboss.errai.ui.shared.api.annotations.DataField; -import org.jboss.errai.ui.shared.api.annotations.EventHandler; -import org.jboss.errai.ui.shared.api.annotations.ForEvent; -import org.jboss.errai.ui.shared.api.annotations.Templated; -import org.uberfire.mvp.Command; - -@Dependent -@Templated -public class KebabMenuItem implements IsElement { - - @Inject - @DataField("kebab-item") - HTMLLIElement item; - - @Inject - @DataField("anchor") - HTMLAnchorElement anchor; - - Command clickHandler; - - @Override - public HTMLElement getElement() { - return item; - } - - public void setText(final String text) { - anchor.textContent = text; - } - - public void setClickHandler(final Command clickHandler) { - this.clickHandler = clickHandler; - } - - @EventHandler("anchor") - public void onClick(@ForEvent("click") Event event) { - if (clickHandler != null) { - clickHandler.execute(); - } - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Modal.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Modal.java deleted file mode 100644 index d702782e9d1..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Modal.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.Div; -import org.jboss.errai.common.client.dom.Document; -import org.jboss.errai.common.client.dom.Element; -import org.jboss.errai.common.client.dom.HTMLElement; - -@Dependent -public class Modal implements IsElement { - - @Inject - private Document document; - - @Inject - private Div div; - - @Override - public HTMLElement getElement() { - return div; - } - - public void show() { - document.getBody().appendChild(div); - show(div); - } - - public void hide() { - hide(div); - document.getBody().removeChild(div); - } - - protected native void show(final Element e) /*-{ - $wnd.jQuery(e).modal('show') - }-*/; - - protected native void hide(final Element e) /*-{ - $wnd.jQuery(e).modal('hide') - }-*/; -} \ No newline at end of file diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Moment.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Moment.java deleted file mode 100644 index 7fe426e91af..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Moment.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.Date; - -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsOverlay; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsType; - -/** - * Wrapper class for Moment.js library - */ -@JsType(isNative = true) -public interface Moment { - - Moment hours(int hours); - - Moment minutes(int minutes); - - Moment seconds(int seconds); - - Moment milliseconds(int milliseconds); - - Moment subtract(int number, - String period); - - Moment startOf(String type); - - Moment endOf(String type); - - Moment add(int number, - String period); - - String format(String format); - - String fromNow(); - - String format(); - - String toString(); - - Double valueOf(); - - int hours(); - - int minutes(); - - int seconds(); - - boolean isValid(); - - @JsOverlay - default Long asLong(){ - return valueOf().longValue(); - } - - @JsOverlay - default Date asDate(){ - return new Date(asLong()); - } - - boolean isSame(Moment moment); - - boolean isSame(Moment moment, String period); - - class Builder { - - @JsMethod(namespace = JsPackage.GLOBAL) - public static native Moment moment(); - - public static Moment moment(Long time) { - return moment(new Double(time)); - } - - @JsMethod(namespace = JsPackage.GLOBAL) - public static native Moment moment(String time, String format); - - @JsMethod(namespace = JsPackage.GLOBAL) - protected static native Moment moment(Double time); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDuration.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDuration.java deleted file mode 100644 index 289f3edad26..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDuration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import com.google.gwt.core.client.JavaScriptObject; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -import static jsinterop.annotations.JsPackage.GLOBAL; - -/** - * Wrapper class for the moment.duration function. - */ -@JsType(isNative = true) -public abstract class MomentDuration { - - @JsProperty(namespace = GLOBAL, name = "moment") - public static MomentDuration moment; - - public native MomentDurationObject duration(final String pattern); - - public native MomentDuration duration(final JavaScriptObject properties); - - public native String toISOString(); -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDurationObject.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDurationObject.java deleted file mode 100644 index a23c61bea96..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentDurationObject.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsType; - -@JsType(isNative = true, namespace = JsPackage.GLOBAL) -public class MomentDurationObject { - - public native int days(); - - public native int hours(); - - public native int minutes(); - - public native int seconds(); -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentTimeZone.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentTimeZone.java deleted file mode 100644 index 8014a78dd08..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/MomentTimeZone.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsMethod; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -/** - * Wrapper class for moment-timezone.min.js library - */ -@JsType(isNative = true, namespace = JsPackage.GLOBAL) -public interface MomentTimeZone { - - String[] names(); - - double utcOffset(); - - String format(final String format); - - class Builder { - - @JsProperty(name = "moment.tz", namespace = JsPackage.GLOBAL) - public static native MomentTimeZone tz(); - - @JsMethod(name = "moment.tz", namespace = JsPackage.GLOBAL) - public static native MomentTimeZone tz(final String timeZone); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Popover.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Popover.java deleted file mode 100644 index 1e6fd1223d3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Popover.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsOverlay; -import jsinterop.annotations.JsType; -import org.uberfire.client.views.pfly.widgets.JQueryProducer.JQueryElement; - -/** - * Wrapper component for PatternFly's Popover - */ -@JsType(isNative = true) -public interface Popover extends JQueryElement { - - void popover(); - - void popover(String method); - - void popover(PopoverOptions options); - - @JsOverlay - default void destroy() { - popover("destroy"); - } - - @JsOverlay - default void show() { - popover("show"); - } - - @JsOverlay - default void hide() { - popover("hide"); - } - - @JsOverlay - default void toggle() { - popover("toggle"); - } - - void on(String event, - PopoverEventCallback callback); - - @JsOverlay - default void addShowListener(final PopoverEventCallback callback) { - on("show.bs.popover", - callback); - } - - @JsOverlay - default void addShownListener(final PopoverEventCallback callback) { - on("shown.bs.popover", - callback); - } - - @JsOverlay - default void addHiddenListener(final PopoverEventCallback callback) { - on("hidden.bs.popover", - callback); - } - - @JsOverlay - default void addHideListener(final PopoverEventCallback callback) { - on("hide.bs.popover", - callback); - } - - @JsOverlay - default void addInsertedListener(final PopoverEventCallback callback) { - on("inserted.bs.popover", - callback); - } - - @JsFunction - @FunctionalInterface - interface PopoverEventCallback { - - void onEvent(); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/PopoverOptions.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/PopoverOptions.java deleted file mode 100644 index f9ffe615bea..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/PopoverOptions.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import elemental2.dom.HTMLElement; -import jsinterop.annotations.JsFunction; -import jsinterop.annotations.JsPackage; -import jsinterop.annotations.JsProperty; -import jsinterop.annotations.JsType; - -@JsType(isNative = true, name = "Object", namespace = JsPackage.GLOBAL) -public class PopoverOptions { - - @JsProperty - public native void setAnimation(Boolean animation); - - @JsProperty - public native void setContainer(String container); - - @JsProperty - public native void setContent(String content); - - @JsProperty - public native void setContent(PopoverCallback callback); - - @JsProperty - public native void setDelay(int delay); - - @JsProperty - public native void setHtml(Boolean html); - - @JsProperty - public native void setPlacement(String placement); - - @JsProperty - public native void setSelector(String selector); - - @JsProperty - public native void setTemplate(String template); - - @JsProperty - public native void setTemplate(PopoverCallback callback); - - @JsProperty - public native void setTitle(String title); - - @JsProperty - public native void setTitle(PopoverCallback callback); - - @JsProperty - public native void setTrigger(String trigger); - - @JsProperty - public native void setViewport(String viewport); - - @JsProperty - public native void setViewport(PopoverCallback callback); - - @JsFunction - @FunctionalInterface - public interface PopoverCallback { - - Object getValue(HTMLElement element); - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/SanitizedNumberInput.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/SanitizedNumberInput.java deleted file mode 100644 index 56cc5e08b07..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/SanitizedNumberInput.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2018 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.EventListener; -import org.jboss.errai.common.client.dom.KeyboardEvent; -import org.jboss.errai.common.client.dom.NumberInput; - -@Dependent -public class SanitizedNumberInput implements IsElement { - - @Inject - NumberInput input; - - private boolean allowNegative = false; - private boolean allowDecimal = false; - - public void init() { - init("0", null, false, false); - } - - public void init(final String min, final String step) { - init(min, step, false, false); - } - - public void init(final String min, final String step, final boolean allowNegative, final boolean allowDecimal) { - if (min != null) { - input.setAttribute("min", min); - } - if (step != null) { - input.setAttribute("step", step); - } - this.allowDecimal = allowDecimal || (step != null && step.contains(".")); - this.allowNegative = allowNegative || (min != null && min.startsWith("-")); - - input.addEventListener("keypress", getEventListener(this.allowNegative, this.allowDecimal), false); - } - - protected EventListener getEventListener(boolean allowNegative, boolean allowDecimal) { - return e -> { - String key = e.getKey(); - if (key.length() == 1) { - char k = key.charAt(0); - if ((k != '-' || !allowNegative) - && (k != '.' || !allowDecimal) - && (k < '0' || k > '9')) { - e.preventDefault(); - } - } - }; - } - - @Override - public NumberInput getElement() { - return input; - } -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Select.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Select.java deleted file mode 100644 index d7682274e04..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/widgets/Select.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2017 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.uberfire.client.views.pfly.widgets; - -import java.util.function.Consumer; - -import javax.enterprise.context.Dependent; -import javax.inject.Inject; - -import com.google.gwt.core.client.Scheduler; -import com.google.gwt.user.client.TakesValue; -import org.jboss.errai.common.client.api.IsElement; -import org.jboss.errai.common.client.dom.Document; -import org.jboss.errai.common.client.dom.HTMLElement; -import org.jboss.errai.common.client.dom.Option; -import org.jboss.errai.common.client.dom.OptionsCollection; - -import static com.google.common.base.Strings.isNullOrEmpty; - -@Dependent -public class Select implements IsElement, - TakesValue { - - @Inject - private Document document; - - @Inject - private org.jboss.errai.common.client.dom.Select select; - - @Override - public HTMLElement getElement() { - return select; - } - - public void addOption(final String text) { - addOption(text, - text); - } - - public void addOption(final String text, - final String value) { - addOption(text, - value, - false); - } - - public void addOption(final String text, - final String value, - final Boolean selected) { - addOption(text, - null, - value, - selected); - } - - public void addOption(final String text, - final String subText, - final String value, - final Boolean selected) { - final Option option = (Option) document.createElement("option"); - option.setText(text); - option.setValue(value); - option.setSelected(selected); - if (isNullOrEmpty(subText) == false) { - option.setAttribute("data-subtext", - subText); - } - select.add(option); - } - - public OptionsCollection getOptions() { - return select.getOptions(); - } - - public void removeAllOptions() { - removeAllOptions(select); - } - - public void refresh() { - refresh(null); - } - - public void refresh(final Consumer", - options: { - appendTo: null, - autoFocus: !1, - delay: 300, - minLength: 1, - position: { my: "left top", at: "left bottom", collision: "none" }, - source: null, - change: null, - close: null, - focus: null, - open: null, - response: null, - search: null, - select: null, - }, - requestIndex: 0, - pending: 0, - _create: function () { - var e, - i, - s, - n = this.element[0].nodeName.toLowerCase(), - o = "textarea" === n, - a = "input" === n; - (this.isMultiLine = o || (!a && this._isContentEditable(this.element))), - (this.valueMethod = this.element[o || a ? "val" : "text"]), - (this.isNewMenu = !0), - this._addClass("ui-autocomplete-input"), - this.element.attr("autocomplete", "off"), - this._on(this.element, { - keydown: function (n) { - if (this.element.prop("readOnly")) return (e = !0), (s = !0), (i = !0), void 0; - (e = !1), (s = !1), (i = !1); - var o = t.ui.keyCode; - switch (n.keyCode) { - case o.PAGE_UP: - (e = !0), this._move("previousPage", n); - break; - case o.PAGE_DOWN: - (e = !0), this._move("nextPage", n); - break; - case o.UP: - (e = !0), this._keyEvent("previous", n); - break; - case o.DOWN: - (e = !0), this._keyEvent("next", n); - break; - case o.ENTER: - this.menu.active && ((e = !0), n.preventDefault(), this.menu.select(n)); - break; - case o.TAB: - this.menu.active && this.menu.select(n); - break; - case o.ESCAPE: - this.menu.element.is(":visible") && - (this.isMultiLine || this._value(this.term), this.close(n), n.preventDefault()); - break; - default: - (i = !0), this._searchTimeout(n); - } - }, - keypress: function (s) { - if (e) - return (e = !1), (!this.isMultiLine || this.menu.element.is(":visible")) && s.preventDefault(), void 0; - if (!i) { - var n = t.ui.keyCode; - switch (s.keyCode) { - case n.PAGE_UP: - this._move("previousPage", s); - break; - case n.PAGE_DOWN: - this._move("nextPage", s); - break; - case n.UP: - this._keyEvent("previous", s); - break; - case n.DOWN: - this._keyEvent("next", s); - } - } - }, - input: function (t) { - return s ? ((s = !1), t.preventDefault(), void 0) : (this._searchTimeout(t), void 0); - }, - focus: function () { - (this.selectedItem = null), (this.previous = this._value()); - }, - blur: function (t) { - return this.cancelBlur - ? (delete this.cancelBlur, void 0) - : (clearTimeout(this.searching), this.close(t), this._change(t), void 0); - }, - }), - this._initSource(), - (this.menu = t("
          ").appendTo(this._appendTo()).menu({ role: null }).hide().menu("instance")), - this._addClass(this.menu.element, "ui-autocomplete", "ui-front"), - this._on(this.menu.element, { - mousedown: function (e) { - e.preventDefault(), - (this.cancelBlur = !0), - this._delay(function () { - delete this.cancelBlur, - this.element[0] !== t.ui.safeActiveElement(this.document[0]) && this.element.trigger("focus"); - }); - }, - menufocus: function (e, i) { - var s, n; - return this.isNewMenu && ((this.isNewMenu = !1), e.originalEvent && /^mouse/.test(e.originalEvent.type)) - ? (this.menu.blur(), - this.document.one("mousemove", function () { - t(e.target).trigger(e.originalEvent); - }), - void 0) - : ((n = i.item.data("ui-autocomplete-item")), - !1 !== this._trigger("focus", e, { item: n }) && - e.originalEvent && - /^key/.test(e.originalEvent.type) && - this._value(n.value), - (s = i.item.attr("aria-label") || n.value), - s && - t.trim(s).length && - (this.liveRegion.children().hide(), t("
          ").text(s).appendTo(this.liveRegion)), - void 0); - }, - menuselect: function (e, i) { - var s = i.item.data("ui-autocomplete-item"), - n = this.previous; - this.element[0] !== t.ui.safeActiveElement(this.document[0]) && - (this.element.trigger("focus"), - (this.previous = n), - this._delay(function () { - (this.previous = n), (this.selectedItem = s); - })), - !1 !== this._trigger("select", e, { item: s }) && this._value(s.value), - (this.term = this._value()), - this.close(e), - (this.selectedItem = s); - }, - }), - (this.liveRegion = t("
          ", { - role: "status", - "aria-live": "assertive", - "aria-relevant": "additions", - }).appendTo(this.document[0].body)), - this._addClass(this.liveRegion, null, "ui-helper-hidden-accessible"), - this._on(this.window, { - beforeunload: function () { - this.element.removeAttr("autocomplete"); - }, - }); - }, - _destroy: function () { - clearTimeout(this.searching), - this.element.removeAttr("autocomplete"), - this.menu.element.remove(), - this.liveRegion.remove(); - }, - _setOption: function (t, e) { - this._super(t, e), - "source" === t && this._initSource(), - "appendTo" === t && this.menu.element.appendTo(this._appendTo()), - "disabled" === t && e && this.xhr && this.xhr.abort(); - }, - _isEventTargetInWidget: function (e) { - var i = this.menu.element[0]; - return e.target === this.element[0] || e.target === i || t.contains(i, e.target); - }, - _closeOnClickOutside: function (t) { - this._isEventTargetInWidget(t) || this.close(); - }, - _appendTo: function () { - var e = this.options.appendTo; - return ( - e && (e = e.jquery || e.nodeType ? t(e) : this.document.find(e).eq(0)), - (e && e[0]) || (e = this.element.closest(".ui-front, dialog")), - e.length || (e = this.document[0].body), - e - ); - }, - _initSource: function () { - var e, - i, - s = this; - t.isArray(this.options.source) - ? ((e = this.options.source), - (this.source = function (i, s) { - s(t.ui.autocomplete.filter(e, i.term)); - })) - : "string" == typeof this.options.source - ? ((i = this.options.source), - (this.source = function (e, n) { - s.xhr && s.xhr.abort(), - (s.xhr = t.ajax({ - url: i, - data: e, - dataType: "json", - success: function (t) { - n(t); - }, - error: function () { - n([]); - }, - })); - })) - : (this.source = this.options.source); - }, - _searchTimeout: function (t) { - clearTimeout(this.searching), - (this.searching = this._delay(function () { - var e = this.term === this._value(), - i = this.menu.element.is(":visible"), - s = t.altKey || t.ctrlKey || t.metaKey || t.shiftKey; - (!e || (e && !i && !s)) && ((this.selectedItem = null), this.search(null, t)); - }, this.options.delay)); - }, - search: function (t, e) { - return ( - (t = null != t ? t : this._value()), - (this.term = this._value()), - t.length < this.options.minLength - ? this.close(e) - : this._trigger("search", e) !== !1 - ? this._search(t) - : void 0 - ); - }, - _search: function (t) { - this.pending++, - this._addClass("ui-autocomplete-loading"), - (this.cancelSearch = !1), - this.source({ term: t }, this._response()); - }, - _response: function () { - var e = ++this.requestIndex; - return t.proxy(function (t) { - e === this.requestIndex && this.__response(t), - this.pending--, - this.pending || this._removeClass("ui-autocomplete-loading"); - }, this); - }, - __response: function (t) { - t && (t = this._normalize(t)), - this._trigger("response", null, { content: t }), - !this.options.disabled && t && t.length && !this.cancelSearch - ? (this._suggest(t), this._trigger("open")) - : this._close(); - }, - close: function (t) { - (this.cancelSearch = !0), this._close(t); - }, - _close: function (t) { - this._off(this.document, "mousedown"), - this.menu.element.is(":visible") && - (this.menu.element.hide(), this.menu.blur(), (this.isNewMenu = !0), this._trigger("close", t)); - }, - _change: function (t) { - this.previous !== this._value() && this._trigger("change", t, { item: this.selectedItem }); - }, - _normalize: function (e) { - return e.length && e[0].label && e[0].value - ? e - : t.map(e, function (e) { - return "string" == typeof e - ? { label: e, value: e } - : t.extend({}, e, { label: e.label || e.value, value: e.value || e.label }); - }); - }, - _suggest: function (e) { - var i = this.menu.element.empty(); - this._renderMenu(i, e), - (this.isNewMenu = !0), - this.menu.refresh(), - i.show(), - this._resizeMenu(), - i.position(t.extend({ of: this.element }, this.options.position)), - this.options.autoFocus && this.menu.next(), - this._on(this.document, { mousedown: "_closeOnClickOutside" }); - }, - _resizeMenu: function () { - var t = this.menu.element; - t.outerWidth(Math.max(t.width("").outerWidth() + 1, this.element.outerWidth())); - }, - _renderMenu: function (e, i) { - var s = this; - t.each(i, function (t, i) { - s._renderItemData(e, i); - }); - }, - _renderItemData: function (t, e) { - return this._renderItem(t, e).data("ui-autocomplete-item", e); - }, - _renderItem: function (e, i) { - return t("
        • ").append(t("
          ").text(i.label)).appendTo(e); - }, - _move: function (t, e) { - return this.menu.element.is(":visible") - ? (this.menu.isFirstItem() && /^previous/.test(t)) || (this.menu.isLastItem() && /^next/.test(t)) - ? (this.isMultiLine || this._value(this.term), this.menu.blur(), void 0) - : (this.menu[t](e), void 0) - : (this.search(null, e), void 0); - }, - widget: function () { - return this.menu.element; - }, - _value: function () { - return this.valueMethod.apply(this.element, arguments); - }, - _keyEvent: function (t, e) { - (!this.isMultiLine || this.menu.element.is(":visible")) && (this._move(t, e), e.preventDefault()); - }, - _isContentEditable: function (t) { - if (!t.length) return !1; - var e = t.prop("contentEditable"); - return "inherit" === e ? this._isContentEditable(t.parent()) : "true" === e; - }, - }), - t.extend(t.ui.autocomplete, { - escapeRegex: function (t) { - return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"); - }, - filter: function (e, i) { - var s = RegExp(t.ui.autocomplete.escapeRegex(i), "i"); - return t.grep(e, function (t) { - return s.test(t.label || t.value || t); - }); - }, - }), - t.widget("ui.autocomplete", t.ui.autocomplete, { - options: { - messages: { - noResults: "No search results.", - results: function (t) { - return t + (t > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."; - }, - }, - }, - __response: function (e) { - var i; - this._superApply(arguments), - this.options.disabled || - this.cancelSearch || - ((i = e && e.length ? this.options.messages.results(e.length) : this.options.messages.noResults), - this.liveRegion.children().hide(), - t("
          ").text(i).appendTo(this.liveRegion)); - }, - }), - t.ui.autocomplete; -}); diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-patternfly.css b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-patternfly.css deleted file mode 100644 index dbed79fc431..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-patternfly.css +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright 2015 Red Hat, Inc. and/or its affiliates. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.fa-muted { - color: #999999; -} - -.fa-active { - color: #0076b7; -} - -.panel.uf-listbar-panel { - border: none; - height: 100%; -} - -.panel.uf-listbar-panel .panel-body { - padding: 0px; - height: 100%; -} - -.panel.uf-listbar-panel .uf-listbar-panel-header { - background-color: #ffffff; -} - -.uf-listbar-panel .uf-listbar-panel-header { - display: flex; - padding-top: 6px; - padding-bottom: 6px; -} - -.uf-listbar-panel .uf-listbar-panel-header .dropdown-menu { - margin-top: 6px; -} - -.uf-listbar-panel .uf-listbar-panel-header .dropdown-menu i { - margin-top: 4px; -} - -.uf-listbar-panel .uf-listbar-panel-header .dropdown-menu span { - margin-right: 15px; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-toolbar { - white-space: nowrap; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-toolbar .btn-group, -.uf-listbar-panel-header .uf-listbar-panel-header-toolbar .btn-group button { - float: none; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title { - flex-grow: 1; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title button:hover, -.uf-listbar-panel-header .uf-listbar-panel-header-title button:focus { - color: inherit; - text-decoration: none; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title .caret { - margin-left: 3px; - display: inline-block; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title:hover .caret { - color: #0076b7; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title button { - color: inherit; - padding: 0 18px 0 0; - width: 100%; - text-align: left; - border: none; - font-size: 16px; - font-weight: 500; - line-height: normal; - position: absolute; - top: 0; - left: 0; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title .dropdown { - position: static; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title .dropdown-menu { - left: auto; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title .dropdown-menu > li > a { - white-space: normal; -} - -.uf-listbar-panel-header .uf-listbar-panel-header-title-text { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - display: inline-block; - float: left; - max-width: 100%; - width: auto; -} - -.uf-tabbar-panel { -} - -.uf-tabbar-panel .tab-content { - height: 100%; -} - -.uf-tabbar-panel-nav-tabs { - padding-top: 1px; -} - -.uf-tabbar-panel-widgets { - padding-top: 1px; -} - -.uf-tabbar-panel-nav-tabs .uf-activeNavTabs { -} - -.uf-multitab-panel .uf-tabbar-panel-nav-tabs .uf-tabbar-panel-widgets .active:hover a { - cursor: move; -} - -.uf-modal .modal-footer { - margin-top: 0px; -} - -.uf-drop-target-highlight { - z-index: 100000; - border: 2px #0076b7 solid; - background-color: #199dde; - opacity: 0.5; - filter: alpha(opacity=50); -} - -.uf-drop-target-compass { - z-index: 100001; - background-color: #fff; - border: 1px #ddd solid; -} - -.uf-drop-target-compass-centre { - border: 1px #ddd solid; -} - -.uf-drop-target-compass-west, -.uf-drop-target-compass-east { - border-top: 1px #ddd solid; - border-bottom: 1px #ddd solid; -} - -.uf-drop-target-compass-centre > i, -.uf-drop-target-compass-west > i, -.uf-drop-target-compass-east > i { - position: absolute; - top: 40%; - left: 35%; -} - -.uf-drop-target-compass-north, -.uf-drop-target-compass-south { - text-align: center; -} - -.uf-list-dropdown { -} - -.uf-list-dropdown-single { -} - -.uf-list-dropdown-single a:hover { - cursor: default; -} - -.uf-list-dropdown-multi { -} - -.uf-part-list-dropdown-selected span { - font-weight: bold; -} - -.uf-multi-page-editor .nav-tabs-pf > li:first-child > a { - padding-left: 15px; -} - -.uf-multi-page-editor .nav-tabs-pf > li:first-child > a:before { - left: 15px !important; -} - -.uf-multi-page-editor .uf-tabbar-panel-nav-tabs .uf-tabbar-panel-widgets { - padding-top: 0px; -} - -.navbar-pf.uf-navbar-compact .uf-navbar-nav-compact > li:first-child { - border-left: 1px solid #2b2b2b; -} - -.navbar-pf.uf-navbar-compact .uf-navbar-nav-compact > li > a { - padding: 7px 10px 8px 10px; -} - -.navbar-pf.uf-navbar-compact .uf-navbar-nav-compact > li > a:hover { - background-color: #1d1d1d; - border-top-color: #5c5c5c; - color: #cfcfcf; - background-image: -webkit-linear-gradient(top, #363636 0%, #1d1d1d 100%); - background-image: -o-linear-gradient(top, #363636 0%, #1d1d1d 100%); - background-image: linear-gradient(to bottom, #363636 0%, #1d1d1d 100%); - background-repeat: repeat-x; - filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff363636', endColorstr='#ff1d1d1d', GradientType=0); -} - -.navbar-pf .navbar-header .navbar-brand { - margin-right: 10px; -} - -.navbar-pf .dropdown-menu { - z-index: 100010; -} - -@media (min-width: 768px) { - .navbar-pf .navbar-nav.navbar-utility > li > a { - height: 26px; - } - - /* Fix mega menu items center alignment in IE11 */ - #mega-menu .nav-item-iconic { - height: 58px; - } -} - -@media (max-width: 767px) { - .navbar-pf .navbar-header, - .uf-perspective-context-menu, - .uf-perspective-context-menu li, - .nav.navbar-nav.navbar-primary.persistent-secondary li { - float: none !important; - } - - li.uf-perspective-context-menu-empty { - padding-top: 0; - } - - .navbar-pf .navbar-primary.persistent-secondary > li.uf-perspective-context-menu-empty.active { - margin-bottom: 0px; - } - - .navbar-pf .navbar-nav.uf-navbar-nav-compact { - font-size: 12px; - } - - .navbar-pf .navbar-nav.uf-navbar-nav-compact > li > a { - padding: 10px 20px; - } -} - -/* Fix for modal behind backdrop. Potentially fixed by the next BS release. - Broken in 3.3.4 - See https://github.com/twbs/bootstrap/issues/16148 - */ -.modal-dialog { - z-index: 1050; -} - -.uf-navbar-nav-compact { - font-size: 11px; -} - -.uf-navbar-nav-compact > li:first-child > a, -.uf-navbar-nav-compact > li:first-child.open > a, -.uf-navbar-nav-compact > li:first-child > a:hover, -.uf-navbar-nav-compact > li:first-child > a:focus { - background-color: #303030; - background-image: linear-gradient(to bottom, #434343 0px, #303030 100%); - background-repeat: repeat-x; - border-bottom-color: #303030; - border-top-color: #696969; - box-shadow: none; - color: #f1f1f1; -} - -.navbar-pf .navbar-nav.uf-navbar-nav-compact .uf-perspective-context-menu.open > a, -.navbar-pf .navbar-nav.uf-navbar-nav-compact .uf-perspective-context-menu > a:hover, -.navbar-pf .navbar-nav.uf-navbar-nav-compact .uf-perspective-context-menu > a:focus { - color: #f1f1f1; -} - -.navbar-pf .navbar-nav.persistent-secondary .dropdown-menu { - top: auto; - left: auto; -} - -.navbar-pf .navbar-nav.navbar-primary.persistent-secondary > li.active { - margin-bottom: 33px; -} - -.navbar-pf .navbar-nav.navbar-primary.persistent-secondary > li.active:not(.uf-perspective-context-menu-container) { - margin-bottom: 0px; -} - -.navbar-pf .navbar-nav.navbar-primary.persistent-secondary > li > .navbar-persistent > li a.disabled { - color: #999; -} - -.uf-help-icon { - color: #0099d3; - display: inline; -} - -.uf-form-label .uf-help-icon { - margin-left: 5px; -} - -.form-horizontal .uf-form-label { - text-align: right; -} - -.uf-perspective-context-menu-empty { - padding-top: 43px; -} diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-variables.less b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-variables.less deleted file mode 100644 index 798b346fa9d..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/resources/org/uberfire/client/views/static/uberfire-variables.less +++ /dev/null @@ -1,15 +0,0 @@ -@import "less/variables.less"; -@import "less/dependencies/bootstrap/variables.less"; -@import "less/dependencies/font-awesome/variables.less"; - -@spacer: 1rem; -@pf-spacer-xxxs: (@spacer * 0.25); // ~3px -@pf-spacer-xxs: (@spacer * 0.5); // 7px -@pf-spacer-xs: (@spacer * 0.75); // ~10px -@pf-spacer-sm: @spacer; // 14px -@pf-spacer-md: (@spacer * 1.25); // ~17px -@pf-spacer-lg: (@spacer * 1.5); // 21px -@pf-spacer-xl: (@spacer * 1.75); // ~24px -@pf-spacer-xxl: (@spacer * 2); // 28 px -@pf-spacer-xxxl: (@spacer * 2.5); // 35 px -@pf-spacer-xxxxl: (@spacer * 3); // 42 px diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/test/java/org/uberfire/client/views/pfly/PatternFlyTabTests.gwt.xml b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/test/java/org/uberfire/client/views/pfly/PatternFlyTabTests.gwt.xml deleted file mode 100644 index ba4ff2a53b3..00000000000 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/test/java/org/uberfire/client/views/pfly/PatternFlyTabTests.gwt.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - -