├── .gradle
├── 6.1
│ ├── gc.properties
│ ├── fileChanges
│ │ └── last-build.bin
│ ├── fileHashes
│ │ ├── fileHashes.bin
│ │ ├── fileHashes.lock
│ │ └── resourceHashesCache.bin
│ ├── fileContent
│ │ └── fileContent.lock
│ ├── javaCompile
│ │ └── javaCompile.lock
│ └── executionHistory
│ │ ├── executionHistory.bin
│ │ └── executionHistory.lock
├── vcs-1
│ └── gc.properties
├── 2.10
│ └── taskArtifacts
│ │ ├── cache.properties
│ │ ├── fileHashes.bin
│ │ ├── fileSnapshots.bin
│ │ ├── taskArtifacts.bin
│ │ ├── outputFileStates.bin
│ │ └── cache.properties.lock
├── buildOutputCleanup
│ ├── cache.properties
│ ├── outputFiles.bin
│ └── buildOutputCleanup.lock
└── checksums
│ ├── checksums.lock
│ ├── md5-checksums.bin
│ └── sha1-checksums.bin
├── .gitignore
├── images
├── Logo.png
├── indeterminate.gif
├── areo-progressbar.jpg
├── error-progress.jpg
├── normal-progress.jpg
├── paused-progress.jpg
└── full-error-progress.jpg
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .nb-gradle
├── private
│ └── cache
│ │ └── FXTaskbar-d41d8cd98f00b204e9800998ecf8427e
└── profiles
│ └── private
│ └── aux-config
├── src
├── main
│ └── java
│ │ └── com
│ │ └── nativejavafx
│ │ └── taskbar
│ │ ├── exception
│ │ ├── StageNotShownException.java
│ │ └── UnsupportedSystemException.java
│ │ ├── util
│ │ └── OS.java
│ │ ├── strategy
│ │ ├── StageIndexer.java
│ │ ├── DefaultStageIndexer.java
│ │ ├── HWNDStrategy.java
│ │ └── GlassApiHWNDStrategy.java
│ │ ├── NullTaskbarProgressbar.java
│ │ ├── TaskbarProgressbarFactory.java
│ │ ├── TaskbarProgressbarImpl.java
│ │ └── TaskbarProgressbar.java
└── test
│ └── java
│ ├── DemoWStaticMethods.java
│ └── Demo.java
├── settings.gradle
├── common.gradle
├── gradlew.bat
├── gradlew
├── README.md
└── LICENSE
/.gradle/6.1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gradle/vcs-1/gc.properties:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gradle/6.1/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/cache.properties:
--------------------------------------------------------------------------------
1 | #Fri Oct 18 18:07:25 CEST 2019
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | .idea
3 | .gradle
4 | .nb-gradle
5 | out
6 | lgcr.pptx
7 | ~$lgcr.pptx
8 | builds
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/cache.properties:
--------------------------------------------------------------------------------
1 | #Wed May 13 09:10:59 CEST 2020
2 | gradle.version=6.1
3 |
--------------------------------------------------------------------------------
/images/Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/Logo.png
--------------------------------------------------------------------------------
/images/indeterminate.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/indeterminate.gif
--------------------------------------------------------------------------------
/images/areo-progressbar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/areo-progressbar.jpg
--------------------------------------------------------------------------------
/images/error-progress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/error-progress.jpg
--------------------------------------------------------------------------------
/images/normal-progress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/normal-progress.jpg
--------------------------------------------------------------------------------
/images/paused-progress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/paused-progress.jpg
--------------------------------------------------------------------------------
/.gradle/checksums/checksums.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/checksums/checksums.lock
--------------------------------------------------------------------------------
/images/full-error-progress.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/images/full-error-progress.jpg
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/.gradle/6.1/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/.gradle/checksums/md5-checksums.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/checksums/md5-checksums.bin
--------------------------------------------------------------------------------
/.gradle/checksums/sha1-checksums.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/checksums/sha1-checksums.bin
--------------------------------------------------------------------------------
/.gradle/6.1/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/2.10/taskArtifacts/fileHashes.bin
--------------------------------------------------------------------------------
/.gradle/6.1/fileContent/fileContent.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/fileContent/fileContent.lock
--------------------------------------------------------------------------------
/.gradle/6.1/javaCompile/javaCompile.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/javaCompile/javaCompile.lock
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/outputFiles.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/buildOutputCleanup/outputFiles.bin
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/fileSnapshots.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/2.10/taskArtifacts/fileSnapshots.bin
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/taskArtifacts.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/2.10/taskArtifacts/taskArtifacts.bin
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/outputFileStates.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/2.10/taskArtifacts/outputFileStates.bin
--------------------------------------------------------------------------------
/.gradle/6.1/fileHashes/resourceHashesCache.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/fileHashes/resourceHashesCache.bin
--------------------------------------------------------------------------------
/.gradle/2.10/taskArtifacts/cache.properties.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/2.10/taskArtifacts/cache.properties.lock
--------------------------------------------------------------------------------
/.gradle/6.1/executionHistory/executionHistory.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/executionHistory/executionHistory.bin
--------------------------------------------------------------------------------
/.gradle/6.1/executionHistory/executionHistory.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/6.1/executionHistory/executionHistory.lock
--------------------------------------------------------------------------------
/.gradle/buildOutputCleanup/buildOutputCleanup.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.gradle/buildOutputCleanup/buildOutputCleanup.lock
--------------------------------------------------------------------------------
/.nb-gradle/private/cache/FXTaskbar-d41d8cd98f00b204e9800998ecf8427e:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Dansoftowner/FXTaskbarProgressBar/HEAD/.nb-gradle/private/cache/FXTaskbar-d41d8cd98f00b204e9800998ecf8427e
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/exception/StageNotShownException.java:
--------------------------------------------------------------------------------
1 | package com.nativejavafx.taskbar.exception;
2 |
3 | public class StageNotShownException extends RuntimeException {
4 | public StageNotShownException(String message) {
5 | super(message);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/exception/UnsupportedSystemException.java:
--------------------------------------------------------------------------------
1 | package com.nativejavafx.taskbar.exception;
2 |
3 | public class UnsupportedSystemException extends RuntimeException {
4 | public UnsupportedSystemException(String message) {
5 | super(message);
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'FXTaskbar'
2 |
3 | // Find the directories containing a "build.gradle" file in the root directory
4 | // of the project. That is, every directory containing a "build.gradle" will
5 | // be automatically the subproject of this project.
6 | def subDirs = rootDir.listFiles(new FileFilter() {
7 | public boolean accept(File file) {
8 | if (!file.isDirectory()) {
9 | return false
10 | }
11 | if (file.name == 'buildSrc') {
12 | return false
13 | }
14 | return new File(file, 'build.gradle').isFile()
15 | }
16 | });
17 |
18 | subDirs.each { File dir ->
19 | include dir.name
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/util/OS.java:
--------------------------------------------------------------------------------
1 | package com.nativejavafx.taskbar.util;
2 |
3 | /**
4 | * Utility class is for checking the
5 | * type of the current platform that the
6 | * application runs on.
7 | */
8 | public class OS {
9 |
10 | private static final String OS = System.getProperty("os.name");
11 | private static final String VERSION = System.getProperty("os.version");
12 |
13 | private static final boolean WINDOWS = OS.startsWith("Windows");
14 | private static final boolean WINDOWS_7_OR_LATER = WINDOWS && versionGreaterThanOrEqualTo(6.1F);
15 |
16 | private OS() {
17 | }
18 |
19 | /**
20 | * Checks that the OS is Windows 7 or later
21 | *
22 | * @return true if the Os is windows 7 or later;
23 | * false otherwise
24 | */
25 | public static boolean isWindows7OrLater() {
26 | return WINDOWS_7_OR_LATER;
27 | }
28 |
29 | public static boolean versionGreaterThanOrEqualTo(float value) {
30 | try {
31 | return Float.parseFloat(VERSION) >= value;
32 | } catch (Exception e) {
33 | return false;
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/strategy/StageIndexer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.nativejavafx.taskbar.strategy;
16 |
17 | import javafx.stage.Stage;
18 |
19 | /**
20 | * A StageIndexer is used for get the index of a javaFX Stage
21 | * in the WindowHierarchy
22 | */
23 | public interface StageIndexer {
24 |
25 | /**
26 | * Gets the index of a javaFX Stage in the Window-hierarchy.
27 | *
28 | * @param stage the stage to get the index of; mustn't be null
29 | * @return the index of the Stage
30 | * @throws NullPointerException if the stage is null
31 | */
32 | int indexOf(Stage stage);
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/strategy/DefaultStageIndexer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.nativejavafx.taskbar.strategy;
16 |
17 | import com.sun.javafx.stage.StageHelper;
18 | import javafx.stage.Stage;
19 |
20 | /**
21 | * A {@link DefaultStageIndexer} is a {@link StageIndexer}
22 | * that calculates the index of the stage through the
23 | * {@link StageHelper#getStages()} API.
24 | *
25 | * Works on java 8 only
26 | */
27 | public class DefaultStageIndexer implements StageIndexer {
28 | @Override
29 | public int indexOf(Stage stage) {
30 | return StageHelper.getStages().indexOf(stage);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/strategy/HWNDStrategy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.nativejavafx.taskbar.strategy;
16 |
17 | import javafx.stage.Stage;
18 |
19 | /**
20 | * A HWNDStrategy used for getting the HWND
21 | * ("lowest-level" native window handle on Windows systems)
22 | */
23 | public interface HWNDStrategy {
24 |
25 | /**
26 | * Returns the native handle (on Windows: HWND)
27 | * of the javaFX Stage
28 | *
29 | * @param stage the stage to get the HWND of; mustn't be null
30 | * @return the HWND value
31 | * @throws NullPointerException if the stage is null
32 | */
33 | long getHWND(Stage stage);
34 | }
35 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/NullTaskbarProgressbar.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.nativejavafx.taskbar;
16 |
17 | import org.jetbrains.annotations.NotNull;
18 |
19 | /**
20 | * A NullTaskbarProgressbar is a {@link TaskbarProgressbar} which
21 | * actually doesn't do everything
22 | */
23 | class NullTaskbarProgressbar extends TaskbarProgressbar {
24 | @Override
25 | public void stopProgress() {
26 | }
27 |
28 | @Override
29 | public void showIndeterminateProgress() {
30 | }
31 |
32 | @Override
33 | public void showCustomProgress(long done, long max, @NotNull Type type) {
34 | }
35 |
36 | @Override
37 | public void setProgressType(@NotNull Type type) {
38 | }
39 |
40 | @Override
41 | public void closeOperations() {
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/.nb-gradle/profiles/private/aux-config:
--------------------------------------------------------------------------------
1 |
2 |
27 | * This kind of process needs the index of the window in the window- 28 | * hierarchy to get the HWND value. 29 | * For the indexing, this strategy-object needs a {@link StageIndexer} 30 | */ 31 | public class GlassApiHWNDStrategy implements HWNDStrategy { 32 | 33 | private final StageIndexer indexer; 34 | 35 | /** 36 | * Creates a basic {@link GlassApiHWNDStrategy} that 37 | * needs a {@link StageIndexer}. 38 | * 39 | * @param indexer the stage-indexer; mustn't be null 40 | */ 41 | public GlassApiHWNDStrategy(StageIndexer indexer) { 42 | this.indexer = Objects.requireNonNull(indexer, "The indexer mustn't be null"); 43 | } 44 | 45 | @Override 46 | public long getHWND(Stage stage) { 47 | return com.sun.glass.ui.Window.getWindows() 48 | .get(indexer.indexOf(stage)) 49 | .getNativeWindow(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/nativejavafx/taskbar/TaskbarProgressbarFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the Apache License, Version 2.0 (the "License"); 3 | * you may not use this file except in compliance with the License. 4 | * You may obtain a copy of the License at 5 | * 6 | * http://www.apache.org/licenses/LICENSE-2.0 7 | * 8 | * Unless required by applicable law or agreed to in writing, software 9 | * distributed under the License is distributed on an "AS IS" BASIS, 10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | * See the License for the specific language governing permissions and 12 | * limitations under the License. 13 | */ 14 | 15 | package com.nativejavafx.taskbar; 16 | 17 | import com.nativejavafx.taskbar.strategy.GlassApiHWNDStrategy; 18 | import com.nativejavafx.taskbar.strategy.DefaultStageIndexer; 19 | import javafx.stage.Stage; 20 | 21 | import static com.nativejavafx.taskbar.TaskbarProgressbar.isNotSupported; 22 | import static com.nativejavafx.taskbar.TaskbarProgressbar.isSupported; 23 | 24 | /** 25 | * The TaskbarProgressbarFactory class is responsible for 26 | * creating the right {@link TaskbarProgressbar} object. 27 | */ 28 | public class TaskbarProgressbarFactory { 29 | 30 | static TaskbarProgressbar getTaskbarProgressbarImpl(Stage stage) { 31 | return new TaskbarProgressbarImpl(stage, new GlassApiHWNDStrategy(new DefaultStageIndexer())); 32 | } 33 | 34 | /** 35 | * Creates a {@link TaskbarProgressbar} object. 36 | * 37 | *
38 | * At first it checks that the taskbar progressbar functionality
39 | * is supported on the current system: if it is then it will
40 | * return a fully featured TaskbarProgressbar; otherwise
41 | * it will return a taskbar-progressbar object that actually
42 | * doesn't do anything.
43 | *
44 | * @param stage the stage to get the progressbar on the taskbar to
45 | * @return the taskbar-progressbar object
46 | */
47 | public static TaskbarProgressbar getTaskbarProgressbar(Stage stage) {
48 | if (TaskbarProgressbar.isNotSupported())
49 | return new NullTaskbarProgressbar();
50 | return getTaskbarProgressbarImpl(stage);
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/src/test/java/DemoWStaticMethods.java:
--------------------------------------------------------------------------------
1 | import com.nativejavafx.taskbar.TaskbarProgressbar;
2 | import com.nativejavafx.taskbar.TaskbarProgressbarFactory;
3 | import javafx.application.Application;
4 | import javafx.beans.property.ObjectProperty;
5 | import javafx.beans.property.SimpleObjectProperty;
6 | import javafx.geometry.Insets;
7 | import javafx.scene.Scene;
8 | import javafx.scene.control.Button;
9 | import javafx.scene.control.RadioButton;
10 | import javafx.scene.control.Slider;
11 | import javafx.scene.control.ToggleGroup;
12 | import javafx.scene.layout.VBox;
13 | import javafx.stage.Stage;
14 |
15 | public class DemoWStaticMethods extends Application {
16 |
17 | private Stage stage;
18 | private final ObjectProperty A clean and easy way to implement this amazing native Windows taskbar-progressbar functionality in javaFX
29 | * Can be used by instantiation and by static methods as well.
30 | */
31 | public abstract class TaskbarProgressbar {
32 |
33 | /**
34 | * Defines the types of the taskbar progressbars
35 | * that can be used on a Windows 7+ system.
36 | */
37 | public enum Type {
38 | ERROR(ITaskbarList3.TbpFlag.TBPF_ERROR),
39 | INDETERMINATE(ITaskbarList3.TbpFlag.TBPF_INDETERMINATE),
40 | NO_PROGRESS(ITaskbarList3.TbpFlag.TBPF_NOPROGRESS),
41 | NORMAL(ITaskbarList3.TbpFlag.TBPF_NORMAL),
42 | PAUSED(ITaskbarList3.TbpFlag.TBPF_PAUSED);
43 |
44 | private final ITaskbarList3.TbpFlag bridjPair;
45 |
46 | Type(ITaskbarList3.TbpFlag bridjPair) {
47 | this.bridjPair = bridjPair;
48 | }
49 |
50 | public ITaskbarList3.TbpFlag getBridjPair() {
51 | return this.bridjPair;
52 | }
53 | }
54 |
55 | /**
56 | * A {@link TaskbarProgressbar} object-cache that used
57 | * for static operations.
58 | */
59 | private static TaskbarProgressbar cache;
60 |
61 |
62 | protected TaskbarProgressbar() {
63 | }
64 |
65 | /**
66 | * Stops the progress on the taskbar
67 | */
68 | public abstract void stopProgress();
69 |
70 | /**
71 | * Shows an indeterminate progress on the taskbar
72 | */
73 | public abstract void showIndeterminateProgress();
74 |
75 | /**
76 | * Shows a custom progress on the taskbar
77 | *
78 | * @param done the done value of the max value
79 | * @param max the max "100%" value
80 | * @param type the type of the progress; mustn't be null
81 | * @throws NullPointerException if the type is null
82 | */
83 | public abstract void showCustomProgress(long done, long max, @NotNull Type type);
84 |
85 | /**
86 | * Shows custom progress on the taskbar
87 | *
88 | * @param progress A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%.
89 | * @param type the type of the progress; mustn't be null
90 | * @throws NullPointerException if type is null
91 | * @throws IllegalArgumentException if progress is less than 0
92 | */
93 | public void showCustomProgress(double progress, @NotNull Type type) {
94 | if (progress < 0) throw new IllegalArgumentException("Progress can't be less than 0!");
95 | showCustomProgress((long) Math.min(progress * 100, 100), 100, type);
96 | }
97 |
98 | /**
99 | * Sets the type of the progress
100 | *
101 | * @param type the type; mustn't be null
102 | * @throws NullPointerException if type is null
103 | */
104 | public abstract void setProgressType(@NotNull Type type);
105 |
106 | /**
107 | * Shows a 100% error progress
108 | */
109 | public void showFullErrorProgress() {
110 | this.showCustomProgress(100, 100, Type.ERROR);
111 | }
112 |
113 | /**
114 | * Shows a 100% paused progress
115 | */
116 | public void showFullPausedProgress() {
117 | this.showCustomProgress(100, 100, Type.PAUSED);
118 | }
119 |
120 | /**
121 | * Shows a 100% normal progress
122 | */
123 | public void showFullNormalProgress() {
124 | this.showCustomProgress(100, 100, Type.NORMAL);
125 | }
126 |
127 | /**
128 | * Closes all background-thread tasks
129 | */
130 | public abstract void closeOperations();
131 |
132 | private synchronized static void createCache() {
133 | if (cache == null) cache = TaskbarProgressbarFactory.getTaskbarProgressbarImpl(null);
134 | }
135 |
136 | private synchronized static TaskbarProgressbarImpl getTaskbarProgressbarImpl(@NotNull Stage stage) {
137 | Objects.requireNonNull(stage);
138 | createCache();
139 | TaskbarProgressbarImpl impl = (TaskbarProgressbarImpl) cache;
140 | impl.setStage(stage);
141 | return impl;
142 | }
143 |
144 | /**
145 | * Stops the taskbar-progress on the given stage.
146 | *
147 | * @param stage the javaFX stage to stop the progress on; mustn't be null
148 | * @throws NullPointerException if the stage is null
149 | */
150 | public static void stopProgress(@NotNull Stage stage) {
151 | getTaskbarProgressbarImpl(stage).stopProgress();
152 | }
153 |
154 | /**
155 | * Shows an indeterminate taskbar-progress on the given stage.
156 | *
157 | * @param stage the javaFX stage to show the progress on; mustn't be null
158 | * @throws NullPointerException if the stage is null
159 | */
160 | public static void showIndeterminateProgress(@NotNull Stage stage) {
161 | getTaskbarProgressbarImpl(stage).showIndeterminateProgress();
162 | }
163 |
164 | /**
165 | * Shows a custom progress on the taskbar.
166 | *
167 | * @param stage the javaFX stage to show the progress on; mustn't be null
168 | * @param done specifies the actual "done" value of the max value
169 | * @param max specifies the max, 100% value of the loading
170 | * @param type the type of the progress; mustn't be null
171 | * @throws NullPointerException if the stage or the type is null
172 | */
173 | public static void showCustomProgress(@NotNull Stage stage, long done, long max, @NotNull Type type) {
174 | getTaskbarProgressbarImpl(stage).showCustomProgress(done, max, type);
175 | }
176 |
177 | /**
178 | * Shows a custom progress on the taskbar.
179 | *
180 | * @param stage the javaFX stage to show the progress on; mustn't be null
181 | * @param progress A positive value between 0 and 1 indicates the percentage of progress where 0 is 0% and 1 is 100%.
182 | * @param type the type of the progress; mustn't be null
183 | * @throws NullPointerException if the stage or the type is null
184 | */
185 | public static void showCustomProgress(@NotNull Stage stage, double progress, @NotNull Type type) {
186 | getTaskbarProgressbarImpl(stage).showCustomProgress(progress, type);
187 | }
188 |
189 | /**
190 | * Sets the type of the progress on the given stage.
191 | *
192 | * @param type the type; mustn't be null
193 | * @throws NullPointerException if type is null
194 | */
195 | public static void setProgressType(@NotNull Stage stage, @NotNull Type type) {
196 | getTaskbarProgressbarImpl(stage).setProgressType(type);
197 | }
198 |
199 | /**
200 | * Shows a full error progress on the taskbar.
201 | *
202 | * @param stage the javaFX stage to show the progress on; mustn't be null
203 | */
204 | public static void showFullErrorProgress(@NotNull Stage stage) {
205 | showCustomProgress(stage, 100, 100, Type.ERROR);
206 | }
207 |
208 | /**
209 | * Shows a full paused progress on the taskbar.
210 | *
211 | * @param stage the javaFX stage to show the progress on; mustn't be null
212 | */
213 | public static void showFullPausedProgress(@NotNull Stage stage) {
214 | showCustomProgress(stage, 100, 100, Type.PAUSED);
215 | }
216 |
217 | /**
218 | * Shows a full normal progress on the taskbar.
219 | *
220 | * @param stage the javaFX stage to show the progress on; mustn't be null
221 | */
222 | public static void showFullNormalProgress(@NotNull Stage stage) {
223 | showCustomProgress(stage, 100, 100, Type.NORMAL);
224 | }
225 |
226 | /**
227 | * Checks that the current system is supported or not.
228 | *
229 | *
14 | 
15 | This is very useful because you don't have to open the window to see the progress!
16 | The problem is that javaFX doesn't provide this functionality by default... however you
17 | can easily implement it with this library!
18 |
19 | ## Compatibility
20 | This library has support for java 8 and java 11 too.
21 | The 'v11.x' versions are for java11 users and the 'v8.x' versions are for java 8 users.
22 |
23 | ### Using with java 11
24 | If you use java 11 you have to pass this VM argument: `--add-exports javafx.graphics/com.sun.glass.ui=nativejavafx.taskbar`.
25 | Also, you have to mention the `nativejavafx.taskbar` module in your `module-info.java` file:
26 | ```java
27 | module YourModule {
28 | ...
29 | requires nativejavafx.taskbar;
30 | }
31 | ```
32 |
33 | ## How to include it to your project
34 |
35 | ### Maven example:
36 |
37 | Add JitPack.io to your repositories :
38 | ```xml
39 |
82 | * `NORMAL` - a progressbar with normal green color
83 | * `PAUSED` - a progressbar with a yellow color
84 | * `ERROR` - a progressbar with a red color
85 | * `INDETERMINATE` - a progressbar that doesn't show any fix progress
86 | * `NO_PROGRESS` - a progressbar that doesn't show anything
87 |
88 | All these types are represented by the enum called `com.nativejavafx.taskbar.TaskbarProgressbar.Type`.
89 |
90 | Now let's see how can we actually use this through code.
91 | There are multiple ways to create taskbar progressbars with this library:
92 |
93 | #### 1.Through static methods:
94 | Firstly you have to import the necessary class:
95 | ```java
96 | import com.nativejavafx.taskbar.TaskbarProgressbar;
97 | ```
98 | ...and you have to show the javafx Stage before any operation:
99 | ```
100 | primaryStage.show();
101 | ```
102 | Then call the static method:
103 | ```java
104 | TaskbarProgressbar.showCustomProgress(primaryStage, 0.5, TaskbarProgressbar.Type.NORMAL);
105 | ```
106 |
107 | Well, the code above looks okay, but it's not safe. This functionality isn't supported by every OS.
108 | For example on a Linux system it will definitely throw an `UnsupportedSystemException` because it's only available on Windows 7+
109 | systems.
110 | If you use static methods to create taskbar-progressbars you always have to check that the current OS
111 | supports this functionality!
112 |
113 | So let's correct the code:
114 | ```java
115 | if (TaskbarProgressbar.isSupported()) {
116 | TaskbarProgressbar.showCustomProgress(primaryStage, 0.5, TaskbarProgressbar.Type.NORMAL);
117 | }
118 | ```
119 | ...now it is safe!
120 |
121 | Result:
122 | 
123 |
124 | You have to do a similar thing if you want to show an indeterminate progress:
125 | ```java
126 | if (TaskbarProgressbar.isSupported()) {
127 | TaskbarProgressbar.showIndeterminateProgress(primaryStage);
128 | }
129 | ```
130 | Result:
131 | 
132 |
133 | To stop the progress:
134 | ```java
135 | TaskbarProgressbar.stopProgress(primaryStage);
136 | ```
137 | #### 2. Through instantiation *(the recommended way)*
138 | Firstly (after you imported the necessary class) create a `TaskbarProgressbar` instance with the help of
139 | `TaskbarProgressbarFactory`:
140 | ```java
141 | TaskbarProgressbar progressbar = TaskbarProgressbarFactory.getTaskbarProgressbar(primaryStage);
142 | ```
143 | Before any operation you have to show the Stage:
144 | ```java
145 | primaryStage.show();
146 | ```
147 | After that just use the created instance for the operations:
148 | ```java
149 | progressbar.showCustomProgress(0.5, TaskbarProgressbar.Type.NORMAL);
150 | ```
151 | Note: in this case to check that the OS supports this functionality is unnecessary
152 | because the object checks it automatically!
153 |
154 | The result is the same:
155 | 
156 |
157 | If you want an indeterminate process:
158 | ```java
159 | progressbar.showIndeterminateProgress();
160 | ```
161 | To stop the progress:
162 | ```java
163 | progressbar.stopProgress();
164 | ```
165 |
166 | #### Bonus features
167 |
168 | A simple method for showing a fully loaded error progressbar
169 | ```java
170 | progressbar.showFullErrorProgress();
171 | //equivalent to progressbar.showCustomProgress(100, 100, TaskbarProgressbar.Type.ERROR)
172 | ```
173 | Result:
174 | 
175 |
176 | Also:
177 | ```java
178 | progressbar.showFullNormalProgress();
179 | ```
180 |
181 | ```java
182 | progressbar.showFullPausedProgress();
183 | ```
184 |
185 | ## More screenshots
186 | Some more screenshots about what can you do with this library
187 | * A paused progress example:
188 | Code: `progressbar.showCustomProgress(0.7, TaskbarProgressbar.Type.PAUSED);`
189 | 
190 | * An error progress example:
191 | Code: `progressbar.showCustomProgress(0.4, TaskbarProgressbar.Type.ERROR);`
192 | 
193 |
194 | ## Full demo
195 | A full demo-example class is available [here](src/test/java/Demo.java).
196 |
197 | ## Source code
198 | This project has two important branches:
199 | * "master" - for java 8 builds
200 | * "11" - for java 11 builds
201 |
202 | ## Used libraries
203 | * [bridj](https://github.com/nativelibs4java/BridJ) - blazing fast Java / C / C++ interop
204 | * [SLF4J](http://www.slf4j.org/) - Simple Logging Facade for Java
205 | * [Jetbrains Annotations](https://github.com/JetBrains/java-annotations) - Annotations for JVM-based languages
206 |
207 | ## Support
208 | If you like this library give it a star!
209 |
--------------------------------------------------------------------------------
/src/main/java/com/nativejavafx/taskbar/TaskbarProgressbar.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed under the Apache License, Version 2.0 (the "License");
3 | * you may not use this file except in compliance with the License.
4 | * You may obtain a copy of the License at
5 | *
6 | * http://www.apache.org/licenses/LICENSE-2.0
7 | *
8 | * Unless required by applicable law or agreed to in writing, software
9 | * distributed under the License is distributed on an "AS IS" BASIS,
10 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 | * See the License for the specific language governing permissions and
12 | * limitations under the License.
13 | */
14 |
15 | package com.nativejavafx.taskbar;
16 |
17 | import com.nativejavafx.taskbar.util.OS;
18 | import javafx.stage.Stage;
19 | import org.bridj.cpp.com.shell.ITaskbarList3;
20 | import org.jetbrains.annotations.NotNull;
21 |
22 | import java.util.Objects;
23 |
24 | /**
25 | * A TaskbarProgressbar object can add native (Windows 7+) taskbar
26 | * progressbar functionality to {@link Stage} objects.
27 | *
28 | *
230 | * Actually checks that the OS is Windows and the Windows version
231 | * is greater than Windows 7:
232 | * the taskbar progressbar functionality is working since Windows 7
233 | *
234 | * @return true if the OS is supported for taskbar progressbar functionality
235 | * false otherwise.
236 | */
237 | public static boolean isSupported() {
238 | return OS.isWindows7OrLater();
239 | }
240 |
241 |
242 | public static boolean isNotSupported() {
243 | return !isSupported();
244 | }
245 | }
246 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright 2020 Dansoftware
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------