Make, Ant, Maven a Netbeans - různé způsoby sestavení aplikace v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 16 Dec 2023 20:13:13 +0100
branchv_0
changeset 39ec0e970e0830
parent 38 41e91ea94acb
child 40 1978eaf429de
Make, Ant, Maven a Netbeans - různé způsoby sestavení aplikace
.hgignore
Makefile
build.xml
java/rozsirene-atributy/Makefile
java/rozsirene-atributy/build.xml
java/rozsirene-atributy/build2.xml
java/rozsirene-atributy/manifest.mf
java/rozsirene-atributy/nbproject/build-impl.xml
java/rozsirene-atributy/nbproject/genfiles.properties
java/rozsirene-atributy/nbproject/project.properties
java/rozsirene-atributy/nbproject/project.xml
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Atribut.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CLIParser.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CLIParserException.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CSV.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Konfigurace.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady.properties
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady_cs.properties
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady_en.properties
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Startér.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/EditorHodnotAtributů.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/EditorNázvůAtributů.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Model.java
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Panel.form
java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Panel.java
licence/header.txt
nb-configuration.xml
nbactions.xml
pom.xml
rozšířené-atributy.sh
src/main/java/cz/frantovo/rozsireneatributy/Atribut.java
src/main/java/cz/frantovo/rozsireneatributy/CLIParser.java
src/main/java/cz/frantovo/rozsireneatributy/CLIParserException.java
src/main/java/cz/frantovo/rozsireneatributy/CSV.java
src/main/java/cz/frantovo/rozsireneatributy/Konfigurace.java
src/main/java/cz/frantovo/rozsireneatributy/Startér.java
src/main/java/cz/frantovo/rozsireneatributy/gui/EditorHodnotAtributů.java
src/main/java/cz/frantovo/rozsireneatributy/gui/EditorNázvůAtributů.java
src/main/java/cz/frantovo/rozsireneatributy/gui/Model.java
src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.form
src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java
src/main/resources/cz/frantovo/rozsireneatributy/Překlady.properties
src/main/resources/cz/frantovo/rozsireneatributy/Překlady_cs.properties
src/main/resources/cz/frantovo/rozsireneatributy/Překlady_en.properties
     1.1 --- a/.hgignore	Sat Dec 16 19:09:35 2023 +0100
     1.2 +++ b/.hgignore	Sat Dec 16 20:13:13 2023 +0100
     1.3 @@ -1,7 +1,12 @@
     1.4 -java/rozsirene-atributy/dist/*
     1.5 -java/rozsirene-atributy/build/*
     1.6 -java/rozsirene-atributy/nbproject/private/*
     1.7 +syntax: glob
     1.8  
     1.9 -java/rozsirene-atributy-jedit/dist/*
    1.10 -java/rozsirene-atributy-jedit/build/*
    1.11 -java/rozsirene-atributy-jedit/nbproject/private/*
    1.12 +*~
    1.13 +*.class
    1.14 +*.so
    1.15 +*.o
    1.16 +
    1.17 +syntax: regexp
    1.18 +
    1.19 +^temp/
    1.20 +
    1.21 +^target/
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/Makefile	Sat Dec 16 20:13:13 2023 +0100
     2.3 @@ -0,0 +1,45 @@
     2.4 +# Rozšířené atributy – program na správu rozšířených atributů souborů
     2.5 +# Copyright © 2023 František Kučera (Frantovo.cz)
     2.6 +#
     2.7 +# This program is free software: you can redistribute it and/or modify
     2.8 +# it under the terms of the GNU General Public License as published by
     2.9 +# the Free Software Foundation, version 3 of the License.
    2.10 +#
    2.11 +# This program is distributed in the hope that it will be useful,
    2.12 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.13 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    2.14 +# GNU General Public License for more details.
    2.15 +#
    2.16 +# You should have received a copy of the GNU General Public License
    2.17 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
    2.18 +
    2.19 +SRC=$(shell find src -name '*.java')
    2.20 +MAIN=cz.frantovo.rozsireneatributy.Startér
    2.21 +LAF=-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
    2.22 +VERSION=0.1-SNAPSHOT
    2.23 +JAR=target/rozsirene-atributy-$(VERSION).jar
    2.24 +
    2.25 +all: $(JAR)
    2.26 +
    2.27 +.PHONY: all clean run run-binfmt
    2.28 +
    2.29 +clean:
    2.30 +	rm -rf target
    2.31 +
    2.32 +target/classes: $(SRC)
    2.33 +	mkdir -p target/classes
    2.34 +	touch    target/classes
    2.35 +	javac -d target/classes $(SRC)
    2.36 +	cp \
    2.37 +		src/main/resources/cz/frantovo/rozsireneatributy/*.properties \
    2.38 +		target/classes/cz/frantovo/rozsireneatributy/
    2.39 +
    2.40 +$(JAR): target/classes
    2.41 +	jar --create --file $(@) --main-class $(MAIN) -C target/classes .
    2.42 +	chmod +x $(@)
    2.43 +
    2.44 +run: $(JAR)
    2.45 +	java $(LAF) -jar $(<) --soubor $(<)
    2.46 +
    2.47 +run-binfmt: $(JAR)
    2.48 +	$(<) --soubor $(<)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/build.xml	Sat Dec 16 20:13:13 2023 +0100
     3.3 @@ -0,0 +1,65 @@
     3.4 +<?xml version="1.0" encoding="UTF-8"?>
     3.5 +<!--
     3.6 +Rozšířené atributy – program na správu rozšířených atributů souborů
     3.7 +Copyright © 2023 František Kučera (frantovo.cz)
     3.8 +
     3.9 +This program is free software: you can redistribute it and/or modify
    3.10 +it under the terms of the GNU General Public License as published by
    3.11 +the Free Software Foundation, version 3 of the License.
    3.12 +
    3.13 +This program is distributed in the hope that it will be useful,
    3.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.16 +GNU General Public License for more details.
    3.17 +
    3.18 +You should have received a copy of the GNU General Public License
    3.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    3.20 +-->
    3.21 +<project name="rozšířené-atributy" basedir="." default="jar">
    3.22 +
    3.23 +	<property name="VERSION" value="0.1-SNAPSHOT"/>
    3.24 +	<property name="JAR" value="target/rozsirene-atributy-${VERSION}.jar"/>
    3.25 +	<property name="MAIN" value="cz.frantovo.rozsireneatributy.Startér"/>
    3.26 +	<property
    3.27 +		name="LAF"
    3.28 +		value="-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel"
    3.29 +	/>
    3.30 +	
    3.31 +	<target name="clean">
    3.32 +		<delete dir="target"/>
    3.33 +	</target>
    3.34 +	
    3.35 +	<target name="target/classes">
    3.36 +		<mkdir dir="target/classes"/>
    3.37 +		<touch>
    3.38 +			<fileset dir="target"/>
    3.39 +		</touch>
    3.40 +		<javac
    3.41 +			srcdir="src/main/java"
    3.42 +			destdir="target/classes"
    3.43 +			includeAntRuntime="no">
    3.44 +		</javac>
    3.45 +		<copy todir="target/classes">
    3.46 +			<fileset dir="src/main/resources" includes="**/*.properties"/>
    3.47 +		</copy>
    3.48 +	</target>
    3.49 +	
    3.50 +	<target name="jar" depends="target/classes">
    3.51 +		<jar destfile="${JAR}" basedir="target/classes">
    3.52 +			<manifest>
    3.53 +				<attribute name="Main-Class" value="${MAIN}"/>
    3.54 +			</manifest>
    3.55 +		</jar>
    3.56 +	</target>
    3.57 +	
    3.58 +	<target name="run" depends="jar">
    3.59 +		<exec executable="java">
    3.60 +			<arg value="${LAF}"/>
    3.61 +			<arg value="-jar"/>
    3.62 +			<arg value="${JAR}"/>
    3.63 +			<arg value="--soubor"/>
    3.64 +			<arg value="${JAR}"/>
    3.65 +		</exec>
    3.66 +	</target>
    3.67 +
    3.68 +</project>
     4.1 --- a/java/rozsirene-atributy/Makefile	Sat Dec 16 19:09:35 2023 +0100
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,46 +0,0 @@
     4.4 -# Rozšířené atributy – program na správu rozšířených atributů souborů
     4.5 -# Copyright © 2023 František Kučera (Frantovo.cz)
     4.6 -#
     4.7 -# This program is free software: you can redistribute it and/or modify
     4.8 -# it under the terms of the GNU General Public License as published by
     4.9 -# the Free Software Foundation, version 3 of the License.
    4.10 -#
    4.11 -# This program is distributed in the hope that it will be useful,
    4.12 -# but WITHOUT ANY WARRANTY; without even the implied warranty of
    4.13 -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    4.14 -# GNU General Public License for more details.
    4.15 -#
    4.16 -# You should have received a copy of the GNU General Public License
    4.17 -# along with this program. If not, see <http://www.gnu.org/licenses/>.
    4.18 -
    4.19 -all: dist/rozsirene-atributy.jar
    4.20 -
    4.21 -.PHONY: all clean run run-binfmt
    4.22 -
    4.23 -clean:
    4.24 -	rm -rf build
    4.25 -	rm -rf dist
    4.26 -
    4.27 -SRC=$(shell find -name '*.java')
    4.28 -MAIN=cz.frantovo.rozsireneatributy.Startér
    4.29 -LAF=-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel
    4.30 -JAR=dist/rozsirene-atributy.jar
    4.31 -
    4.32 -build: $(SRC)
    4.33 -	mkdir -p build
    4.34 -	touch    build
    4.35 -	javac -d build $(SRC)
    4.36 -	cp \
    4.37 -		src/cz/frantovo/rozsireneatributy/*.properties \
    4.38 -		build/cz/frantovo/rozsireneatributy/
    4.39 -
    4.40 -$(JAR): build
    4.41 -	mkdir -p dist
    4.42 -	jar --create --file $(@) --main-class $(MAIN) -C build .
    4.43 -	chmod +x $(@)
    4.44 -
    4.45 -run: $(JAR)
    4.46 -	java $(LAF) -jar $(<) --soubor $(<)
    4.47 -
    4.48 -run-binfmt: $(JAR)
    4.49 -	$(<) --soubor $(<)
     5.1 --- a/java/rozsirene-atributy/build.xml	Sat Dec 16 19:09:35 2023 +0100
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,73 +0,0 @@
     5.4 -<?xml version="1.0" encoding="UTF-8"?>
     5.5 -<!-- You may freely edit this file. See commented blocks below for -->
     5.6 -<!-- some examples of how to customize the build. -->
     5.7 -<!-- (If you delete it and reopen the project it will be recreated.) -->
     5.8 -<!-- By default, only the Clean and Build commands use this build script. -->
     5.9 -<!-- Commands such as Run, Debug, and Test only use this build script if -->
    5.10 -<!-- the Compile on Save feature is turned off for the project. -->
    5.11 -<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    5.12 -<!-- in the project's Project Properties dialog box.-->
    5.13 -<project name="rozsirene-atributy" default="default" basedir=".">
    5.14 -    <description>Builds, tests, and runs the project rozsirene-atributy.</description>
    5.15 -    <import file="nbproject/build-impl.xml"/>
    5.16 -    <!--
    5.17 -
    5.18 -    There exist several targets which are by default empty and which can be 
    5.19 -    used for execution of your tasks. These targets are usually executed 
    5.20 -    before and after some main targets. They are: 
    5.21 -
    5.22 -      -pre-init:                 called before initialization of project properties
    5.23 -      -post-init:                called after initialization of project properties
    5.24 -      -pre-compile:              called before javac compilation
    5.25 -      -post-compile:             called after javac compilation
    5.26 -      -pre-compile-single:       called before javac compilation of single file
    5.27 -      -post-compile-single:      called after javac compilation of single file
    5.28 -      -pre-compile-test:         called before javac compilation of JUnit tests
    5.29 -      -post-compile-test:        called after javac compilation of JUnit tests
    5.30 -      -pre-compile-test-single:  called before javac compilation of single JUnit test
    5.31 -      -post-compile-test-single: called after javac compilation of single JUunit test
    5.32 -      -pre-jar:                  called before JAR building
    5.33 -      -post-jar:                 called after JAR building
    5.34 -      -post-clean:               called after cleaning build products
    5.35 -
    5.36 -    (Targets beginning with '-' are not intended to be called on their own.)
    5.37 -
    5.38 -    Example of inserting an obfuscator after compilation could look like this:
    5.39 -
    5.40 -        <target name="-post-compile">
    5.41 -            <obfuscate>
    5.42 -                <fileset dir="${build.classes.dir}"/>
    5.43 -            </obfuscate>
    5.44 -        </target>
    5.45 -
    5.46 -    For list of available properties check the imported 
    5.47 -    nbproject/build-impl.xml file. 
    5.48 -
    5.49 -
    5.50 -    Another way to customize the build is by overriding existing main targets.
    5.51 -    The targets of interest are: 
    5.52 -
    5.53 -      -init-macrodef-javac:     defines macro for javac compilation
    5.54 -      -init-macrodef-junit:     defines macro for junit execution
    5.55 -      -init-macrodef-debug:     defines macro for class debugging
    5.56 -      -init-macrodef-java:      defines macro for class execution
    5.57 -      -do-jar:                  JAR building
    5.58 -      run:                      execution of project 
    5.59 -      -javadoc-build:           Javadoc generation
    5.60 -      test-report:              JUnit report generation
    5.61 -
    5.62 -    An example of overriding the target for project execution could look like this:
    5.63 -
    5.64 -        <target name="run" depends="rozsirene-atributy-impl.jar">
    5.65 -            <exec dir="bin" executable="launcher.exe">
    5.66 -                <arg file="${dist.jar}"/>
    5.67 -            </exec>
    5.68 -        </target>
    5.69 -
    5.70 -    Notice that the overridden target depends on the jar target and not only on 
    5.71 -    the compile target as the regular run target does. Again, for a list of available 
    5.72 -    properties which you can use, check the target you are overriding in the
    5.73 -    nbproject/build-impl.xml file. 
    5.74 -
    5.75 -    -->
    5.76 -</project>
     6.1 --- a/java/rozsirene-atributy/build2.xml	Sat Dec 16 19:09:35 2023 +0100
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,69 +0,0 @@
     6.4 -<?xml version="1.0" encoding="UTF-8"?>
     6.5 -<!--
     6.6 -Rozšířené atributy – program na správu rozšířených atributů souborů
     6.7 -Copyright © 2023 František Kučera (frantovo.cz)
     6.8 -
     6.9 -This program is free software: you can redistribute it and/or modify
    6.10 -it under the terms of the GNU General Public License as published by
    6.11 -the Free Software Foundation, version 3 of the License.
    6.12 -
    6.13 -This program is distributed in the hope that it will be useful,
    6.14 -but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    6.16 -GNU General Public License for more details.
    6.17 -
    6.18 -You should have received a copy of the GNU General Public License
    6.19 -along with this program.  If not, see <http://www.gnu.org/licenses/>.
    6.20 --->
    6.21 -<project name="rozšířené-atributy" basedir="." default="jar">
    6.22 -
    6.23 -	<property name="JAR" value="dist/rozsirene-atributy.jar"/>
    6.24 -	<property name="MAIN" value="cz.frantovo.rozsireneatributy.Startér"/>
    6.25 -	<property
    6.26 -		name="LAF"
    6.27 -		value="-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel"
    6.28 -	/>
    6.29 -	
    6.30 -	<target name="clean">
    6.31 -		<delete dir="build"/>
    6.32 -		<delete dir="dist"/>
    6.33 -	</target>
    6.34 -	
    6.35 -	<target name="build">
    6.36 -		<mkdir dir="build"/>
    6.37 -		<touch>
    6.38 -			<fileset dir="build"/>
    6.39 -		</touch>
    6.40 -		<javac
    6.41 -			srcdir="src"
    6.42 -			destdir="build"
    6.43 -			includeAntRuntime="no">
    6.44 -		</javac>
    6.45 -		<copy todir="build">
    6.46 -			<fileset dir="src" includes="**/*.properties"/>
    6.47 -		</copy>
    6.48 -	</target>
    6.49 -	
    6.50 -	<target name="jar" depends="build">
    6.51 -		<mkdir dir="dist"/>
    6.52 -		<touch>
    6.53 -			<fileset dir="dist"/>
    6.54 -		</touch>
    6.55 -		<jar destfile="${JAR}" basedir="build">
    6.56 -			<manifest>
    6.57 -				<attribute name="Main-Class" value="${MAIN}"/>
    6.58 -			</manifest>
    6.59 -		</jar>
    6.60 -	</target>
    6.61 -	
    6.62 -	<target name="run" depends="jar">
    6.63 -		<exec executable="java">
    6.64 -			<arg value="${LAF}"/>
    6.65 -			<arg value="-jar"/>
    6.66 -			<arg value="${JAR}"/>
    6.67 -			<arg value="--soubor"/>
    6.68 -			<arg value="${JAR}"/>
    6.69 -		</exec>
    6.70 -	</target>
    6.71 -
    6.72 -</project>
     7.1 --- a/java/rozsirene-atributy/manifest.mf	Sat Dec 16 19:09:35 2023 +0100
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,3 +0,0 @@
     7.4 -Manifest-Version: 1.0
     7.5 -X-COMMENT: Main-Class will be added automatically by build
     7.6 -
     8.1 --- a/java/rozsirene-atributy/nbproject/build-impl.xml	Sat Dec 16 19:09:35 2023 +0100
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,1771 +0,0 @@
     8.4 -<?xml version="1.0" encoding="UTF-8"?>
     8.5 -<!--
     8.6 -*** GENERATED FROM project.xml - DO NOT EDIT  ***
     8.7 -***         EDIT ../build.xml INSTEAD         ***
     8.8 -
     8.9 -For the purpose of easier reading the script
    8.10 -is divided into following sections:
    8.11 -
    8.12 -  - initialization
    8.13 -  - compilation
    8.14 -  - jar
    8.15 -  - execution
    8.16 -  - debugging
    8.17 -  - javadoc
    8.18 -  - test compilation
    8.19 -  - test execution
    8.20 -  - test debugging
    8.21 -  - applet
    8.22 -  - cleanup
    8.23 -
    8.24 -        -->
    8.25 -<project xmlns:if="ant:if" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1" xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:jaxrpc="http://www.netbeans.org/ns/j2se-project/jax-rpc" xmlns:unless="ant:unless" basedir=".." default="default" name="rozsirene-atributy-impl">
    8.26 -    <fail message="Please build using Ant 1.8.0 or higher.">
    8.27 -        <condition>
    8.28 -            <not>
    8.29 -                <antversion atleast="1.8.0"/>
    8.30 -            </not>
    8.31 -        </condition>
    8.32 -    </fail>
    8.33 -    <target depends="test,jar,javadoc" description="Build and test whole project." name="default"/>
    8.34 -    <!-- 
    8.35 -                ======================
    8.36 -                INITIALIZATION SECTION 
    8.37 -                ======================
    8.38 -            -->
    8.39 -    <target name="-pre-init">
    8.40 -        <!-- Empty placeholder for easier customization. -->
    8.41 -        <!-- You can override this target in the ../build.xml file. -->
    8.42 -    </target>
    8.43 -    <target depends="-pre-init" name="-init-private">
    8.44 -        <property file="nbproject/private/config.properties"/>
    8.45 -        <property file="nbproject/private/configs/${config}.properties"/>
    8.46 -        <property file="nbproject/private/private.properties"/>
    8.47 -    </target>
    8.48 -    <target depends="-pre-init,-init-private" name="-init-user">
    8.49 -        <property file="${user.properties.file}"/>
    8.50 -        <!-- The two properties below are usually overridden -->
    8.51 -        <!-- by the active platform. Just a fallback. -->
    8.52 -        <property name="default.javac.source" value="1.8"/>
    8.53 -        <property name="default.javac.target" value="1.8"/>
    8.54 -    </target>
    8.55 -    <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    8.56 -        <property file="nbproject/configs/${config}.properties"/>
    8.57 -        <property file="nbproject/project.properties"/>
    8.58 -    </target>
    8.59 -    <target name="-init-modules-supported">
    8.60 -        <condition property="modules.supported.internal" value="true">
    8.61 -            <not>
    8.62 -                <matches pattern="1\.[0-8](\..*)?" string="${javac.source}"/>
    8.63 -            </not>
    8.64 -        </condition>
    8.65 -    </target>
    8.66 -    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-modulename">
    8.67 -        <macrodef name="modulename" uri="http://www.netbeans.org/ns/j2se-project/3">
    8.68 -            <attribute name="property"/>
    8.69 -            <attribute name="sourcepath"/>
    8.70 -            <sequential>
    8.71 -                <loadresource property="@{property}" quiet="true">
    8.72 -                    <javaresource classpath="@{sourcepath}" name="module-info.java" parentFirst="false"/>
    8.73 -                    <filterchain>
    8.74 -                        <stripjavacomments/>
    8.75 -                        <linecontainsregexp>
    8.76 -                            <regexp pattern="module .* \{"/>
    8.77 -                        </linecontainsregexp>
    8.78 -                        <tokenfilter>
    8.79 -                            <linetokenizer/>
    8.80 -                            <replaceregex flags="s" pattern="(\s*module\s+)(\S*)(\s*\{.*)" replace="\2"/>
    8.81 -                        </tokenfilter>
    8.82 -                        <striplinebreaks/>
    8.83 -                    </filterchain>
    8.84 -                </loadresource>
    8.85 -            </sequential>
    8.86 -        </macrodef>
    8.87 -    </target>
    8.88 -    <target depends="-init-modules-supported,-init-macrodef-modulename" if="modules.supported.internal" name="-init-source-module-properties">
    8.89 -        <fail message="Java 9 support requires Ant 1.10.0 or higher.">
    8.90 -            <condition>
    8.91 -                <not>
    8.92 -                    <antversion atleast="1.10.0"/>
    8.93 -                </not>
    8.94 -            </condition>
    8.95 -        </fail>
    8.96 -        <j2seproject3:modulename property="module.name" sourcepath="${src.dir}"/>
    8.97 -        <condition property="named.module.internal">
    8.98 -            <and>
    8.99 -                <isset property="module.name"/>
   8.100 -                <length length="0" string="${module.name}" when="greater"/>
   8.101 -            </and>
   8.102 -        </condition>
   8.103 -        <condition property="unnamed.module.internal">
   8.104 -            <not>
   8.105 -                <isset property="named.module.internal"/>
   8.106 -            </not>
   8.107 -        </condition>
   8.108 -        <property name="javac.modulepath" value=""/>
   8.109 -        <property name="run.modulepath" value="${javac.modulepath}"/>
   8.110 -        <property name="module.build.classes.dir" value="${build.classes.dir}"/>
   8.111 -        <property name="debug.modulepath" value="${run.modulepath}"/>
   8.112 -        <property name="javac.upgrademodulepath" value=""/>
   8.113 -        <property name="run.upgrademodulepath" value="${javac.upgrademodulepath}"/>
   8.114 -        <condition else="" property="javac.systemmodulepath.cmd.line.arg" value="--system '${javac.systemmodulepath}'">
   8.115 -            <and>
   8.116 -                <isset property="javac.systemmodulepath"/>
   8.117 -                <length length="0" string="${javac.systemmodulepath}" when="greater"/>
   8.118 -            </and>
   8.119 -        </condition>
   8.120 -        <property name="dist.jlink.dir" value="${dist.dir}/jlink"/>
   8.121 -        <property name="dist.jlink.output" value="${dist.jlink.dir}/${application.title}"/>
   8.122 -        <property name="module.name" value=""/>
   8.123 -    </target>
   8.124 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-init-modules-supported" name="-do-init">
   8.125 -        <property name="platform.java" value="${java.home}/bin/java"/>
   8.126 -        <available file="${manifest.file}" property="manifest.available"/>
   8.127 -        <condition property="splashscreen.available">
   8.128 -            <and>
   8.129 -                <not>
   8.130 -                    <equals arg1="${application.splash}" arg2="" trim="true"/>
   8.131 -                </not>
   8.132 -                <available file="${application.splash}"/>
   8.133 -            </and>
   8.134 -        </condition>
   8.135 -        <condition property="main.class.available">
   8.136 -            <and>
   8.137 -                <isset property="main.class"/>
   8.138 -                <not>
   8.139 -                    <equals arg1="${main.class}" arg2="" trim="true"/>
   8.140 -                </not>
   8.141 -            </and>
   8.142 -        </condition>
   8.143 -        <condition property="profile.available">
   8.144 -            <and>
   8.145 -                <isset property="javac.profile"/>
   8.146 -                <length length="0" string="${javac.profile}" when="greater"/>
   8.147 -                <not>
   8.148 -                    <matches pattern="1\.[0-7](\..*)?" string="${javac.source}"/>
   8.149 -                </not>
   8.150 -            </and>
   8.151 -        </condition>
   8.152 -        <condition property="do.archive">
   8.153 -            <or>
   8.154 -                <not>
   8.155 -                    <istrue value="${jar.archive.disabled}"/>
   8.156 -                </not>
   8.157 -                <istrue value="${not.archive.disabled}"/>
   8.158 -            </or>
   8.159 -        </condition>
   8.160 -        <condition property="do.archive+manifest.available">
   8.161 -            <and>
   8.162 -                <isset property="manifest.available"/>
   8.163 -                <istrue value="${do.archive}"/>
   8.164 -            </and>
   8.165 -        </condition>
   8.166 -        <condition property="do.archive+main.class.available">
   8.167 -            <and>
   8.168 -                <isset property="main.class.available"/>
   8.169 -                <istrue value="${do.archive}"/>
   8.170 -            </and>
   8.171 -        </condition>
   8.172 -        <condition property="do.archive+splashscreen.available">
   8.173 -            <and>
   8.174 -                <isset property="splashscreen.available"/>
   8.175 -                <istrue value="${do.archive}"/>
   8.176 -            </and>
   8.177 -        </condition>
   8.178 -        <condition property="do.archive+profile.available">
   8.179 -            <and>
   8.180 -                <isset property="profile.available"/>
   8.181 -                <istrue value="${do.archive}"/>
   8.182 -            </and>
   8.183 -        </condition>
   8.184 -        <condition property="have.tests">
   8.185 -            <or>
   8.186 -                <available file="${test.src.dir}"/>
   8.187 -            </or>
   8.188 -        </condition>
   8.189 -        <condition property="have.sources">
   8.190 -            <or>
   8.191 -                <available file="${src.dir}"/>
   8.192 -            </or>
   8.193 -        </condition>
   8.194 -        <condition property="netbeans.home+have.tests">
   8.195 -            <and>
   8.196 -                <isset property="netbeans.home"/>
   8.197 -                <isset property="have.tests"/>
   8.198 -            </and>
   8.199 -        </condition>
   8.200 -        <condition property="no.javadoc.preview">
   8.201 -            <and>
   8.202 -                <isset property="javadoc.preview"/>
   8.203 -                <isfalse value="${javadoc.preview}"/>
   8.204 -            </and>
   8.205 -        </condition>
   8.206 -        <property name="run.jvmargs" value=""/>
   8.207 -        <property name="run.jvmargs.ide" value=""/>
   8.208 -        <property name="javac.compilerargs" value=""/>
   8.209 -        <property name="work.dir" value="${basedir}"/>
   8.210 -        <condition property="no.deps">
   8.211 -            <and>
   8.212 -                <istrue value="${no.dependencies}"/>
   8.213 -            </and>
   8.214 -        </condition>
   8.215 -        <property name="javac.debug" value="true"/>
   8.216 -        <property name="javadoc.preview" value="true"/>
   8.217 -        <property name="application.args" value=""/>
   8.218 -        <property name="source.encoding" value="${file.encoding}"/>
   8.219 -        <property name="runtime.encoding" value="${source.encoding}"/>
   8.220 -        <property name="manifest.encoding" value="${source.encoding}"/>
   8.221 -        <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
   8.222 -            <and>
   8.223 -                <isset property="javadoc.encoding"/>
   8.224 -                <not>
   8.225 -                    <equals arg1="${javadoc.encoding}" arg2=""/>
   8.226 -                </not>
   8.227 -            </and>
   8.228 -        </condition>
   8.229 -        <property name="javadoc.encoding.used" value="${source.encoding}"/>
   8.230 -        <property name="includes" value="**"/>
   8.231 -        <property name="excludes" value=""/>
   8.232 -        <property name="do.depend" value="false"/>
   8.233 -        <condition property="do.depend.true">
   8.234 -            <istrue value="${do.depend}"/>
   8.235 -        </condition>
   8.236 -        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   8.237 -        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   8.238 -            <and>
   8.239 -                <isset property="endorsed.classpath"/>
   8.240 -                <not>
   8.241 -                    <equals arg1="${endorsed.classpath}" arg2="" trim="true"/>
   8.242 -                </not>
   8.243 -            </and>
   8.244 -        </condition>
   8.245 -        <condition else="" property="javac.profile.cmd.line.arg" value="-profile ${javac.profile}">
   8.246 -            <isset property="profile.available"/>
   8.247 -        </condition>
   8.248 -        <condition else="false" property="jdkBug6558476">
   8.249 -            <and>
   8.250 -                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   8.251 -                <not>
   8.252 -                    <os family="unix"/>
   8.253 -                </not>
   8.254 -            </and>
   8.255 -        </condition>
   8.256 -        <condition else="false" property="javac.fork">
   8.257 -            <or>
   8.258 -                <istrue value="${jdkBug6558476}"/>
   8.259 -                <istrue value="${javac.external.vm}"/>
   8.260 -            </or>
   8.261 -        </condition>
   8.262 -        <property name="jar.index" value="false"/>
   8.263 -        <property name="jar.index.metainf" value="${jar.index}"/>
   8.264 -        <property name="copylibs.rebase" value="true"/>
   8.265 -        <available file="${meta.inf.dir}/persistence.xml" property="has.persistence.xml"/>
   8.266 -        <condition property="junit.available">
   8.267 -            <or>
   8.268 -                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   8.269 -                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   8.270 -            </or>
   8.271 -        </condition>
   8.272 -        <condition property="testng.available">
   8.273 -            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   8.274 -        </condition>
   8.275 -        <condition property="junit+testng.available">
   8.276 -            <and>
   8.277 -                <istrue value="${junit.available}"/>
   8.278 -                <istrue value="${testng.available}"/>
   8.279 -            </and>
   8.280 -        </condition>
   8.281 -        <condition else="testng" property="testng.mode" value="mixed">
   8.282 -            <istrue value="${junit+testng.available}"/>
   8.283 -        </condition>
   8.284 -        <condition else="" property="testng.debug.mode" value="-mixed">
   8.285 -            <istrue value="${junit+testng.available}"/>
   8.286 -        </condition>
   8.287 -        <property name="java.failonerror" value="true"/>
   8.288 -    </target>
   8.289 -    <target name="-post-init">
   8.290 -        <!-- Empty placeholder for easier customization. -->
   8.291 -        <!-- You can override this target in the ../build.xml file. -->
   8.292 -    </target>
   8.293 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init" name="-init-check">
   8.294 -        <fail unless="src.dir">Must set src.dir</fail>
   8.295 -        <fail unless="test.src.dir">Must set test.src.dir</fail>
   8.296 -        <fail unless="build.dir">Must set build.dir</fail>
   8.297 -        <fail unless="dist.dir">Must set dist.dir</fail>
   8.298 -        <fail unless="build.classes.dir">Must set build.classes.dir</fail>
   8.299 -        <fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
   8.300 -        <fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
   8.301 -        <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   8.302 -        <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   8.303 -        <fail unless="dist.jar">Must set dist.jar</fail>
   8.304 -    </target>
   8.305 -    <target name="-init-macrodef-property">
   8.306 -        <macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.307 -            <attribute name="name"/>
   8.308 -            <attribute name="value"/>
   8.309 -            <sequential>
   8.310 -                <property name="@{name}" value="${@{value}}"/>
   8.311 -            </sequential>
   8.312 -        </macrodef>
   8.313 -    </target>
   8.314 -    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="modules.supported.internal" name="-init-macrodef-javac-with-module">
   8.315 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.316 -            <attribute default="${src.dir}" name="srcdir"/>
   8.317 -            <attribute default="${build.classes.dir}" name="destdir"/>
   8.318 -            <attribute default="${javac.classpath}" name="classpath"/>
   8.319 -            <attribute default="${javac.modulepath}" name="modulepath"/>
   8.320 -            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   8.321 -            <attribute default="${javac.processorpath}" name="processorpath"/>
   8.322 -            <attribute default="${javac.processormodulepath}" name="processormodulepath"/>
   8.323 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   8.324 -            <attribute default="${includes}" name="includes"/>
   8.325 -            <attribute default="${excludes}" name="excludes"/>
   8.326 -            <attribute default="${javac.debug}" name="debug"/>
   8.327 -            <attribute default="${empty.dir}" name="sourcepath" unless:set="named.module.internal"/>
   8.328 -            <attribute default="${src.dir}" if:set="named.module.internal" name="sourcepath"/>
   8.329 -            <attribute default="${empty.dir}" name="gensrcdir"/>
   8.330 -            <element name="customize" optional="true"/>
   8.331 -            <sequential>
   8.332 -                <condition property="warn.excludes.internal">
   8.333 -                    <and>
   8.334 -                        <isset property="named.module.internal"/>
   8.335 -                        <length length="0" string="@{excludes}" trim="true" when="greater"/>
   8.336 -                    </and>
   8.337 -                </condition>
   8.338 -                <echo if:set="warn.excludes.internal" level="warning" message="The javac excludes are not supported in the JDK 9 Named Module."/>
   8.339 -                <property location="${build.dir}/empty" name="empty.dir"/>
   8.340 -                <mkdir dir="${empty.dir}"/>
   8.341 -                <mkdir dir="@{apgeneratedsrcdir}"/>
   8.342 -                <condition property="processormodulepath.set">
   8.343 -                    <resourcecount count="0" when="greater">
   8.344 -                        <path>
   8.345 -                            <pathelement path="@{processormodulepath}"/>
   8.346 -                        </path>
   8.347 -                    </resourcecount>
   8.348 -                </condition>
   8.349 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   8.350 -                    <src>
   8.351 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   8.352 -                            <include name="*"/>
   8.353 -                        </dirset>
   8.354 -                    </src>
   8.355 -                    <classpath>
   8.356 -                        <path path="@{classpath}"/>
   8.357 -                    </classpath>
   8.358 -                    <modulepath>
   8.359 -                        <path path="@{modulepath}"/>
   8.360 -                    </modulepath>
   8.361 -                    <upgrademodulepath>
   8.362 -                        <path path="@{upgrademodulepath}"/>
   8.363 -                    </upgrademodulepath>
   8.364 -                    <compilerarg line="${javac.systemmodulepath.cmd.line.arg}"/>
   8.365 -                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   8.366 -                    <compilerarg line="${javac.compilerargs}"/>
   8.367 -                    <compilerarg if:set="processormodulepath.set" value="--processor-module-path"/>
   8.368 -                    <compilerarg if:set="processormodulepath.set" path="@{processormodulepath}"/>
   8.369 -                    <compilerarg unless:set="processormodulepath.set" value="-processorpath"/>
   8.370 -                    <compilerarg path="@{processorpath}:${empty.dir}" unless:set="processormodulepath.set"/>
   8.371 -                    <compilerarg line="${ap.processors.internal}"/>
   8.372 -                    <compilerarg line="${annotation.processing.processor.options}"/>
   8.373 -                    <compilerarg value="-s"/>
   8.374 -                    <compilerarg path="@{apgeneratedsrcdir}"/>
   8.375 -                    <compilerarg line="${ap.proc.none.internal}"/>
   8.376 -                    <customize/>
   8.377 -                </javac>
   8.378 -            </sequential>
   8.379 -        </macrodef>
   8.380 -    </target>
   8.381 -    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors" unless="modules.supported.internal">
   8.382 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.383 -            <attribute default="${src.dir}" name="srcdir"/>
   8.384 -            <attribute default="${build.classes.dir}" name="destdir"/>
   8.385 -            <attribute default="${javac.classpath}" name="classpath"/>
   8.386 -            <attribute default="${javac.modulepath}" name="modulepath"/>
   8.387 -            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   8.388 -            <attribute default="${javac.processorpath}" name="processorpath"/>
   8.389 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   8.390 -            <attribute default="${includes}" name="includes"/>
   8.391 -            <attribute default="${excludes}" name="excludes"/>
   8.392 -            <attribute default="${javac.debug}" name="debug"/>
   8.393 -            <attribute default="${empty.dir}" name="sourcepath"/>
   8.394 -            <attribute default="${empty.dir}" name="gensrcdir"/>
   8.395 -            <element name="customize" optional="true"/>
   8.396 -            <sequential>
   8.397 -                <property location="${build.dir}/empty" name="empty.dir"/>
   8.398 -                <mkdir dir="${empty.dir}"/>
   8.399 -                <mkdir dir="@{apgeneratedsrcdir}"/>
   8.400 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   8.401 -                    <src>
   8.402 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   8.403 -                            <include name="*"/>
   8.404 -                        </dirset>
   8.405 -                    </src>
   8.406 -                    <classpath>
   8.407 -                        <path path="@{classpath}"/>
   8.408 -                    </classpath>
   8.409 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.410 -                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   8.411 -                    <compilerarg line="${javac.compilerargs}"/>
   8.412 -                    <compilerarg value="-processorpath"/>
   8.413 -                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   8.414 -                    <compilerarg line="${ap.processors.internal}"/>
   8.415 -                    <compilerarg line="${annotation.processing.processor.options}"/>
   8.416 -                    <compilerarg value="-s"/>
   8.417 -                    <compilerarg path="@{apgeneratedsrcdir}"/>
   8.418 -                    <compilerarg line="${ap.proc.none.internal}"/>
   8.419 -                    <customize/>
   8.420 -                </javac>
   8.421 -            </sequential>
   8.422 -        </macrodef>
   8.423 -    </target>
   8.424 -    <target depends="-init-ap-cmdline-properties,-init-source-module-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   8.425 -        <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.426 -            <attribute default="${src.dir}" name="srcdir"/>
   8.427 -            <attribute default="${build.classes.dir}" name="destdir"/>
   8.428 -            <attribute default="${javac.classpath}" name="classpath"/>
   8.429 -            <attribute default="${javac.modulepath}" name="modulepath"/>
   8.430 -            <attribute default="${javac.upgrademodulepath}" name="upgrademodulepath"/>
   8.431 -            <attribute default="${javac.processorpath}" name="processorpath"/>
   8.432 -            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   8.433 -            <attribute default="${includes}" name="includes"/>
   8.434 -            <attribute default="${excludes}" name="excludes"/>
   8.435 -            <attribute default="${javac.debug}" name="debug"/>
   8.436 -            <attribute default="${empty.dir}" name="sourcepath"/>
   8.437 -            <attribute default="${empty.dir}" name="gensrcdir"/>
   8.438 -            <element name="customize" optional="true"/>
   8.439 -            <sequential>
   8.440 -                <property location="${build.dir}/empty" name="empty.dir"/>
   8.441 -                <mkdir dir="${empty.dir}"/>
   8.442 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}">
   8.443 -                    <src>
   8.444 -                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   8.445 -                            <include name="*"/>
   8.446 -                        </dirset>
   8.447 -                    </src>
   8.448 -                    <classpath>
   8.449 -                        <path path="@{classpath}"/>
   8.450 -                    </classpath>
   8.451 -                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.452 -                    <compilerarg line="${javac.profile.cmd.line.arg}"/>
   8.453 -                    <compilerarg line="${javac.compilerargs}"/>
   8.454 -                    <customize/>
   8.455 -                </javac>
   8.456 -            </sequential>
   8.457 -        </macrodef>
   8.458 -    </target>
   8.459 -    <target depends="-init-macrodef-javac-with-module,-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   8.460 -        <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.461 -            <attribute default="${src.dir}" name="srcdir"/>
   8.462 -            <attribute default="${build.classes.dir}" name="destdir"/>
   8.463 -            <attribute default="${javac.classpath}" name="classpath"/>
   8.464 -            <sequential>
   8.465 -                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
   8.466 -                    <classpath>
   8.467 -                        <path path="@{classpath}"/>
   8.468 -                    </classpath>
   8.469 -                </depend>
   8.470 -            </sequential>
   8.471 -        </macrodef>
   8.472 -        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.473 -            <attribute default="${build.classes.dir}" name="destdir"/>
   8.474 -            <sequential>
   8.475 -                <fail unless="javac.includes">Must set javac.includes</fail>
   8.476 -                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   8.477 -                    <path>
   8.478 -                        <filelist dir="@{destdir}" files="${javac.includes}"/>
   8.479 -                    </path>
   8.480 -                    <globmapper from="*.java" to="*.class"/>
   8.481 -                </pathconvert>
   8.482 -                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   8.483 -                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   8.484 -                <delete>
   8.485 -                    <files includesfile="${javac.includesfile.binary}"/>
   8.486 -                </delete>
   8.487 -                <delete>
   8.488 -                    <fileset file="${javac.includesfile.binary}"/>
   8.489 -                </delete>
   8.490 -            </sequential>
   8.491 -        </macrodef>
   8.492 -    </target>
   8.493 -    <target if="${junit.available}" name="-init-macrodef-junit-init">
   8.494 -        <condition else="false" property="nb.junit.batch" value="true">
   8.495 -            <and>
   8.496 -                <istrue value="${junit.available}"/>
   8.497 -                <not>
   8.498 -                    <isset property="test.method"/>
   8.499 -                </not>
   8.500 -            </and>
   8.501 -        </condition>
   8.502 -        <condition else="false" property="nb.junit.single" value="true">
   8.503 -            <and>
   8.504 -                <istrue value="${junit.available}"/>
   8.505 -                <isset property="test.method"/>
   8.506 -            </and>
   8.507 -        </condition>
   8.508 -    </target>
   8.509 -    <target name="-init-test-properties">
   8.510 -        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   8.511 -        <property name="test.binarytestincludes" value=""/>
   8.512 -        <property name="test.binaryexcludes" value=""/>
   8.513 -    </target>
   8.514 -    <target depends="-init-modules-supported" if="modules.supported.internal" name="-init-macrodef-junit-prototype-with-module">
   8.515 -        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.516 -            <attribute default="${includes}" name="includes"/>
   8.517 -            <attribute default="${excludes}" name="excludes"/>
   8.518 -            <element name="customizePrototype" optional="true"/>
   8.519 -            <sequential>
   8.520 -                <property name="junit.forkmode" value="perTest"/>
   8.521 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   8.522 -                    <syspropertyset>
   8.523 -                        <propertyref prefix="test-sys-prop."/>
   8.524 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   8.525 -                    </syspropertyset>
   8.526 -                    <classpath>
   8.527 -                        <path path="${run.test.classpath}"/>
   8.528 -                    </classpath>
   8.529 -                    <modulepath>
   8.530 -                        <path path="${run.test.modulepath}"/>
   8.531 -                    </modulepath>
   8.532 -                    <formatter type="brief" usefile="false"/>
   8.533 -                    <formatter type="xml"/>
   8.534 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.535 -                    <jvmarg value="-ea"/>
   8.536 -                    <jvmarg line="${run.test.jvmargs}"/>
   8.537 -                    <customizePrototype/>
   8.538 -                </junit>
   8.539 -            </sequential>
   8.540 -        </macrodef>
   8.541 -    </target>
   8.542 -    <target depends="-init-modules-supported" name="-init-macrodef-junit-prototype-without-module" unless="modules.supported.internal">
   8.543 -        <macrodef name="junit-prototype" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.544 -            <attribute default="${includes}" name="includes"/>
   8.545 -            <attribute default="${excludes}" name="excludes"/>
   8.546 -            <element name="customizePrototype" optional="true"/>
   8.547 -            <sequential>
   8.548 -                <property name="junit.forkmode" value="perTest"/>
   8.549 -                <junit dir="${work.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" forkmode="${junit.forkmode}" showoutput="true" tempdir="${build.dir}">
   8.550 -                    <syspropertyset>
   8.551 -                        <propertyref prefix="test-sys-prop."/>
   8.552 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   8.553 -                    </syspropertyset>
   8.554 -                    <classpath>
   8.555 -                        <path path="${run.test.classpath}"/>
   8.556 -                    </classpath>
   8.557 -                    <formatter type="brief" usefile="false"/>
   8.558 -                    <formatter type="xml"/>
   8.559 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.560 -                    <jvmarg value="-ea"/>
   8.561 -                    <customizePrototype/>
   8.562 -                </junit>
   8.563 -            </sequential>
   8.564 -        </macrodef>
   8.565 -    </target>
   8.566 -    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   8.567 -        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.568 -            <attribute default="${includes}" name="includes"/>
   8.569 -            <attribute default="${excludes}" name="excludes"/>
   8.570 -            <attribute default="**" name="testincludes"/>
   8.571 -            <attribute default="" name="testmethods"/>
   8.572 -            <element name="customize" optional="true"/>
   8.573 -            <sequential>
   8.574 -                <j2seproject3:junit-prototype>
   8.575 -                    <customizePrototype>
   8.576 -                        <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   8.577 -                        <customize/>
   8.578 -                    </customizePrototype>
   8.579 -                </j2seproject3:junit-prototype>
   8.580 -            </sequential>
   8.581 -        </macrodef>
   8.582 -    </target>
   8.583 -    <target depends="-init-test-properties,-init-macrodef-junit-prototype-with-module,-init-macrodef-junit-prototype-without-module" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   8.584 -        <macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.585 -            <attribute default="${includes}" name="includes"/>
   8.586 -            <attribute default="${excludes}" name="excludes"/>
   8.587 -            <attribute default="**" name="testincludes"/>
   8.588 -            <attribute default="" name="testmethods"/>
   8.589 -            <element name="customize" optional="true"/>
   8.590 -            <sequential>
   8.591 -                <j2seproject3:junit-prototype>
   8.592 -                    <customizePrototype>
   8.593 -                        <batchtest todir="${build.test.results.dir}">
   8.594 -                            <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   8.595 -                                <filename name="@{testincludes}"/>
   8.596 -                            </fileset>
   8.597 -                            <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   8.598 -                                <filename name="${test.binarytestincludes}"/>
   8.599 -                            </fileset>
   8.600 -                        </batchtest>
   8.601 -                        <customize/>
   8.602 -                    </customizePrototype>
   8.603 -                </j2seproject3:junit-prototype>
   8.604 -            </sequential>
   8.605 -        </macrodef>
   8.606 -    </target>
   8.607 -    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   8.608 -    <target if="${testng.available}" name="-init-macrodef-testng">
   8.609 -        <macrodef name="testng" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.610 -            <attribute default="${includes}" name="includes"/>
   8.611 -            <attribute default="${excludes}" name="excludes"/>
   8.612 -            <attribute default="**" name="testincludes"/>
   8.613 -            <attribute default="" name="testmethods"/>
   8.614 -            <element name="customize" optional="true"/>
   8.615 -            <sequential>
   8.616 -                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   8.617 -                    <isset property="test.method"/>
   8.618 -                </condition>
   8.619 -                <union id="test.set">
   8.620 -                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   8.621 -                        <filename name="@{testincludes}"/>
   8.622 -                    </fileset>
   8.623 -                </union>
   8.624 -                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   8.625 -                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="rozsirene-atributy" testname="TestNG tests" workingDir="${work.dir}">
   8.626 -                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   8.627 -                    <propertyset>
   8.628 -                        <propertyref prefix="test-sys-prop."/>
   8.629 -                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   8.630 -                    </propertyset>
   8.631 -                    <classpath>
   8.632 -                        <path path="${run.test.classpath}"/>
   8.633 -                    </classpath>
   8.634 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.635 -                    <customize/>
   8.636 -                </testng>
   8.637 -            </sequential>
   8.638 -        </macrodef>
   8.639 -    </target>
   8.640 -    <target name="-init-macrodef-test-impl">
   8.641 -        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.642 -            <attribute default="${includes}" name="includes"/>
   8.643 -            <attribute default="${excludes}" name="excludes"/>
   8.644 -            <attribute default="**" name="testincludes"/>
   8.645 -            <attribute default="" name="testmethods"/>
   8.646 -            <element implicit="true" name="customize" optional="true"/>
   8.647 -            <sequential>
   8.648 -                <echo>No tests executed.</echo>
   8.649 -            </sequential>
   8.650 -        </macrodef>
   8.651 -    </target>
   8.652 -    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   8.653 -        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.654 -            <attribute default="${includes}" name="includes"/>
   8.655 -            <attribute default="${excludes}" name="excludes"/>
   8.656 -            <attribute default="**" name="testincludes"/>
   8.657 -            <attribute default="" name="testmethods"/>
   8.658 -            <element implicit="true" name="customize" optional="true"/>
   8.659 -            <sequential>
   8.660 -                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   8.661 -                    <customize/>
   8.662 -                </j2seproject3:junit>
   8.663 -            </sequential>
   8.664 -        </macrodef>
   8.665 -    </target>
   8.666 -    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   8.667 -        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.668 -            <attribute default="${includes}" name="includes"/>
   8.669 -            <attribute default="${excludes}" name="excludes"/>
   8.670 -            <attribute default="**" name="testincludes"/>
   8.671 -            <attribute default="" name="testmethods"/>
   8.672 -            <element implicit="true" name="customize" optional="true"/>
   8.673 -            <sequential>
   8.674 -                <j2seproject3:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   8.675 -                    <customize/>
   8.676 -                </j2seproject3:testng>
   8.677 -            </sequential>
   8.678 -        </macrodef>
   8.679 -    </target>
   8.680 -    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   8.681 -        <macrodef name="test" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.682 -            <attribute default="${includes}" name="includes"/>
   8.683 -            <attribute default="${excludes}" name="excludes"/>
   8.684 -            <attribute default="**" name="testincludes"/>
   8.685 -            <attribute default="" name="testmethods"/>
   8.686 -            <sequential>
   8.687 -                <j2seproject3:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   8.688 -                    <customize>
   8.689 -                        <jvmarg line="${run.jvmargs}"/>
   8.690 -                        <jvmarg line="${run.jvmargs.ide}"/>
   8.691 -                    </customize>
   8.692 -                </j2seproject3:test-impl>
   8.693 -            </sequential>
   8.694 -        </macrodef>
   8.695 -    </target>
   8.696 -    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   8.697 -        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.698 -            <attribute default="${includes}" name="includes"/>
   8.699 -            <attribute default="${excludes}" name="excludes"/>
   8.700 -            <attribute default="**" name="testincludes"/>
   8.701 -            <attribute default="" name="testmethods"/>
   8.702 -            <element name="customizeDebuggee" optional="true"/>
   8.703 -            <sequential>
   8.704 -                <j2seproject3:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   8.705 -                    <customize>
   8.706 -                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   8.707 -                        <customizeDebuggee/>
   8.708 -                    </customize>
   8.709 -                </j2seproject3:junit>
   8.710 -            </sequential>
   8.711 -        </macrodef>
   8.712 -    </target>
   8.713 -    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   8.714 -        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.715 -            <attribute default="${main.class}" name="testClass"/>
   8.716 -            <attribute default="" name="testMethod"/>
   8.717 -            <element name="customize2" optional="true"/>
   8.718 -            <sequential>
   8.719 -                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   8.720 -                    <isset property="test.method"/>
   8.721 -                </condition>
   8.722 -                <condition else="-suitename rozsirene-atributy -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   8.723 -                    <matches pattern=".*\.xml" string="@{testClass}"/>
   8.724 -                </condition>
   8.725 -                <delete dir="${build.test.results.dir}" quiet="true"/>
   8.726 -                <mkdir dir="${build.test.results.dir}"/>
   8.727 -                <j2seproject3:debug classname="org.testng.TestNG" classpath="${debug.test.classpath}">
   8.728 -                    <customizeDebuggee>
   8.729 -                        <customize2/>
   8.730 -                        <jvmarg value="-ea"/>
   8.731 -                        <arg line="${testng.debug.mode}"/>
   8.732 -                        <arg line="-d ${build.test.results.dir}"/>
   8.733 -                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   8.734 -                        <arg line="${testng.cmd.args}"/>
   8.735 -                    </customizeDebuggee>
   8.736 -                </j2seproject3:debug>
   8.737 -            </sequential>
   8.738 -        </macrodef>
   8.739 -    </target>
   8.740 -    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   8.741 -        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.742 -            <attribute default="${main.class}" name="testClass"/>
   8.743 -            <attribute default="" name="testMethod"/>
   8.744 -            <element implicit="true" name="customize2" optional="true"/>
   8.745 -            <sequential>
   8.746 -                <j2seproject3:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   8.747 -                    <customize2/>
   8.748 -                </j2seproject3:testng-debug>
   8.749 -            </sequential>
   8.750 -        </macrodef>
   8.751 -    </target>
   8.752 -    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   8.753 -        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.754 -            <attribute default="${includes}" name="includes"/>
   8.755 -            <attribute default="${excludes}" name="excludes"/>
   8.756 -            <attribute default="**" name="testincludes"/>
   8.757 -            <attribute default="" name="testmethods"/>
   8.758 -            <attribute default="${main.class}" name="testClass"/>
   8.759 -            <attribute default="" name="testMethod"/>
   8.760 -            <sequential>
   8.761 -                <j2seproject3:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   8.762 -                    <customizeDebuggee>
   8.763 -                        <jvmarg line="${run.jvmargs}"/>
   8.764 -                        <jvmarg line="${run.jvmargs.ide}"/>
   8.765 -                    </customizeDebuggee>
   8.766 -                </j2seproject3:test-debug-impl>
   8.767 -            </sequential>
   8.768 -        </macrodef>
   8.769 -    </target>
   8.770 -    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   8.771 -        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.772 -            <attribute default="${includes}" name="includes"/>
   8.773 -            <attribute default="${excludes}" name="excludes"/>
   8.774 -            <attribute default="**" name="testincludes"/>
   8.775 -            <attribute default="" name="testmethods"/>
   8.776 -            <attribute default="${main.class}" name="testClass"/>
   8.777 -            <attribute default="" name="testMethod"/>
   8.778 -            <sequential>
   8.779 -                <j2seproject3:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   8.780 -                    <customize2>
   8.781 -                        <syspropertyset>
   8.782 -                            <propertyref prefix="test-sys-prop."/>
   8.783 -                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   8.784 -                        </syspropertyset>
   8.785 -                    </customize2>
   8.786 -                </j2seproject3:testng-debug-impl>
   8.787 -            </sequential>
   8.788 -        </macrodef>
   8.789 -    </target>
   8.790 -    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   8.791 -    <!--
   8.792 -                pre NB7.2 profiling section; consider it deprecated
   8.793 -            -->
   8.794 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
   8.795 -    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   8.796 -        <!-- Empty placeholder for easier customization. -->
   8.797 -        <!-- You can override this target in the ../build.xml file. -->
   8.798 -    </target>
   8.799 -    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   8.800 -        <!-- Empty placeholder for easier customization. -->
   8.801 -        <!-- You can override this target in the ../build.xml file. -->
   8.802 -    </target>
   8.803 -    <target if="profiler.info.jvmargs.agent" name="-profile-init-macrodef-profile">
   8.804 -        <macrodef name="resolve">
   8.805 -            <attribute name="name"/>
   8.806 -            <attribute name="value"/>
   8.807 -            <sequential>
   8.808 -                <property name="@{name}" value="${env.@{value}}"/>
   8.809 -            </sequential>
   8.810 -        </macrodef>
   8.811 -        <macrodef name="profile">
   8.812 -            <attribute default="${main.class}" name="classname"/>
   8.813 -            <element name="customize" optional="true"/>
   8.814 -            <sequential>
   8.815 -                <property environment="env"/>
   8.816 -                <resolve name="profiler.current.path" value="${profiler.info.pathvar}"/>
   8.817 -                <java classname="@{classname}" dir="${profiler.info.dir}" failonerror="${java.failonerror}" fork="true" jvm="${profiler.info.jvm}">
   8.818 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.819 -                    <jvmarg value="${profiler.info.jvmargs.agent}"/>
   8.820 -                    <jvmarg line="${profiler.info.jvmargs}"/>
   8.821 -                    <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
   8.822 -                    <arg line="${application.args}"/>
   8.823 -                    <classpath>
   8.824 -                        <path path="${run.classpath}"/>
   8.825 -                    </classpath>
   8.826 -                    <syspropertyset>
   8.827 -                        <propertyref prefix="run-sys-prop."/>
   8.828 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   8.829 -                    </syspropertyset>
   8.830 -                    <customize/>
   8.831 -                </java>
   8.832 -            </sequential>
   8.833 -        </macrodef>
   8.834 -    </target>
   8.835 -    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-macrodef-profile" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   8.836 -        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   8.837 -        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   8.838 -    </target>
   8.839 -    <!--
   8.840 -                end of pre NB7.2 profiling section
   8.841 -            -->
   8.842 -    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   8.843 -        <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.844 -            <attribute default="${main.class}" name="name"/>
   8.845 -            <attribute default="${debug.modulepath}" name="modulepath"/>
   8.846 -            <attribute default="${debug.classpath}" name="classpath"/>
   8.847 -            <attribute default="" name="stopclassname"/>
   8.848 -            <sequential>
   8.849 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}" transport="${debug-transport}">
   8.850 -                    <modulepath>
   8.851 -                        <path path="@{modulepath}"/>
   8.852 -                    </modulepath>
   8.853 -                    <classpath>
   8.854 -                        <path path="@{classpath}"/>
   8.855 -                    </classpath>
   8.856 -                </nbjpdastart>
   8.857 -            </sequential>
   8.858 -        </macrodef>
   8.859 -        <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.860 -            <attribute default="${build.classes.dir}" name="dir"/>
   8.861 -            <sequential>
   8.862 -                <nbjpdareload>
   8.863 -                    <fileset dir="@{dir}" includes="${fix.classes}">
   8.864 -                        <include name="${fix.includes}*.class"/>
   8.865 -                    </fileset>
   8.866 -                </nbjpdareload>
   8.867 -            </sequential>
   8.868 -        </macrodef>
   8.869 -    </target>
   8.870 -    <target name="-init-debug-args">
   8.871 -        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   8.872 -            <os family="windows"/>
   8.873 -        </condition>
   8.874 -        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   8.875 -            <isset property="debug.transport"/>
   8.876 -        </condition>
   8.877 -    </target>
   8.878 -    <target depends="-init-debug-args" name="-init-macrodef-debug">
   8.879 -        <macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.880 -            <attribute default="${module.name}" name="modulename"/>
   8.881 -            <attribute default="${main.class}" name="classname"/>
   8.882 -            <attribute default="${debug.modulepath}" name="modulepath"/>
   8.883 -            <attribute default="${debug.classpath}" name="classpath"/>
   8.884 -            <element name="customizeDebuggee" optional="true"/>
   8.885 -            <sequential>
   8.886 -                <j2seproject1:java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">
   8.887 -                    <customize>
   8.888 -                        <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
   8.889 -                        <customizeDebuggee/>
   8.890 -                    </customize>
   8.891 -                </j2seproject1:java>
   8.892 -            </sequential>
   8.893 -        </macrodef>
   8.894 -    </target>
   8.895 -    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-macrodef-java-with-module">
   8.896 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.897 -            <attribute default="${module.name}" name="modulename"/>
   8.898 -            <attribute default="${main.class}" name="classname"/>
   8.899 -            <attribute default="${run.modulepath}" name="modulepath"/>
   8.900 -            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   8.901 -            <attribute default="${run.classpath}" name="classpath"/>
   8.902 -            <attribute default="jvm" name="jvm"/>
   8.903 -            <element name="customize" optional="true"/>
   8.904 -            <sequential>
   8.905 -                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true" module="@{modulename}">
   8.906 -                    <classpath>
   8.907 -                        <path path="@{classpath}"/>
   8.908 -                    </classpath>
   8.909 -                    <modulepath>
   8.910 -                        <pathelement path="@{modulepath}"/>
   8.911 -                        <pathelement location="${module.build.classes.dir}"/>
   8.912 -                    </modulepath>
   8.913 -                    <upgrademodulepath>
   8.914 -                        <path path="@{upgrademodulepath}"/>
   8.915 -                    </upgrademodulepath>
   8.916 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   8.917 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   8.918 -                    <jvmarg line="${run.jvmargs}"/>
   8.919 -                    <jvmarg line="${run.jvmargs.ide}"/>
   8.920 -                    <syspropertyset>
   8.921 -                        <propertyref prefix="run-sys-prop."/>
   8.922 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   8.923 -                    </syspropertyset>
   8.924 -                    <customize/>
   8.925 -                </java>
   8.926 -            </sequential>
   8.927 -        </macrodef>
   8.928 -    </target>
   8.929 -    <target depends="-init-source-module-properties" if="unnamed.module.internal" name="-init-macrodef-java-with-unnamed-module">
   8.930 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.931 -            <attribute default="" name="modulename"/>
   8.932 -            <attribute default="${main.class}" name="classname"/>
   8.933 -            <attribute default="${run.modulepath}" name="modulepath"/>
   8.934 -            <attribute default="${run.upgrademodulepath}" name="upgrademodulepath"/>
   8.935 -            <attribute default="${run.classpath}" name="classpath"/>
   8.936 -            <attribute default="jvm" name="jvm"/>
   8.937 -            <element name="customize" optional="true"/>
   8.938 -            <sequential>
   8.939 -                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   8.940 -                    <classpath>
   8.941 -                        <path path="@{classpath}"/>
   8.942 -                    </classpath>
   8.943 -                    <modulepath>
   8.944 -                        <path path="@{modulepath}"/>
   8.945 -                    </modulepath>
   8.946 -                    <upgrademodulepath>
   8.947 -                        <path path="@{upgrademodulepath}"/>
   8.948 -                    </upgrademodulepath>
   8.949 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   8.950 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   8.951 -                    <jvmarg line="${run.jvmargs}"/>
   8.952 -                    <jvmarg line="${run.jvmargs.ide}"/>
   8.953 -                    <syspropertyset>
   8.954 -                        <propertyref prefix="run-sys-prop."/>
   8.955 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   8.956 -                    </syspropertyset>
   8.957 -                    <customize/>
   8.958 -                </java>
   8.959 -            </sequential>
   8.960 -        </macrodef>
   8.961 -    </target>
   8.962 -    <target depends="-init-source-module-properties" name="-init-macrodef-java-without-module" unless="modules.supported.internal">
   8.963 -        <macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
   8.964 -            <attribute default="" name="modulename"/>
   8.965 -            <attribute default="${main.class}" name="classname"/>
   8.966 -            <attribute default="" name="modulepath"/>
   8.967 -            <attribute default="${run.classpath}" name="classpath"/>
   8.968 -            <attribute default="jvm" name="jvm"/>
   8.969 -            <element name="customize" optional="true"/>
   8.970 -            <sequential>
   8.971 -                <java classname="@{classname}" dir="${work.dir}" failonerror="${java.failonerror}" fork="true">
   8.972 -                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   8.973 -                    <jvmarg value="-Dfile.encoding=${runtime.encoding}"/>
   8.974 -                    <redirector errorencoding="${runtime.encoding}" inputencoding="${runtime.encoding}" outputencoding="${runtime.encoding}"/>
   8.975 -                    <jvmarg line="${run.jvmargs}"/>
   8.976 -                    <jvmarg line="${run.jvmargs.ide}"/>
   8.977 -                    <classpath>
   8.978 -                        <path path="@{classpath}"/>
   8.979 -                    </classpath>
   8.980 -                    <syspropertyset>
   8.981 -                        <propertyref prefix="run-sys-prop."/>
   8.982 -                        <mapper from="run-sys-prop.*" to="*" type="glob"/>
   8.983 -                    </syspropertyset>
   8.984 -                    <customize/>
   8.985 -                </java>
   8.986 -            </sequential>
   8.987 -        </macrodef>
   8.988 -    </target>
   8.989 -    <target depends="-init-macrodef-java-with-module, -init-macrodef-java-with-unnamed-module, -init-macrodef-java-without-module" name="-init-macrodef-java"/>
   8.990 -    <target name="-init-macrodef-copylibs">
   8.991 -        <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3">
   8.992 -            <attribute default="${manifest.file}" name="manifest"/>
   8.993 -            <element name="customize" optional="true"/>
   8.994 -            <sequential>
   8.995 -                <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
   8.996 -                <pathconvert property="run.classpath.without.build.classes.dir">
   8.997 -                    <path path="${run.classpath}"/>
   8.998 -                    <map from="${build.classes.dir.resolved}" to=""/>
   8.999 -                </pathconvert>
  8.1000 -                <pathconvert pathsep=" " property="jar.classpath">
  8.1001 -                    <path path="${run.classpath.without.build.classes.dir}"/>
  8.1002 -                    <chainedmapper>
  8.1003 -                        <flattenmapper/>
  8.1004 -                        <filtermapper>
  8.1005 -                            <replacestring from=" " to="%20"/>
  8.1006 -                        </filtermapper>
  8.1007 -                        <globmapper from="*" to="lib/*"/>
  8.1008 -                    </chainedmapper>
  8.1009 -                </pathconvert>
  8.1010 -                <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
  8.1011 -                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
  8.1012 -                    <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  8.1013 -                    <manifest>
  8.1014 -                        <attribute name="Class-Path" value="${jar.classpath}"/>
  8.1015 -                        <customize/>
  8.1016 -                    </manifest>
  8.1017 -                </copylibs>
  8.1018 -            </sequential>
  8.1019 -        </macrodef>
  8.1020 -    </target>
  8.1021 -    <target name="-init-presetdef-jar">
  8.1022 -        <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
  8.1023 -            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifestencoding="UTF-8">
  8.1024 -                <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
  8.1025 -            </jar>
  8.1026 -        </presetdef>
  8.1027 -    </target>
  8.1028 -    <target name="-init-ap-cmdline-properties">
  8.1029 -        <property name="annotation.processing.enabled" value="true"/>
  8.1030 -        <property name="annotation.processing.processors.list" value=""/>
  8.1031 -        <property name="annotation.processing.processor.options" value=""/>
  8.1032 -        <property name="annotation.processing.run.all.processors" value="true"/>
  8.1033 -        <property name="javac.processorpath" value="${javac.classpath}"/>
  8.1034 -        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
  8.1035 -        <condition property="ap.supported.internal" value="true">
  8.1036 -            <not>
  8.1037 -                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
  8.1038 -            </not>
  8.1039 -        </condition>
  8.1040 -    </target>
  8.1041 -    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
  8.1042 -        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
  8.1043 -            <isfalse value="${annotation.processing.run.all.processors}"/>
  8.1044 -        </condition>
  8.1045 -        <condition else="" property="ap.proc.none.internal" value="-proc:none">
  8.1046 -            <isfalse value="${annotation.processing.enabled}"/>
  8.1047 -        </condition>
  8.1048 -    </target>
  8.1049 -    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
  8.1050 -        <property name="ap.cmd.line.internal" value=""/>
  8.1051 -    </target>
  8.1052 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar,-init-ap-cmdline" name="init"/>
  8.1053 -    <!--
  8.1054 -                ===================
  8.1055 -                COMPILATION SECTION
  8.1056 -                ===================
  8.1057 -            -->
  8.1058 -    <target name="-deps-jar-init" unless="built-jar.properties">
  8.1059 -        <property location="${build.dir}/built-jar.properties" name="built-jar.properties"/>
  8.1060 -        <delete file="${built-jar.properties}" quiet="true"/>
  8.1061 -    </target>
  8.1062 -    <target if="already.built.jar.${basedir}" name="-warn-already-built-jar">
  8.1063 -        <echo level="warn" message="Cycle detected: rozsirene-atributy was already built"/>
  8.1064 -    </target>
  8.1065 -    <target depends="init,-deps-jar-init" name="deps-jar" unless="no.deps">
  8.1066 -        <mkdir dir="${build.dir}"/>
  8.1067 -        <touch file="${built-jar.properties}" verbose="false"/>
  8.1068 -        <property file="${built-jar.properties}" prefix="already.built.jar."/>
  8.1069 -        <antcall target="-warn-already-built-jar"/>
  8.1070 -        <propertyfile file="${built-jar.properties}">
  8.1071 -            <entry key="${basedir}" value=""/>
  8.1072 -        </propertyfile>
  8.1073 -    </target>
  8.1074 -    <target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
  8.1075 -    <target depends="init" name="-check-automatic-build">
  8.1076 -        <available file="${build.classes.dir}/.netbeans_automatic_build" property="netbeans.automatic.build"/>
  8.1077 -    </target>
  8.1078 -    <target depends="init" if="netbeans.automatic.build" name="-clean-after-automatic-build">
  8.1079 -        <antcall target="clean">
  8.1080 -            <param name="no.dependencies" value="true"/>
  8.1081 -        </antcall>
  8.1082 -    </target>
  8.1083 -    <target depends="init,deps-jar" name="-pre-pre-compile">
  8.1084 -        <mkdir dir="${build.classes.dir}"/>
  8.1085 -    </target>
  8.1086 -    <target name="-pre-compile">
  8.1087 -        <!-- Empty placeholder for easier customization. -->
  8.1088 -        <!-- You can override this target in the ../build.xml file. -->
  8.1089 -    </target>
  8.1090 -    <target if="do.depend.true" name="-compile-depend">
  8.1091 -        <pathconvert property="build.generated.subdirs">
  8.1092 -            <dirset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  8.1093 -                <include name="*"/>
  8.1094 -            </dirset>
  8.1095 -        </pathconvert>
  8.1096 -        <j2seproject3:depend srcdir="${src.dir}:${build.generated.subdirs}"/>
  8.1097 -    </target>
  8.1098 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
  8.1099 -        <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
  8.1100 -        <copy todir="${build.classes.dir}">
  8.1101 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  8.1102 -        </copy>
  8.1103 -    </target>
  8.1104 -    <target if="has.persistence.xml" name="-copy-persistence-xml">
  8.1105 -        <mkdir dir="${build.classes.dir}/META-INF"/>
  8.1106 -        <copy todir="${build.classes.dir}/META-INF">
  8.1107 -            <fileset dir="${meta.inf.dir}" includes="persistence.xml orm.xml"/>
  8.1108 -        </copy>
  8.1109 -    </target>
  8.1110 -    <target name="-post-compile">
  8.1111 -        <!-- Empty placeholder for easier customization. -->
  8.1112 -        <!-- You can override this target in the ../build.xml file. -->
  8.1113 -    </target>
  8.1114 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
  8.1115 -    <target name="-pre-compile-single">
  8.1116 -        <!-- Empty placeholder for easier customization. -->
  8.1117 -        <!-- You can override this target in the ../build.xml file. -->
  8.1118 -    </target>
  8.1119 -    <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
  8.1120 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  8.1121 -        <j2seproject3:force-recompile/>
  8.1122 -        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}, module-info.java" sourcepath="${src.dir}"/>
  8.1123 -    </target>
  8.1124 -    <target name="-post-compile-single">
  8.1125 -        <!-- Empty placeholder for easier customization. -->
  8.1126 -        <!-- You can override this target in the ../build.xml file. -->
  8.1127 -    </target>
  8.1128 -    <target depends="init,deps-jar,-verify-automatic-build,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
  8.1129 -    <!--
  8.1130 -                ====================
  8.1131 -                JAR BUILDING SECTION
  8.1132 -                ====================
  8.1133 -            -->
  8.1134 -    <target depends="init" name="-pre-pre-jar">
  8.1135 -        <dirname file="${dist.jar}" property="dist.jar.dir"/>
  8.1136 -        <mkdir dir="${dist.jar.dir}"/>
  8.1137 -    </target>
  8.1138 -    <target name="-pre-jar">
  8.1139 -        <!-- Empty placeholder for easier customization. -->
  8.1140 -        <!-- You can override this target in the ../build.xml file. -->
  8.1141 -    </target>
  8.1142 -    <target depends="init,compile" name="-check-module-main-class">
  8.1143 -        <pathconvert property="main.class.file">
  8.1144 -            <string value="${main.class}"/>
  8.1145 -            <unpackagemapper from="*" to="*.class"/>
  8.1146 -        </pathconvert>
  8.1147 -        <condition property="do.module.main.class">
  8.1148 -            <and>
  8.1149 -                <isset property="main.class.available"/>
  8.1150 -                <available file="${build.classes.dir}/module-info.class"/>
  8.1151 -                <available file="${build.classes.dir}/${main.class.file}"/>
  8.1152 -                <isset property="libs.CopyLibs.classpath"/>
  8.1153 -                <available classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}"/>
  8.1154 -            </and>
  8.1155 -        </condition>
  8.1156 -    </target>
  8.1157 -    <target depends="-check-module-main-class" if="do.module.main.class" name="-set-module-main-class">
  8.1158 -        <taskdef classname="org.netbeans.modules.java.j2seproject.moduletask.ModuleMainClass" classpath="${libs.CopyLibs.classpath}" name="modulemainclass"/>
  8.1159 -        <modulemainclass failonerror="false" mainclass="${main.class}" moduleinfo="${build.classes.dir}/module-info.class"/>
  8.1160 -    </target>
  8.1161 -    <target depends="init" if="do.archive" name="-do-jar-create-manifest" unless="manifest.available">
  8.1162 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  8.1163 -        <touch file="${tmp.manifest.file}" verbose="false"/>
  8.1164 -    </target>
  8.1165 -    <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
  8.1166 -        <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
  8.1167 -        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8" tofile="${tmp.manifest.file}"/>
  8.1168 -    </target>
  8.1169 -    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available" name="-do-jar-set-mainclass">
  8.1170 -        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  8.1171 -            <attribute name="Main-Class" value="${main.class}"/>
  8.1172 -        </manifest>
  8.1173 -    </target>
  8.1174 -    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available" name="-do-jar-set-profile">
  8.1175 -        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  8.1176 -            <attribute name="Profile" value="${javac.profile}"/>
  8.1177 -        </manifest>
  8.1178 -    </target>
  8.1179 -    <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+splashscreen.available" name="-do-jar-set-splashscreen">
  8.1180 -        <basename file="${application.splash}" property="splashscreen.basename"/>
  8.1181 -        <mkdir dir="${build.classes.dir}/META-INF"/>
  8.1182 -        <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
  8.1183 -        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
  8.1184 -            <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
  8.1185 -        </manifest>
  8.1186 -    </target>
  8.1187 -    <target depends="init,compile" name="-check-do-mkdist">
  8.1188 -        <condition property="do.mkdist">
  8.1189 -            <and>
  8.1190 -                <isset property="do.archive"/>
  8.1191 -                <isset property="libs.CopyLibs.classpath"/>
  8.1192 -                <not>
  8.1193 -                    <istrue value="${mkdist.disabled}"/>
  8.1194 -                </not>
  8.1195 -                <not>
  8.1196 -                    <available file="${build.classes.dir}/module-info.class"/>
  8.1197 -                </not>
  8.1198 -            </and>
  8.1199 -        </condition>
  8.1200 -    </target>
  8.1201 -    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.mkdist" name="-do-jar-copylibs">
  8.1202 -        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
  8.1203 -        <echo level="info">To run this application from the command line without Ant, try:</echo>
  8.1204 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  8.1205 -        <echo level="info">java -jar "${dist.jar.resolved}"</echo>
  8.1206 -    </target>
  8.1207 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-check-do-mkdist" if="do.archive" name="-do-jar-jar" unless="do.mkdist">
  8.1208 -        <j2seproject1:jar manifest="${tmp.manifest.file}"/>
  8.1209 -        <property location="${build.classes.dir}" name="build.classes.dir.resolved"/>
  8.1210 -        <property location="${dist.jar}" name="dist.jar.resolved"/>
  8.1211 -        <condition else="${dist.jar.resolved}" property="jar.usage.message.class.path.replacement" value="">
  8.1212 -            <isset property="named.module.internal"/>
  8.1213 -        </condition>
  8.1214 -        <pathconvert property="run.classpath.with.dist.jar">
  8.1215 -            <path path="${run.classpath}"/>
  8.1216 -            <map from="${build.classes.dir.resolved}" to="${jar.usage.message.class.path.replacement}"/>
  8.1217 -        </pathconvert>
  8.1218 -        <pathconvert property="run.modulepath.with.dist.jar">
  8.1219 -            <path location="${dist.jar.resolved}"/>
  8.1220 -            <path path="${run.modulepath}"/>
  8.1221 -            <map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
  8.1222 -        </pathconvert>
  8.1223 -        <condition else="${run.modulepath}" property="jar.usage.message.run.modulepath.with.dist.jar" value="${run.modulepath.with.dist.jar}">
  8.1224 -            <isset property="named.module.internal"/>
  8.1225 -        </condition>
  8.1226 -        <condition else="" property="jar.usage.message.module.path" value=" -p ${jar.usage.message.run.modulepath.with.dist.jar}">
  8.1227 -            <and>
  8.1228 -                <isset property="modules.supported.internal"/>
  8.1229 -                <length length="0" string="${jar.usage.message.run.modulepath.with.dist.jar}" when="greater"/>
  8.1230 -            </and>
  8.1231 -        </condition>
  8.1232 -        <condition else="" property="jar.usage.message.class.path" value=" -cp ${run.classpath.with.dist.jar}">
  8.1233 -            <length length="0" string="${run.classpath.with.dist.jar}" when="greater"/>
  8.1234 -        </condition>
  8.1235 -        <condition else="/${main.class}" property="jar.usage.message.main.class.class.selector" value="">
  8.1236 -            <isset property="do.module.main.class"/>
  8.1237 -        </condition>
  8.1238 -        <condition else=" ${main.class}" property="jar.usage.message.main.class" value=" -m ${module.name}${jar.usage.message.main.class.class.selector}">
  8.1239 -            <isset property="named.module.internal"/>
  8.1240 -        </condition>
  8.1241 -        <condition else="" property="jar.usage.message" value="To run this application from the command line without Ant, try:${line.separator}${platform.java}${jar.usage.message.module.path}${jar.usage.message.class.path}${jar.usage.message.main.class}">
  8.1242 -            <isset property="main.class.available"/>
  8.1243 -        </condition>
  8.1244 -        <condition else="debug" property="jar.usage.level" value="info">
  8.1245 -            <isset property="main.class.available"/>
  8.1246 -        </condition>
  8.1247 -        <echo level="${jar.usage.level}" message="${jar.usage.message}"/>
  8.1248 -    </target>
  8.1249 -    <target depends="-do-jar-copylibs" if="do.archive" name="-do-jar-delete-manifest">
  8.1250 -        <delete>
  8.1251 -            <fileset file="${tmp.manifest.file}"/>
  8.1252 -        </delete>
  8.1253 -    </target>
  8.1254 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-jar,-do-jar-delete-manifest" name="-do-jar-without-libraries"/>
  8.1255 -    <target depends="init,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen,-do-jar-copylibs,-do-jar-delete-manifest" name="-do-jar-with-libraries"/>
  8.1256 -    <target name="-post-jar">
  8.1257 -        <!-- Empty placeholder for easier customization. -->
  8.1258 -        <!-- You can override this target in the ../build.xml file. -->
  8.1259 -    </target>
  8.1260 -    <target depends="init,compile,-pre-jar,-set-module-main-class,-do-jar-without-libraries,-do-jar-with-libraries,-post-jar" name="-do-jar"/>
  8.1261 -    <target depends="init,compile,-pre-jar,-do-jar,-post-jar,deploy" description="Build JAR." name="jar"/>
  8.1262 -    <!--
  8.1263 -                =================
  8.1264 -                DEPLOY SECTION
  8.1265 -                =================
  8.1266 -            -->
  8.1267 -    <target name="-pre-deploy">
  8.1268 -        <!-- Empty placeholder for easier customization. -->
  8.1269 -        <!-- You can override this target in the ../build.xml file. -->
  8.1270 -    </target>
  8.1271 -    <target depends="init" name="-check-jlink">
  8.1272 -        <condition property="do.jlink.internal">
  8.1273 -            <and>
  8.1274 -                <istrue value="${do.jlink}"/>
  8.1275 -                <isset property="do.archive"/>
  8.1276 -                <isset property="named.module.internal"/>
  8.1277 -            </and>
  8.1278 -        </condition>
  8.1279 -    </target>
  8.1280 -    <target depends="init,-do-jar,-post-jar,-pre-deploy,-check-jlink" if="do.jlink.internal" name="-do-deploy">
  8.1281 -        <delete dir="${dist.jlink.dir}" failonerror="false" quiet="true"/>
  8.1282 -        <property name="jlink.launcher.name" value="${application.title}"/>
  8.1283 -        <condition else="${module.name}" property="jlink.add.modules" value="${module.name},${jlink.additionalmodules}">
  8.1284 -            <and>
  8.1285 -                <isset property="jlink.additionalmodules"/>
  8.1286 -                <length length="0" string="${jlink.additionalmodules}" when="greater"/>
  8.1287 -            </and>
  8.1288 -        </condition>
  8.1289 -        <condition property="jlink.do.strip.internal">
  8.1290 -            <and>
  8.1291 -                <isset property="jlink.strip"/>
  8.1292 -                <istrue value="${jlink.strip}"/>
  8.1293 -            </and>
  8.1294 -        </condition>
  8.1295 -        <condition property="jlink.do.additionalparam.internal">
  8.1296 -            <and>
  8.1297 -                <isset property="jlink.additionalparam"/>
  8.1298 -                <length length="0" string="${jlink.additionalparam}" when="greater"/>
  8.1299 -            </and>
  8.1300 -        </condition>
  8.1301 -        <condition property="jlink.do.launcher.internal">
  8.1302 -            <and>
  8.1303 -                <istrue value="${jlink.launcher}"/>
  8.1304 -                <isset property="main.class.available"/>
  8.1305 -            </and>
  8.1306 -        </condition>
  8.1307 -        <property name="platform.jlink" value="${jdk.home}/bin/jlink"/>
  8.1308 -        <property name="jlink.systemmodules.internal" value="${jdk.home}/jmods"/>
  8.1309 -        <exec executable="${platform.jlink}">
  8.1310 -            <arg value="--module-path"/>
  8.1311 -            <arg path="${jlink.systemmodules.internal}:${run.modulepath}:${dist.jar}"/>
  8.1312 -            <arg value="--add-modules"/>
  8.1313 -            <arg value="${jlink.add.modules}"/>
  8.1314 -            <arg if:set="jlink.do.strip.internal" value="--strip-debug"/>
  8.1315 -            <arg if:set="jlink.do.launcher.internal" value="--launcher"/>
  8.1316 -            <arg if:set="jlink.do.launcher.internal" value="${jlink.launcher.name}=${module.name}/${main.class}"/>
  8.1317 -            <arg if:set="jlink.do.additionalparam.internal" line="${jlink.additionalparam}"/>
  8.1318 -            <arg value="--output"/>
  8.1319 -            <arg value="${dist.jlink.output}"/>
  8.1320 -        </exec>
  8.1321 -    </target>
  8.1322 -    <target name="-post-deploy">
  8.1323 -        <!-- Empty placeholder for easier customization. -->
  8.1324 -        <!-- You can override this target in the ../build.xml file. -->
  8.1325 -    </target>
  8.1326 -    <target depends="-do-jar,-post-jar,-pre-deploy,-do-deploy,-post-deploy" name="deploy"/>
  8.1327 -    <!--
  8.1328 -                =================
  8.1329 -                EXECUTION SECTION
  8.1330 -                =================
  8.1331 -            -->
  8.1332 -    <target depends="init,compile" description="Run a main class." name="run">
  8.1333 -        <j2seproject1:java>
  8.1334 -            <customize>
  8.1335 -                <arg line="${application.args}"/>
  8.1336 -            </customize>
  8.1337 -        </j2seproject1:java>
  8.1338 -    </target>
  8.1339 -    <target name="-do-not-recompile">
  8.1340 -        <property name="javac.includes.binary" value=""/>
  8.1341 -    </target>
  8.1342 -    <target depends="init,compile-single" name="run-single">
  8.1343 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  8.1344 -        <j2seproject1:java classname="${run.class}"/>
  8.1345 -    </target>
  8.1346 -    <target depends="init,compile-test-single" name="run-test-with-main">
  8.1347 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  8.1348 -        <j2seproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  8.1349 -    </target>
  8.1350 -    <!--
  8.1351 -                =================
  8.1352 -                DEBUGGING SECTION
  8.1353 -                =================
  8.1354 -            -->
  8.1355 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  8.1356 -        <j2seproject1:nbjpdastart name="${debug.class}"/>
  8.1357 -    </target>
  8.1358 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  8.1359 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  8.1360 -    </target>
  8.1361 -    <target depends="init,compile" name="-debug-start-debuggee">
  8.1362 -        <j2seproject3:debug>
  8.1363 -            <customizeDebuggee>
  8.1364 -                <arg line="${application.args}"/>
  8.1365 -            </customizeDebuggee>
  8.1366 -        </j2seproject3:debug>
  8.1367 -    </target>
  8.1368 -    <target depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE." if="netbeans.home" name="debug"/>
  8.1369 -    <target depends="init" if="netbeans.home" name="-debug-start-debugger-stepinto">
  8.1370 -        <j2seproject1:nbjpdastart stopclassname="${main.class}"/>
  8.1371 -    </target>
  8.1372 -    <target depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee" if="netbeans.home" name="debug-stepinto"/>
  8.1373 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-single">
  8.1374 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  8.1375 -        <j2seproject3:debug classname="${debug.class}"/>
  8.1376 -    </target>
  8.1377 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single" if="netbeans.home" name="debug-single"/>
  8.1378 -    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  8.1379 -        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  8.1380 -        <j2seproject3:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  8.1381 -    </target>
  8.1382 -    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  8.1383 -    <target depends="init" name="-pre-debug-fix">
  8.1384 -        <fail unless="fix.includes">Must set fix.includes</fail>
  8.1385 -        <property name="javac.includes" value="${fix.includes}.java"/>
  8.1386 -    </target>
  8.1387 -    <target depends="init,-pre-debug-fix,compile-single" if="netbeans.home" name="-do-debug-fix">
  8.1388 -        <j2seproject1:nbjpdareload/>
  8.1389 -    </target>
  8.1390 -    <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  8.1391 -    <!--
  8.1392 -                =================
  8.1393 -                PROFILING SECTION
  8.1394 -                =================
  8.1395 -            -->
  8.1396 -    <!--
  8.1397 -                pre NB7.2 profiler integration
  8.1398 -            -->
  8.1399 -    <target depends="profile-init,compile" description="Profile a project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  8.1400 -        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  8.1401 -        <nbprofiledirect>
  8.1402 -            <classpath>
  8.1403 -                <path path="${run.classpath}"/>
  8.1404 -            </classpath>
  8.1405 -        </nbprofiledirect>
  8.1406 -        <profile/>
  8.1407 -    </target>
  8.1408 -    <target depends="profile-init,compile-single" description="Profile a selected class in the IDE." if="profiler.info.jvmargs.agent" name="-profile-single-pre72">
  8.1409 -        <fail unless="profile.class">Must select one file in the IDE or set profile.class</fail>
  8.1410 -        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  8.1411 -        <nbprofiledirect>
  8.1412 -            <classpath>
  8.1413 -                <path path="${run.classpath}"/>
  8.1414 -            </classpath>
  8.1415 -        </nbprofiledirect>
  8.1416 -        <profile classname="${profile.class}"/>
  8.1417 -    </target>
  8.1418 -    <target depends="profile-init,compile-single" if="profiler.info.jvmargs.agent" name="-profile-applet-pre72">
  8.1419 -        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  8.1420 -        <nbprofiledirect>
  8.1421 -            <classpath>
  8.1422 -                <path path="${run.classpath}"/>
  8.1423 -            </classpath>
  8.1424 -        </nbprofiledirect>
  8.1425 -        <profile classname="sun.applet.AppletViewer">
  8.1426 -            <customize>
  8.1427 -                <arg value="${applet.url}"/>
  8.1428 -            </customize>
  8.1429 -        </profile>
  8.1430 -    </target>
  8.1431 -    <target depends="-init-macrodef-junit,profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  8.1432 -        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  8.1433 -        <nbprofiledirect>
  8.1434 -            <classpath>
  8.1435 -                <path path="${run.test.classpath}"/>
  8.1436 -            </classpath>
  8.1437 -        </nbprofiledirect>
  8.1438 -        <j2seproject3:junit excludes="${excludes}" includes="${includes}" testincludes="${profile.class}" testmethods="">
  8.1439 -            <customize>
  8.1440 -                <jvmarg value="-agentlib:jdwp=transport=${debug-transport},address=${jpda.address}"/>
  8.1441 -                <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  8.1442 -                <jvmarg value="${profiler.info.jvmargs.agent}"/>
  8.1443 -                <jvmarg line="${profiler.info.jvmargs}"/>
  8.1444 -                <classpath>
  8.1445 -                    <path path="${run.test.classpath}"/>
  8.1446 -                </classpath>
  8.1447 -            </customize>
  8.1448 -        </j2seproject3:junit>
  8.1449 -    </target>
  8.1450 -    <!--
  8.1451 -                end of pre NB72 profiling section
  8.1452 -            -->
  8.1453 -    <target if="netbeans.home" name="-profile-check">
  8.1454 -        <condition property="profiler.configured">
  8.1455 -            <or>
  8.1456 -                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  8.1457 -                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  8.1458 -            </or>
  8.1459 -        </condition>
  8.1460 -    </target>
  8.1461 -    <target depends="-profile-check,-profile-pre72" description="Profile a project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  8.1462 -        <startprofiler/>
  8.1463 -        <antcall target="run"/>
  8.1464 -    </target>
  8.1465 -    <target depends="-profile-check,-profile-single-pre72" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-single" unless="profiler.info.jvmargs.agent">
  8.1466 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  8.1467 -        <startprofiler/>
  8.1468 -        <antcall target="run-single"/>
  8.1469 -    </target>
  8.1470 -    <target depends="-profile-test-single-pre72" description="Profile a selected test in the IDE." name="profile-test-single"/>
  8.1471 -    <target depends="-profile-check" description="Profile a selected test in the IDE." if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs">
  8.1472 -        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  8.1473 -        <startprofiler/>
  8.1474 -        <antcall target="test-single"/>
  8.1475 -    </target>
  8.1476 -    <target depends="-profile-check" description="Profile a selected class in the IDE." if="profiler.configured" name="profile-test-with-main">
  8.1477 -        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  8.1478 -        <startprofiler/>
  8.1479 -        <antcall target="run-test-with-main"/>
  8.1480 -    </target>
  8.1481 -    <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet" unless="profiler.info.jvmargs.agent">
  8.1482 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  8.1483 -        <startprofiler/>
  8.1484 -        <antcall target="run-applet"/>
  8.1485 -    </target>
  8.1486 -    <!--
  8.1487 -                ===============
  8.1488 -                JAVADOC SECTION
  8.1489 -                ===============
  8.1490 -            -->
  8.1491 -    <target depends="init" if="have.sources" name="-javadoc-build">
  8.1492 -        <mkdir dir="${dist.javadoc.dir}"/>
  8.1493 -        <condition else="" property="javadoc.endorsed.classpath.cmd.line.arg" value="-J${endorsed.classpath.cmd.line.arg}">
  8.1494 -            <and>
  8.1495 -                <isset property="endorsed.classpath.cmd.line.arg"/>
  8.1496 -                <not>
  8.1497 -                    <equals arg1="${endorsed.classpath.cmd.line.arg}" arg2=""/>
  8.1498 -                </not>
  8.1499 -            </and>
  8.1500 -        </condition>
  8.1501 -        <condition else="" property="bug5101868workaround" value="*.java">
  8.1502 -            <matches pattern="1\.[56](\..*)?" string="${java.version}"/>
  8.1503 -        </condition>
  8.1504 -        <condition else="" property="javadoc.html5.cmd.line.arg" value="-html5">
  8.1505 -            <and>
  8.1506 -                <isset property="javadoc.html5"/>
  8.1507 -                <available file="${jdk.home}${file.separator}lib${file.separator}jrt-fs.jar"/>
  8.1508 -            </and>
  8.1509 -        </condition>
  8.1510 -        <javadoc additionalparam="-J-Dfile.encoding=${file.encoding} ${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  8.1511 -            <classpath>
  8.1512 -                <path path="${javac.classpath}"/>
  8.1513 -            </classpath>
  8.1514 -            <fileset dir="${src.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
  8.1515 -                <filename name="**/*.java"/>
  8.1516 -            </fileset>
  8.1517 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  8.1518 -                <include name="**/*.java"/>
  8.1519 -                <exclude name="*.java"/>
  8.1520 -            </fileset>
  8.1521 -            <arg line="${javadoc.endorsed.classpath.cmd.line.arg}"/>
  8.1522 -            <arg line="${javadoc.html5.cmd.line.arg}"/>
  8.1523 -        </javadoc>
  8.1524 -        <copy todir="${dist.javadoc.dir}">
  8.1525 -            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  8.1526 -                <filename name="**/doc-files/**"/>
  8.1527 -            </fileset>
  8.1528 -            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  8.1529 -                <include name="**/doc-files/**"/>
  8.1530 -            </fileset>
  8.1531 -        </copy>
  8.1532 -    </target>
  8.1533 -    <target depends="init,-javadoc-build" if="netbeans.home" name="-javadoc-browse" unless="no.javadoc.preview">
  8.1534 -        <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  8.1535 -    </target>
  8.1536 -    <target depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc." name="javadoc"/>
  8.1537 -    <!--
  8.1538 -                =========================
  8.1539 -                TEST COMPILATION SECTION
  8.1540 -                =========================
  8.1541 -            -->
  8.1542 -    <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  8.1543 -        <mkdir dir="${build.test.classes.dir}"/>
  8.1544 -    </target>
  8.1545 -    <target name="-pre-compile-test">
  8.1546 -        <!-- Empty placeholder for easier customization. -->
  8.1547 -        <!-- You can override this target in the ../build.xml file. -->
  8.1548 -    </target>
  8.1549 -    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-javac-module-properties-with-module">
  8.1550 -        <j2seproject3:modulename property="test.module.name" sourcepath="${test.src.dir}"/>
  8.1551 -        <condition else="${empty.dir}" property="javac.test.sourcepath" value="${test.src.dir}">
  8.1552 -            <and>
  8.1553 -                <isset property="test.module.name"/>
  8.1554 -                <length length="0" string="${test.module.name}" when="greater"/>
  8.1555 -            </and>
  8.1556 -        </condition>
  8.1557 -        <condition else="--patch-module ${module.name}=${test.src.dir} --add-reads ${module.name}=ALL-UNNAMED" property="javac.test.compilerargs" value="--add-reads ${test.module.name}=ALL-UNNAMED">
  8.1558 -            <and>
  8.1559 -                <isset property="test.module.name"/>
  8.1560 -                <length length="0" string="${test.module.name}" when="greater"/>
  8.1561 -            </and>
  8.1562 -        </condition>
  8.1563 -    </target>
  8.1564 -    <target depends="-init-source-module-properties" if="named.module.internal" name="-init-test-run-module-properties">
  8.1565 -        <condition else="${module.name}" property="run.test.addexport.source.module.internal" value="${test.module.name}">
  8.1566 -            <and>
  8.1567 -                <isset property="test.module.name"/>
  8.1568 -                <length length="0" string="${test.module.name}" when="greater"/>
  8.1569 -            </and>
  8.1570 -        </condition>
  8.1571 -        <fileset dir="${build.test.classes.dir}" id="run.test.packages.internal" includes="**/*.class"/>
  8.1572 -        <property location="${build.test.classes.dir}" name="build.test.classes.dir.abs.internal"/>
  8.1573 -        <pathconvert pathsep=" " property="run.test.addexports.internal" refid="run.test.packages.internal">
  8.1574 -            <chainedmapper>
  8.1575 -                <regexpmapper from="^(.*)\Q${file.separator}\E.*\.class$$" to="\1"/>
  8.1576 -                <filtermapper>
  8.1577 -                    <uniqfilter/>
  8.1578 -                    <replacestring from="${build.test.classes.dir.abs.internal}" to=""/>
  8.1579 -                </filtermapper>
  8.1580 -                <cutdirsmapper dirs="1"/>
  8.1581 -                <packagemapper from="*" to="--add-exports ${run.test.addexport.source.module.internal}/*=ALL-UNNAMED"/>
  8.1582 -            </chainedmapper>
  8.1583 -        </pathconvert>
  8.1584 -        <condition else="--patch-module ${module.name}=${build.test.classes.dir} --add-modules ${module.name} --add-reads ${module.name}=ALL-UNNAMED ${run.test.addexports.internal}" property="run.test.jvmargs" value="--add-modules ${test.module.name} --add-reads ${test.module.name}=ALL-UNNAMED ${run.test.addexports.internal}">
  8.1585 -            <and>
  8.1586 -                <isset property="test.module.name"/>
  8.1587 -                <length length="0" string="${test.module.name}" when="greater"/>
  8.1588 -            </and>
  8.1589 -        </condition>
  8.1590 -    </target>
  8.1591 -    <target depends="-init-source-module-properties" name="-init-test-module-properties-without-module" unless="named.module.internal">
  8.1592 -        <property name="javac.test.sourcepath" value="${empty.dir}"/>
  8.1593 -        <property name="javac.test.compilerargs" value=""/>
  8.1594 -        <property name="run.test.jvmargs" value=""/>
  8.1595 -    </target>
  8.1596 -    <target depends="-init-test-javac-module-properties-with-module,-init-test-module-properties-without-module" name="-init-test-module-properties"/>
  8.1597 -    <target if="do.depend.true" name="-compile-test-depend">
  8.1598 -        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  8.1599 -    </target>
  8.1600 -    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
  8.1601 -        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${javac.test.sourcepath}" srcdir="${test.src.dir}">
  8.1602 -            <customize>
  8.1603 -                <compilerarg line="${javac.test.compilerargs}"/>
  8.1604 -            </customize>
  8.1605 -        </j2seproject3:javac>
  8.1606 -        <copy todir="${build.test.classes.dir}">
  8.1607 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  8.1608 -        </copy>
  8.1609 -    </target>
  8.1610 -    <target name="-post-compile-test">
  8.1611 -        <!-- Empty placeholder for easier customization. -->
  8.1612 -        <!-- You can override this target in the ../build.xml file. -->
  8.1613 -    </target>
  8.1614 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test" name="compile-test"/>
  8.1615 -    <target name="-pre-compile-test-single">
  8.1616 -        <!-- Empty placeholder for easier customization. -->
  8.1617 -        <!-- You can override this target in the ../build.xml file. -->
  8.1618 -    </target>
  8.1619 -    <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  8.1620 -        <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  8.1621 -        <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
  8.1622 -        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}, module-info.java" modulepath="${javac.test.modulepath}" processorpath="${javac.test.processorpath}" sourcepath="${test.src.dir}" srcdir="${test.src.dir}">
  8.1623 -            <customize>
  8.1624 -                <compilerarg line="${javac.test.compilerargs}"/>
  8.1625 -            </customize>
  8.1626 -        </j2seproject3:javac>
  8.1627 -        <copy todir="${build.test.classes.dir}">
  8.1628 -            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  8.1629 -        </copy>
  8.1630 -    </target>
  8.1631 -    <target name="-post-compile-test-single">
  8.1632 -        <!-- Empty placeholder for easier customization. -->
  8.1633 -        <!-- You can override this target in the ../build.xml file. -->
  8.1634 -    </target>
  8.1635 -    <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  8.1636 -    <!--
  8.1637 -                =======================
  8.1638 -                TEST EXECUTION SECTION
  8.1639 -                =======================
  8.1640 -            -->
  8.1641 -    <target depends="init" if="have.tests" name="-pre-test-run">
  8.1642 -        <mkdir dir="${build.test.results.dir}"/>
  8.1643 -    </target>
  8.1644 -    <target depends="init,compile-test,-init-test-run-module-properties,-pre-test-run" if="have.tests" name="-do-test-run">
  8.1645 -        <j2seproject3:test includes="${includes}" testincludes="**/*Test.java"/>
  8.1646 -    </target>
  8.1647 -    <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  8.1648 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  8.1649 -    </target>
  8.1650 -    <target depends="init" if="have.tests" name="test-report"/>
  8.1651 -    <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  8.1652 -    <target depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests." name="test"/>
  8.1653 -    <target depends="init" if="have.tests" name="-pre-test-run-single">
  8.1654 -        <mkdir dir="${build.test.results.dir}"/>
  8.1655 -    </target>
  8.1656 -    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  8.1657 -        <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  8.1658 -        <j2seproject3:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  8.1659 -    </target>
  8.1660 -    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  8.1661 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  8.1662 -    </target>
  8.1663 -    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  8.1664 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  8.1665 -        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  8.1666 -        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  8.1667 -        <j2seproject3:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  8.1668 -    </target>
  8.1669 -    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  8.1670 -        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  8.1671 -    </target>
  8.1672 -    <target depends="init,compile-test-single,-init-test-run-module-properties,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  8.1673 -    <!--
  8.1674 -                =======================
  8.1675 -                TEST DEBUGGING SECTION
  8.1676 -                =======================
  8.1677 -            -->
  8.1678 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  8.1679 -        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  8.1680 -        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  8.1681 -    </target>
  8.1682 -    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  8.1683 -        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  8.1684 -        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  8.1685 -        <j2seproject3:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  8.1686 -    </target>
  8.1687 -    <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  8.1688 -        <j2seproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  8.1689 -    </target>
  8.1690 -    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  8.1691 -    <target depends="init,compile-test-single,-init-test-run-module-properties,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  8.1692 -    <target depends="debug-test-method" name="debug-single-method"/>
  8.1693 -    <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  8.1694 -        <j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  8.1695 -    </target>
  8.1696 -    <target depends="init,-pre-debug-fix,-do-debug-fix-test" if="netbeans.home" name="debug-fix-test"/>
  8.1697 -    <!--
  8.1698 -                =========================
  8.1699 -                APPLET EXECUTION SECTION
  8.1700 -                =========================
  8.1701 -            -->
  8.1702 -    <target depends="init,compile-single" name="run-applet">
  8.1703 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  8.1704 -        <j2seproject1:java classname="sun.applet.AppletViewer">
  8.1705 -            <customize>
  8.1706 -                <arg value="${applet.url}"/>
  8.1707 -            </customize>
  8.1708 -        </j2seproject1:java>
  8.1709 -    </target>
  8.1710 -    <!--
  8.1711 -                =========================
  8.1712 -                APPLET DEBUGGING  SECTION
  8.1713 -                =========================
  8.1714 -            -->
  8.1715 -    <target depends="init,compile-single" if="netbeans.home" name="-debug-start-debuggee-applet">
  8.1716 -        <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
  8.1717 -        <j2seproject3:debug classname="sun.applet.AppletViewer">
  8.1718 -            <customizeDebuggee>
  8.1719 -                <arg value="${applet.url}"/>
  8.1720 -            </customizeDebuggee>
  8.1721 -        </j2seproject3:debug>
  8.1722 -    </target>
  8.1723 -    <target depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet" if="netbeans.home" name="debug-applet"/>
  8.1724 -    <!--
  8.1725 -                ===============
  8.1726 -                CLEANUP SECTION
  8.1727 -                ===============
  8.1728 -            -->
  8.1729 -    <target name="-deps-clean-init" unless="built-clean.properties">
  8.1730 -        <property location="${build.dir}/built-clean.properties" name="built-clean.properties"/>
  8.1731 -        <delete file="${built-clean.properties}" quiet="true"/>
  8.1732 -    </target>
  8.1733 -    <target if="already.built.clean.${basedir}" name="-warn-already-built-clean">
  8.1734 -        <echo level="warn" message="Cycle detected: rozsirene-atributy was already built"/>
  8.1735 -    </target>
  8.1736 -    <target depends="init,-deps-clean-init" name="deps-clean" unless="no.deps">
  8.1737 -        <mkdir dir="${build.dir}"/>
  8.1738 -        <touch file="${built-clean.properties}" verbose="false"/>
  8.1739 -        <property file="${built-clean.properties}" prefix="already.built.clean."/>
  8.1740 -        <antcall target="-warn-already-built-clean"/>
  8.1741 -        <propertyfile file="${built-clean.properties}">
  8.1742 -            <entry key="${basedir}" value=""/>
  8.1743 -        </propertyfile>
  8.1744 -    </target>
  8.1745 -    <target depends="init" name="-do-clean">
  8.1746 -        <delete dir="${build.dir}"/>
  8.1747 -        <delete dir="${dist.jlink.output}"/>
  8.1748 -        <delete dir="${dist.dir}" followsymlinks="false" includeemptydirs="true"/>
  8.1749 -    </target>
  8.1750 -    <target name="-post-clean">
  8.1751 -        <!-- Empty placeholder for easier customization. -->
  8.1752 -        <!-- You can override this target in the ../build.xml file. -->
  8.1753 -    </target>
  8.1754 -    <target depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products." name="clean"/>
  8.1755 -    <target name="-check-call-dep">
  8.1756 -        <property file="${call.built.properties}" prefix="already.built."/>
  8.1757 -        <condition property="should.call.dep">
  8.1758 -            <and>
  8.1759 -                <not>
  8.1760 -                    <isset property="already.built.${call.subproject}"/>
  8.1761 -                </not>
  8.1762 -                <available file="${call.script}"/>
  8.1763 -            </and>
  8.1764 -        </condition>
  8.1765 -    </target>
  8.1766 -    <target depends="-check-call-dep" if="should.call.dep" name="-maybe-call-dep">
  8.1767 -        <ant antfile="${call.script}" inheritall="false" target="${call.target}">
  8.1768 -            <propertyset>
  8.1769 -                <propertyref prefix="transfer."/>
  8.1770 -                <mapper from="transfer.*" to="*" type="glob"/>
  8.1771 -            </propertyset>
  8.1772 -        </ant>
  8.1773 -    </target>
  8.1774 -</project>
     9.1 --- a/java/rozsirene-atributy/nbproject/genfiles.properties	Sat Dec 16 19:09:35 2023 +0100
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,8 +0,0 @@
     9.4 -build.xml.data.CRC32=ca43bb03
     9.5 -build.xml.script.CRC32=3b4ae2a0
     9.6 -build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
     9.7 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
     9.8 -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
     9.9 -nbproject/build-impl.xml.data.CRC32=ca43bb03
    9.10 -nbproject/build-impl.xml.script.CRC32=e8b330b8
    9.11 -nbproject/build-impl.xml.stylesheet.CRC32=12e0a6c2@1.105.0.48
    10.1 --- a/java/rozsirene-atributy/nbproject/project.properties	Sat Dec 16 19:09:35 2023 +0100
    10.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.3 @@ -1,94 +0,0 @@
    10.4 -#Sun Dec 10 23:58:00 CET 2023
    10.5 -excludes=
    10.6 -javac.test.classpath=\
    10.7 -    ${javac.classpath}:\
    10.8 -    ${build.classes.dir}
    10.9 -run.classpath=\
   10.10 -    ${javac.classpath}:\
   10.11 -    ${build.classes.dir}
   10.12 -javac.processorpath=\
   10.13 -    ${javac.classpath}
   10.14 -dist.javadoc.dir=${dist.dir}/javadoc
   10.15 -jnlp.codebase.user=
   10.16 -jnlp.offline-allowed=false
   10.17 -test.src.dir=test
   10.18 -jnlp.signing.keystore=
   10.19 -jnlp.signing.alias=
   10.20 -run.modulepath=\
   10.21 -    ${javac.modulepath}
   10.22 -annotation.processing.enabled=true
   10.23 -jnlp.codebase.type=user
   10.24 -jar.index=${jnlp.enabled}
   10.25 -build.sysclasspath=ignore
   10.26 -debug.modulepath=${run.modulepath}
   10.27 -javac.compilerargs=
   10.28 -auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
   10.29 -javadoc.noindex=false
   10.30 -javadoc.private=false
   10.31 -jar.archive.disabled=${jnlp.enabled}
   10.32 -javadoc.author=false
   10.33 -endorsed.classpath=
   10.34 -main.class=cz.frantovo.rozsireneatributy.Start\u00e9r
   10.35 -junit.selected.version=4
   10.36 -source.encoding=UTF-8
   10.37 -javac.source=1.7
   10.38 -includes=**
   10.39 -javadoc.use=true
   10.40 -jar.compress=false
   10.41 -javadoc.nonavbar=false
   10.42 -annotation.processing.enabled.in.editor=false
   10.43 -javadoc.notree=false
   10.44 -annotation.processing.processors.list=
   10.45 -javac.deprecation=false
   10.46 -application.vendor=fiki
   10.47 -jlink.launcher=false
   10.48 -javadoc.additionalparam=
   10.49 -manifest.custom.caller.allowable.codebase=
   10.50 -jnlp.mixed.code=default
   10.51 -jnlp.signed=false
   10.52 -jlink.launcher.name=rozsirene-atributy
   10.53 -build.generated.sources.dir=${build.dir}/generated-sources
   10.54 -javadoc.splitindex=true
   10.55 -javac.processormodulepath=
   10.56 -manifest.custom.application.library.allowable.codebase=
   10.57 -run.jvmargs=
   10.58 -javadoc.encoding=${source.encoding}
   10.59 -javac.classpath=
   10.60 -manifest.custom.permissions=
   10.61 -mkdist.disabled=false
   10.62 -run.test.modulepath=\
   10.63 -    ${javac.test.modulepath}
   10.64 -build.classes.excludes=**/*.java,**/*.form
   10.65 -dist.jar=${dist.dir}/rozsirene-atributy.jar
   10.66 -build.classes.dir=${build.dir}/classes
   10.67 -debug.test.modulepath=${run.test.modulepath}
   10.68 -build.test.classes.dir=${build.dir}/test/classes
   10.69 -javadoc.windowtitle=
   10.70 -build.test.results.dir=${build.dir}/test/results
   10.71 -jnlp.enabled=false
   10.72 -dist.dir=dist
   10.73 -build.dir=build
   10.74 -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
   10.75 -build.generated.dir=${build.dir}/generated
   10.76 -javadoc.version=false
   10.77 -application.title=rozsirene-atributy
   10.78 -javac.test.modulepath=\
   10.79 -    ${javac.modulepath}
   10.80 -debug.test.classpath=${run.test.classpath}
   10.81 -javac.external.vm=false
   10.82 -javac.target=1.7
   10.83 -jnlp.signing=
   10.84 -platform.active=default_platform
   10.85 -manifest.file=manifest.mf
   10.86 -manifest.custom.codebase=
   10.87 -javadoc.html5=false
   10.88 -javac.test.processorpath=${javac.test.classpath}
   10.89 -jnlp.descriptor=application
   10.90 -meta.inf.dir=${src.dir}/META-INF
   10.91 -run.test.classpath=\
   10.92 -    ${javac.test.classpath}:\
   10.93 -    ${build.test.classes.dir}
   10.94 -annotation.processing.run.all.processors=true
   10.95 -javac.modulepath=
   10.96 -src.dir=src
   10.97 -debug.classpath=${run.classpath}
    11.1 --- a/java/rozsirene-atributy/nbproject/project.xml	Sat Dec 16 19:09:35 2023 +0100
    11.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.3 @@ -1,15 +0,0 @@
    11.4 -<?xml version="1.0" encoding="UTF-8"?>
    11.5 -<project xmlns="http://www.netbeans.org/ns/project/1">
    11.6 -    <type>org.netbeans.modules.java.j2seproject</type>
    11.7 -    <configuration>
    11.8 -        <data xmlns="http://www.netbeans.org/ns/j2se-project/3">
    11.9 -            <name>rozsirene-atributy</name>
   11.10 -            <source-roots>
   11.11 -                <root id="src.dir"/>
   11.12 -            </source-roots>
   11.13 -            <test-roots>
   11.14 -                <root id="test.src.dir"/>
   11.15 -            </test-roots>
   11.16 -        </data>
   11.17 -    </configuration>
   11.18 -</project>
    12.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Atribut.java	Sat Dec 16 19:09:35 2023 +0100
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,97 +0,0 @@
    12.4 -/**
    12.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    12.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    12.7 - * 
    12.8 - * This program is free software: you can redistribute it and/or modify
    12.9 - * it under the terms of the GNU General Public License as published by
   12.10 - * the Free Software Foundation, either version 3 of the License.
   12.11 - * 
   12.12 - * This program is distributed in the hope that it will be useful,
   12.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   12.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12.15 - * GNU General Public License for more details.
   12.16 - * 
   12.17 - * You should have received a copy of the GNU General Public License
   12.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   12.19 - */
   12.20 -package cz.frantovo.rozsireneatributy;
   12.21 -
   12.22 -import java.nio.ByteBuffer;
   12.23 -import java.nio.charset.Charset;
   12.24 -
   12.25 -/**
   12.26 - * @author Ing. František Kučera (frantovo.cz)
   12.27 - */
   12.28 -public class Atribut {
   12.29 -
   12.30 -	private String klíč;
   12.31 -	private String hodnota;
   12.32 -
   12.33 -	public Atribut(String klíč, String hodnota) {
   12.34 -		this.klíč = klíč;
   12.35 -		this.hodnota = hodnota;
   12.36 -	}
   12.37 -
   12.38 -	public Atribut(String klíč, ByteBuffer hodnota) {
   12.39 -		this.klíč = klíč;
   12.40 -		setHodnota(hodnota);
   12.41 -	}
   12.42 -
   12.43 -	public Atribut() {
   12.44 -	}
   12.45 -
   12.46 -	public String getKlíč() {
   12.47 -		return klíč;
   12.48 -	}
   12.49 -
   12.50 -	public void setKlíč(String klíč) {
   12.51 -		this.klíč = klíč;
   12.52 -	}
   12.53 -
   12.54 -	/**
   12.55 -	 * Název atributu musí být nenulový a mít nějakou délku, aby šel uložit
   12.56 -	 * TODO: další kontroly?
   12.57 -	 * @return jestli je platný
   12.58 -	 */
   12.59 -	public boolean isPlatnýKlíč() {
   12.60 -		return klíč != null && klíč.length() > 0;
   12.61 -	}
   12.62 -
   12.63 -	/**
   12.64 -	 * nulová hodnota → smazání atributu
   12.65 -	 * (ale může být prázdný řetězec)
   12.66 -	 * @return jestli je platná
   12.67 -	 */
   12.68 -	public boolean isPlatnáHodnota() {
   12.69 -		return hodnota != null;
   12.70 -	}
   12.71 -
   12.72 -	public String getHodnota() {
   12.73 -		return hodnota;
   12.74 -	}
   12.75 -
   12.76 -	public final ByteBuffer getHodnotaBajty() {
   12.77 -		return zakóduj(getHodnota());
   12.78 -	}
   12.79 -
   12.80 -	public void setHodnota(String hodnota) {
   12.81 -		this.hodnota = hodnota;
   12.82 -	}
   12.83 -
   12.84 -	public final void setHodnota(ByteBuffer hodnota) {
   12.85 -		setHodnota(dekóduj(hodnota));
   12.86 -	}
   12.87 -
   12.88 -	private static String dekóduj(ByteBuffer bajty) {
   12.89 -		bajty.flip();
   12.90 -		return Charset.defaultCharset().decode(bajty).toString();
   12.91 -	}
   12.92 -
   12.93 -	private static ByteBuffer zakóduj(String text) {
   12.94 -		if (text == null) {
   12.95 -			return null;
   12.96 -		} else {
   12.97 -			return Charset.defaultCharset().encode(text);
   12.98 -		}
   12.99 -	}
  12.100 -}
    13.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CLIParser.java	Sat Dec 16 19:09:35 2023 +0100
    13.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.3 @@ -1,173 +0,0 @@
    13.4 -/**
    13.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    13.6 - * Copyright © 2023 František Kučera (frantovo.cz)
    13.7 - *
    13.8 - * This program is free software: you can redistribute it and/or modify
    13.9 - * it under the terms of the GNU General Public License as published by
   13.10 - * the Free Software Foundation, either version 3 of the License.
   13.11 - *
   13.12 - * This program is distributed in the hope that it will be useful,
   13.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   13.15 - * GNU General Public License for more details.
   13.16 - *
   13.17 - * You should have received a copy of the GNU General Public License
   13.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   13.19 - */
   13.20 -package cz.frantovo.rozsireneatributy;
   13.21 -
   13.22 -import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   13.23 -import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceHodnoty;
   13.24 -import java.io.File;
   13.25 -import java.util.Arrays;
   13.26 -import java.util.Collection;
   13.27 -import java.util.ResourceBundle;
   13.28 -
   13.29 -/**
   13.30 - * Converts command line arguments from String array to object. Checks basic
   13.31 - * constraints (if only supported options are used and if they have correct
   13.32 - * number of parameters)
   13.33 - *
   13.34 - * @author Ing. František Kučera (frantovo.cz)
   13.35 - */
   13.36 -public class CLIParser {
   13.37 -
   13.38 -	private static final ResourceBundle překlady = ResourceBundle
   13.39 -		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   13.40 -
   13.41 -	public Konfigurace parsujParametry(String[] parametry)
   13.42 -		throws CLIParserException {
   13.43 -		Konfigurace k = new Konfigurace();
   13.44 -
   13.45 -		for (int i = 0; i < parametry.length; i++) {
   13.46 -			String parametr = parametry[i];
   13.47 -
   13.48 -			boolean odpovídá = false;
   13.49 -
   13.50 -			for (Token t : Token.values()) {
   13.51 -				if (t.odpovídá(parametr)) {
   13.52 -					int parsedArgs = t.parsuj(parametry, i, k);
   13.53 -					i = i + parsedArgs;
   13.54 -					odpovídá = true;
   13.55 -				}
   13.56 -			}
   13.57 -
   13.58 -			if (!odpovídá) {
   13.59 -				throw new CLIParserException(
   13.60 -					překlady.getString("chyba.cli.neznámýParametr") + parametr);
   13.61 -			}
   13.62 -		}
   13.63 -
   13.64 -		if (k.getSoubor() == null)
   13.65 -			throw new CLIParserException(
   13.66 -					překlady.getString("chyba.cli.chybíSoubor"));
   13.67 -		
   13.68 -		return k;
   13.69 -	}
   13.70 -
   13.71 -	private static String načtiDalší(String[] parametry, int index)
   13.72 -		throws CLIParserException {
   13.73 -		if (index < parametry.length) {
   13.74 -			return parametry[index];
   13.75 -		} else {
   13.76 -			throw new CLIParserException("Expecting value for option: "
   13.77 -				+ parametry[index - 1]);
   13.78 -		}
   13.79 -	}
   13.80 -
   13.81 -	private static boolean načtiDalšíBoolean(String[] parametry, int index)
   13.82 -		throws CLIParserException {
   13.83 -		String s = načtiDalší(parametry, index);
   13.84 -		switch (s) {
   13.85 -			case "true":
   13.86 -			case "ano":
   13.87 -				return true;
   13.88 -			case "false":
   13.89 -			case "ne":
   13.90 -				return false;
   13.91 -			default:
   13.92 -				throw new CLIParserException("Neplatná logická hodnota: " + s);
   13.93 -		}
   13.94 -	}
   13.95 -
   13.96 -	private static enum Token {
   13.97 -
   13.98 -		SOUBOR("--soubor", "--file") {
   13.99 -			@Override
  13.100 -			public int parsuj(String[] parametry, int index, Konfigurace k)
  13.101 -				throws CLIParserException {
  13.102 -				int originalIndex = index;
  13.103 -				k.setSoubor(new File(načtiDalší(parametry, ++index)));
  13.104 -				return index - originalIndex;
  13.105 -			}
  13.106 -		},
  13.107 -		POVINNÉ_ZAMYKÁNÍ("--povinné-zamykání", "--mandatory-locking") {
  13.108 -			@Override
  13.109 -			public int parsuj(String[] parametry, int index, Konfigurace k)
  13.110 -				throws CLIParserException {
  13.111 -				int originalIndex = index;
  13.112 -				k.setPovinnéZamykání(načtiDalšíBoolean(parametry, ++index));
  13.113 -				return index - originalIndex;
  13.114 -			}
  13.115 -		},
  13.116 -		DEFINICE_ATRIBUTU("--definice-atributu", "--attribute-definition") {
  13.117 -			@Override
  13.118 -			public int parsuj(String[] parametry, int index, Konfigurace k)
  13.119 -				throws CLIParserException {
  13.120 -				int originalIndex = index;
  13.121 -				String název = načtiDalší(parametry, ++index);
  13.122 -				String popis = načtiDalší(parametry, ++index);
  13.123 -				k.addAtribut(new DefiniceAtributu(název, popis));
  13.124 -				return index - originalIndex;
  13.125 -			}
  13.126 -		},
  13.127 -		HODNOTA_ATRIBUTU("--hodnota", "--value") {
  13.128 -			@Override
  13.129 -			public int parsuj(String[] parametry, int index, Konfigurace k)
  13.130 -				throws CLIParserException {
  13.131 -				int originalIndex = index;
  13.132 -				String hodnota = načtiDalší(parametry, ++index);
  13.133 -				String popis = načtiDalší(parametry, ++index);
  13.134 -
  13.135 -				if (k.getAtributy().isEmpty())
  13.136 -					throw new CLIParserException(
  13.137 -						překlady.getString("chyba.cli.chybíDefiniceAtributu"));
  13.138 -
  13.139 -				k.getAtributy()
  13.140 -					.get(k.getAtributy().size() - 1)
  13.141 -					.addHodnota(new DefiniceHodnoty(hodnota, popis));
  13.142 -
  13.143 -				return index - originalIndex;
  13.144 -			}
  13.145 -		};
  13.146 -
  13.147 -		private final Collection<String> parametry;
  13.148 -
  13.149 -		private Token(String... parametry) {
  13.150 -			this.parametry = Arrays.asList(parametry);
  13.151 -		}
  13.152 -
  13.153 -		/**
  13.154 -		 * @param parametr e.g. „--input-file“
  13.155 -		 * @return whether option is this token
  13.156 -		 */
  13.157 -		public boolean odpovídá(String parametr) {
  13.158 -			return parametry.contains(parametr);
  13.159 -		}
  13.160 -
  13.161 -		/**
  13.162 -		 * Parse String arguments and fill values into the options object.
  13.163 -		 *
  13.164 -		 * @param parametry CLI arguments
  13.165 -		 * @param index index of the option matched by this token, like
  13.166 -		 * „--input-file“
  13.167 -		 * @param k object to be filled
  13.168 -		 * @return number of parsed arguments – if option has no arguments (just
  13.169 -		 * boolean flag), return 0, otherwise return positive integer: number of
  13.170 -		 * eaten arguments.
  13.171 -		 * @throws CLIParserException
  13.172 -		 */
  13.173 -		public abstract int parsuj(String[] parametry, int index, Konfigurace k)
  13.174 -			throws CLIParserException;
  13.175 -	}
  13.176 -}
    14.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CLIParserException.java	Sat Dec 16 19:09:35 2023 +0100
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,39 +0,0 @@
    14.4 -/**
    14.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    14.6 - * Copyright © 2023 František Kučera (frantovo.cz)
    14.7 - *
    14.8 - * This program is free software: you can redistribute it and/or modify
    14.9 - * it under the terms of the GNU General Public License as published by
   14.10 - * the Free Software Foundation, either version 3 of the License.
   14.11 - *
   14.12 - * This program is distributed in the hope that it will be useful,
   14.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   14.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14.15 - * GNU General Public License for more details.
   14.16 - *
   14.17 - * You should have received a copy of the GNU General Public License
   14.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   14.19 - */
   14.20 -package cz.frantovo.rozsireneatributy;
   14.21 -
   14.22 -/**
   14.23 - *
   14.24 - * @author Ing. František Kučera (frantovo.cz)
   14.25 - */
   14.26 -public class CLIParserException extends Exception {
   14.27 -
   14.28 -	public CLIParserException() {
   14.29 -	}
   14.30 -
   14.31 -	public CLIParserException(String message) {
   14.32 -		super(message);
   14.33 -	}
   14.34 -
   14.35 -	public CLIParserException(Throwable cause) {
   14.36 -		super(cause);
   14.37 -	}
   14.38 -
   14.39 -	public CLIParserException(String message, Throwable cause) {
   14.40 -		super(message, cause);
   14.41 -	}
   14.42 -}
    15.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/CSV.java	Sat Dec 16 19:09:35 2023 +0100
    15.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.3 @@ -1,65 +0,0 @@
    15.4 -/**
    15.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    15.6 - * Copyright © 2023 František Kučera (frantovo.cz)
    15.7 - *
    15.8 - * This program is free software: you can redistribute it and/or modify
    15.9 - * it under the terms of the GNU General Public License as published by
   15.10 - * the Free Software Foundation, either version 3 of the License.
   15.11 - *
   15.12 - * This program is distributed in the hope that it will be useful,
   15.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   15.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   15.15 - * GNU General Public License for more details.
   15.16 - *
   15.17 - * You should have received a copy of the GNU General Public License
   15.18 - * along with this program. If not, see <http://www.gnu.org/licenses/>.
   15.19 - */
   15.20 -package cz.frantovo.rozsireneatributy;
   15.21 -
   15.22 -import java.io.IOException;
   15.23 -import java.io.Writer;
   15.24 -
   15.25 -/**
   15.26 - * Generátor standardních CSV.
   15.27 - *
   15.28 - * @author Ing. František Kučera
   15.29 - */
   15.30 -public class CSV {
   15.31 -
   15.32 -	private final Writer výstup;
   15.33 -	private int sloupec = 0;
   15.34 -	private int početSloupců = -1;
   15.35 -
   15.36 -	public CSV(Writer výstup) {
   15.37 -		this.výstup = výstup;
   15.38 -	}
   15.39 -
   15.40 -	public void hodnota(String hodnota) throws IOException {
   15.41 -		if (sloupec > 0) výstup.write(',');
   15.42 -		if (hodnota != null && !hodnota.isEmpty()) {
   15.43 -			výstup.write('"');
   15.44 -			for (char ch : hodnota.toCharArray()) {
   15.45 -				if (ch == '"') výstup.write('"');
   15.46 -				výstup.write(ch);
   15.47 -			}
   15.48 -			výstup.write('"');
   15.49 -		}
   15.50 -		sloupec++;
   15.51 -		výstup.flush();
   15.52 -	}
   15.53 -
   15.54 -	public void konecŘádku() throws IOException {
   15.55 -		if (početSloupců < 0) početSloupců = sloupec;
   15.56 -		if (sloupec == početSloupců) {
   15.57 -			výstup.write("\r\n");
   15.58 -			sloupec = 0;
   15.59 -		} else {
   15.60 -			throw new IOException("Neodpovídá počet sloupců:"
   15.61 -				+ " aktuální=" + sloupec
   15.62 -				+ " celkový=" + početSloupců
   15.63 -			);
   15.64 -		}
   15.65 -		výstup.flush();
   15.66 -	}
   15.67 -
   15.68 -}
    16.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Konfigurace.java	Sat Dec 16 19:09:35 2023 +0100
    16.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.3 @@ -1,122 +0,0 @@
    16.4 -/**
    16.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    16.6 - * Copyright © 2023 František Kučera (frantovo.cz)
    16.7 - *
    16.8 - * This program is free software: you can redistribute it and/or modify
    16.9 - * it under the terms of the GNU General Public License as published by
   16.10 - * the Free Software Foundation, either version 3 of the License.
   16.11 - *
   16.12 - * This program is distributed in the hope that it will be useful,
   16.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16.15 - * GNU General Public License for more details.
   16.16 - *
   16.17 - * You should have received a copy of the GNU General Public License
   16.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   16.19 - */
   16.20 -package cz.frantovo.rozsireneatributy;
   16.21 -
   16.22 -import java.io.File;
   16.23 -import java.util.LinkedList;
   16.24 -import java.util.List;
   16.25 -
   16.26 -/**
   16.27 - * @author Ing. František Kučera (frantovo.cz)
   16.28 - */
   16.29 -public class Konfigurace {
   16.30 -
   16.31 -	public static class DefiniceAtributu {
   16.32 -
   16.33 -		private String název;
   16.34 -		private String popis;
   16.35 -		private final List<DefiniceHodnoty> hodnoty = new LinkedList<>();
   16.36 -
   16.37 -		public DefiniceAtributu(String název, String popis) {
   16.38 -			this.název = název;
   16.39 -			this.popis = popis;
   16.40 -		}
   16.41 -
   16.42 -		public String getNázev() {
   16.43 -			return název;
   16.44 -		}
   16.45 -
   16.46 -		public void setNázev(String název) {
   16.47 -			this.název = název;
   16.48 -		}
   16.49 -
   16.50 -		public String getPopis() {
   16.51 -			return popis;
   16.52 -		}
   16.53 -
   16.54 -		public void setPopis(String popis) {
   16.55 -			this.popis = popis;
   16.56 -		}
   16.57 -
   16.58 -		public List<DefiniceHodnoty> getHodnoty() {
   16.59 -			return hodnoty;
   16.60 -		}
   16.61 -
   16.62 -		public void addHodnota(DefiniceHodnoty hodnota) {
   16.63 -			this.hodnoty.add(hodnota);
   16.64 -		}
   16.65 -
   16.66 -	}
   16.67 -
   16.68 -	public static class DefiniceHodnoty {
   16.69 -
   16.70 -		private String název;
   16.71 -		private String popis;
   16.72 -
   16.73 -		public DefiniceHodnoty(String název, String popis) {
   16.74 -			this.název = název;
   16.75 -			this.popis = popis;
   16.76 -		}
   16.77 -
   16.78 -		public String getNázev() {
   16.79 -			return název;
   16.80 -		}
   16.81 -
   16.82 -		public void setNázev(String název) {
   16.83 -			this.název = název;
   16.84 -		}
   16.85 -
   16.86 -		public String getPopis() {
   16.87 -			return popis;
   16.88 -		}
   16.89 -
   16.90 -		public void setPopis(String popis) {
   16.91 -			this.popis = popis;
   16.92 -		}
   16.93 -	}
   16.94 -
   16.95 -	private File soubor;
   16.96 -
   16.97 -	private boolean povinnéZamykání = false;
   16.98 -
   16.99 -	private final List<DefiniceAtributu> atributy = new LinkedList<>();
  16.100 -
  16.101 -	public File getSoubor() {
  16.102 -		return soubor;
  16.103 -	}
  16.104 -
  16.105 -	public void setSoubor(File soubor) {
  16.106 -		this.soubor = soubor;
  16.107 -	}
  16.108 -
  16.109 -	public boolean isPovinnéZamykání() {
  16.110 -		return povinnéZamykání;
  16.111 -	}
  16.112 -
  16.113 -	public void setPovinnéZamykání(boolean povinnéZamykání) {
  16.114 -		this.povinnéZamykání = povinnéZamykání;
  16.115 -	}
  16.116 -
  16.117 -	public List<DefiniceAtributu> getAtributy() {
  16.118 -		return atributy;
  16.119 -	}
  16.120 -
  16.121 -	public void addAtribut(DefiniceAtributu atribut) {
  16.122 -		this.atributy.add(atribut);
  16.123 -	}
  16.124 -
  16.125 -}
    17.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady.properties	Sat Dec 16 19:09:35 2023 +0100
    17.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.3 @@ -1,1 +0,0 @@
    17.4 -Překlady_cs.properties
    17.5 \ No newline at end of file
    18.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady_cs.properties	Sat Dec 16 19:09:35 2023 +0100
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,25 +0,0 @@
    18.4 -titulek=Roz\u0161\u00ed\u0159en\u00e9 stributy souboru: {0}
    18.5 -
    18.6 -chyba=Chyba:
    18.7 -chyba.titulek=Chyba
    18.8 -chyba.souborNeexistuje=Soubor neexistuje: {0}
    18.9 -chyba.nepoda\u0159iloSeSmazat=Nepoda\u0159ilo se smazat atribut.
   18.10 -chyba.nepoda\u0159iloSeNa\u010d\u00edst=Nepoda\u0159ilo se na\u010d\u00edst atributy.
   18.11 -chyba.nepoda\u0159iloSeZkop\u00edrovat=Nepoda\u0159ilo se zkop\u00edrovat atributy do schr\u00e1nky.
   18.12 -chyba.nepoda\u0159iloSeNastavitZ\u00e1mek=Nepoda\u0159ilo se nastavit z\u00e1mek.
   18.13 -chyba.lzeZamknoutJenSoubor=Je podporov\u00e1no zamyk\u00e1n\u00ed pouze norm\u00e1ln\u00edch sobour\u016f ne adres\u00e1\u0159\u016f atd.
   18.14 -chyba.cli.nezn\u00e1m\u00fdParametr=Nezn\u00e1m\u00fd parametr: 
   18.15 -chyba.cli.chyb\u00edDefiniceAtributu=Chyb\u00ed definice atributu (hodnota se vztahuje k n\u00ed).
   18.16 -chyba.cli.chyb\u00edSoubor=Nebyl uveden soubor.
   18.17 -
   18.18 -tabulka.n\u00e1zev=N\u00e1zev
   18.19 -tabulka.hodnota=Hodnota
   18.20 -
   18.21 -schr\u00e1nka.kop\u00edrovat=Kop\u00edrovat
   18.22 -schr\u00e1nka.vlo\u017eit=Vlo\u017eit
   18.23 -
   18.24 -p\u0159idatAtribut=P\u0159idat atribut
   18.25 -smazatAtribut=Smazat atribut
   18.26 -znovuNa\u010d\u00edst=Znovu na\u010d\u00edst
   18.27 -zamknout=Zamknout
   18.28 -zamknout.popis=Otev\u0159e soubor pro z\u00e1pis a vytvo\u0159\u00ed na n\u011bm z\u00e1mek. P\u0159i odemknut\u00ed uvoln\u00ed z\u00e1mek a zav\u0159e soubor.
    19.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Překlady_en.properties	Sat Dec 16 19:09:35 2023 +0100
    19.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.3 @@ -1,25 +0,0 @@
    19.4 -titulek=Extended Attributes of file: {0}
    19.5 -
    19.6 -chyba=Error:
    19.7 -chyba.titulek=Error
    19.8 -chyba.souborNeexistuje=File does not exist: {0}
    19.9 -chyba.nepoda\u0159iloSeSmazat=Failed to delete the attribute.
   19.10 -chyba.nepoda\u0159iloSeNa\u010d\u00edst=Failed to load attributes.
   19.11 -chyba.nepoda\u0159iloSeZkop\u00edrovat=Unable to copy attributes to the clipboard.
   19.12 -chyba.nepoda\u0159iloSeNastavitZ\u00e1mek=Unable to lock the file.
   19.13 -chyba.lzeZamknoutJenSoubor=File locking is supported only for regular files, not for directories or specials.
   19.14 -chyba.cli.nezn\u00e1m\u00fdParametr=Unknown option: 
   19.15 -chyba.cli.chyb\u00edDefiniceAtributu=Missing attribute definition (value is associated with it).
   19.16 -chyba.cli.chyb\u00edSoubor=File name was not specified.
   19.17 -
   19.18 -tabulka.n\u00e1zev=Name
   19.19 -tabulka.hodnota=Value
   19.20 -
   19.21 -schr\u00e1nka.kop\u00edrovat=Copy
   19.22 -schr\u00e1nka.vlo\u017eit=Paste
   19.23 -
   19.24 -p\u0159idatAtribut=Add attribute
   19.25 -smazatAtribut=Delete attribute
   19.26 -znovuNa\u010d\u00edst=Reload all
   19.27 -zamknout=Lock
   19.28 -zamknout.popis=Open the file for write and lock it. On unlocking, release the lock and close the file.
    20.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/Startér.java	Sat Dec 16 19:09:35 2023 +0100
    20.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.3 @@ -1,111 +0,0 @@
    20.4 -/**
    20.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    20.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    20.7 - *
    20.8 - * This program is free software: you can redistribute it and/or modify
    20.9 - * it under the terms of the GNU General Public License as published by
   20.10 - * the Free Software Foundation, either version 3 of the License.
   20.11 - *
   20.12 - * This program is distributed in the hope that it will be useful,
   20.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   20.15 - * GNU General Public License for more details.
   20.16 - *
   20.17 - * You should have received a copy of the GNU General Public License
   20.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   20.19 - */
   20.20 -package cz.frantovo.rozsireneatributy;
   20.21 -
   20.22 -import cz.frantovo.rozsireneatributy.gui.Model;
   20.23 -import cz.frantovo.rozsireneatributy.gui.Panel;
   20.24 -import java.awt.BorderLayout;
   20.25 -import java.awt.event.ActionEvent;
   20.26 -import java.awt.event.ActionListener;
   20.27 -import java.awt.event.KeyEvent;
   20.28 -import java.io.File;
   20.29 -import java.text.MessageFormat;
   20.30 -import java.util.ResourceBundle;
   20.31 -import java.util.logging.Level;
   20.32 -import java.util.logging.Logger;
   20.33 -import javax.swing.JComponent;
   20.34 -import javax.swing.JFrame;
   20.35 -import javax.swing.JOptionPane;
   20.36 -import javax.swing.KeyStroke;
   20.37 -
   20.38 -/**
   20.39 - * Spouštěč programu
   20.40 - *
   20.41 - * http://freedesktop.org/wiki/CommonExtendedAttributes
   20.42 - * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user
   20.43 - * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html
   20.44 - * #so-what-is-a-path-really
   20.45 - *
   20.46 - * $ setfattr -n "user.franta.pozdrav" -v 'Dobrý den!' pokus.txt (v javě pak
   20.47 - * pracujeme s klíči bez předpony „user.“)
   20.48 - *
   20.49 - * @author Ing. František Kučera (frantovo.cz)
   20.50 - */
   20.51 -public class Startér {
   20.52 -
   20.53 -	private static final Logger log = Logger
   20.54 -		.getLogger(Startér.class.getSimpleName());
   20.55 -	private static final ResourceBundle překlady = ResourceBundle
   20.56 -		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   20.57 -
   20.58 -	/**
   20.59 -	 * @param args název souboru
   20.60 -	 */
   20.61 -	public static void main(String[] args) {
   20.62 -
   20.63 -		try {
   20.64 -			// TODO: načítat konfiguraci i z XML souboru
   20.65 -			CLIParser parser = new CLIParser();
   20.66 -			Konfigurace konfigurace = parser.parsujParametry(args);
   20.67 -
   20.68 -			File soubor = konfigurace.getSoubor();
   20.69 -
   20.70 -			if (soubor.exists()) {
   20.71 -				log.log(Level.INFO, "Pracuji se souborem: {0}", soubor);
   20.72 -
   20.73 -				Model model = new Model(konfigurace);
   20.74 -
   20.75 -				final JFrame f = new JFrame();
   20.76 -				Panel p = new Panel(model);
   20.77 -
   20.78 -				f.setLayout(new BorderLayout());
   20.79 -				f.add(p, BorderLayout.CENTER);
   20.80 -
   20.81 -				// Ukončení programu klávesou Escape:
   20.82 -				f.getRootPane().registerKeyboardAction(new ActionListener() {
   20.83 -
   20.84 -					@Override
   20.85 -					public void actionPerformed(ActionEvent ae) {
   20.86 -						f.dispose();
   20.87 -					}
   20.88 -				},
   20.89 -					KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
   20.90 -					JComponent.WHEN_IN_FOCUSED_WINDOW);
   20.91 -
   20.92 -				f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   20.93 -				f.setTitle(MessageFormat
   20.94 -					.format(překlady.getString("titulek"), soubor));
   20.95 -				f.setSize(640, 240);
   20.96 -				f.setLocationRelativeTo(null);
   20.97 -				f.setVisible(true);
   20.98 -			} else {
   20.99 -				ukončiChybou(MessageFormat.format(překlady
  20.100 -					.getString("chyba.souborNeexistuje"), soubor));
  20.101 -			}
  20.102 -		} catch (Exception e) {
  20.103 -			log.log(Level.SEVERE, překlady.getString("chyba"), e);
  20.104 -			ukončiChybou(e.getLocalizedMessage());
  20.105 -		}
  20.106 -	}
  20.107 -
  20.108 -	private static void ukončiChybou(String hláška) {
  20.109 -		log.log(Level.SEVERE, hláška);
  20.110 -		JOptionPane.showMessageDialog(null, hláška, překlady
  20.111 -			.getString("chyba.titulek"), JOptionPane.ERROR_MESSAGE);
  20.112 -		System.exit(1);
  20.113 -	}
  20.114 -}
    21.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/EditorHodnotAtributů.java	Sat Dec 16 19:09:35 2023 +0100
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,155 +0,0 @@
    21.4 -/**
    21.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    21.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    21.7 - *
    21.8 - * This program is free software: you can redistribute it and/or modify
    21.9 - * it under the terms of the GNU General Public License as published by
   21.10 - * the Free Software Foundation, either version 3 of the License.
   21.11 - *
   21.12 - * This program is distributed in the hope that it will be useful,
   21.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   21.15 - * GNU General Public License for more details.
   21.16 - *
   21.17 - * You should have received a copy of the GNU General Public License
   21.18 - * along with this program. If not, see <http://www.gnu.org/licenses/>.
   21.19 - */
   21.20 -package cz.frantovo.rozsireneatributy.gui;
   21.21 -
   21.22 -import cz.frantovo.rozsireneatributy.Konfigurace;
   21.23 -import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   21.24 -import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceHodnoty;
   21.25 -import java.awt.Component;
   21.26 -import java.awt.event.ActionEvent;
   21.27 -import java.awt.event.ActionListener;
   21.28 -import java.util.EventObject;
   21.29 -import java.util.Objects;
   21.30 -import javax.swing.JComboBox;
   21.31 -import javax.swing.JTable;
   21.32 -import javax.swing.event.CellEditorListener;
   21.33 -import javax.swing.event.ChangeEvent;
   21.34 -import javax.swing.event.EventListenerList;
   21.35 -import javax.swing.table.TableCellEditor;
   21.36 -import javax.swing.table.TableModel;
   21.37 -
   21.38 -/**
   21.39 - * Umožňuje výběr hodnoty atributu z předvoleného seznamu.
   21.40 - *
   21.41 - * @author Ing. František Kučera (frantovo.cz)
   21.42 - */
   21.43 -public class EditorHodnotAtributů
   21.44 -	extends JComboBox<String>
   21.45 -	implements TableCellEditor {
   21.46 -
   21.47 -	private final Konfigurace konfigurace;
   21.48 -	private JTable tabulka;
   21.49 -	private TableModel model;
   21.50 -	private int řádek;
   21.51 -	private int sloupec;
   21.52 -	protected EventListenerList posluchače = new EventListenerList();
   21.53 -	protected ChangeEvent událost = new ChangeEvent(this);
   21.54 -
   21.55 -	public EditorHodnotAtributů(Konfigurace konfigurace) {
   21.56 -		super();
   21.57 -		this.konfigurace = konfigurace;
   21.58 -		setEditable(true);
   21.59 -		addActionListener(new ActionListener() {
   21.60 -
   21.61 -			@Override
   21.62 -			public void actionPerformed(ActionEvent e) {
   21.63 -				fireEditiaceSkončila();
   21.64 -			}
   21.65 -		});
   21.66 -	}
   21.67 -
   21.68 -	protected void fireEditiaceSkončila() {
   21.69 -		for (Object posluchač : posluchače.getListenerList()) {
   21.70 -			if (posluchač instanceof CellEditorListener) {
   21.71 -				((CellEditorListener) posluchač).editingStopped(událost);
   21.72 -			}
   21.73 -		}
   21.74 -	}
   21.75 -
   21.76 -	protected void fireEditiaceZrušena() {
   21.77 -		for (Object posluchač : posluchače.getListenerList()) {
   21.78 -			if (posluchač instanceof CellEditorListener) {
   21.79 -				((CellEditorListener) posluchač).editingCanceled(událost);
   21.80 -			}
   21.81 -		}
   21.82 -	}
   21.83 -
   21.84 -	private void obnovHodnoty(Object hodnotaAtributu) {
   21.85 -		removeAllItems();
   21.86 -
   21.87 -		if (hodnotaAtributu == null) {
   21.88 -			hodnotaAtributu = "";
   21.89 -		} else if (!(hodnotaAtributu instanceof String)) {
   21.90 -			hodnotaAtributu = String.valueOf(hodnotaAtributu);
   21.91 -		}
   21.92 -		addItem((String) hodnotaAtributu);
   21.93 -		setSelectedItem(hodnotaAtributu);
   21.94 -
   21.95 -		Object názevAtributu = model.getValueAt(řádek, Panel.SLOUPEC_NÁZVU);
   21.96 -		for (DefiniceAtributu da : konfigurace.getAtributy()) {
   21.97 -			if (Objects.equals(názevAtributu, da.getNázev())) {
   21.98 -				for (DefiniceHodnoty dh : da.getHodnoty()) {
   21.99 -					addItem(dh.getNázev());
  21.100 -				}
  21.101 -			}
  21.102 -		}
  21.103 -
  21.104 -	}
  21.105 -
  21.106 -	@Override
  21.107 -	public Component getTableCellEditorComponent(
  21.108 -		JTable tabulka,
  21.109 -		Object hodnota,
  21.110 -		boolean vybraná,
  21.111 -		int řádek,
  21.112 -		int sloupec) //
  21.113 -	{
  21.114 -		this.řádek = řádek;
  21.115 -		this.sloupec = sloupec;
  21.116 -		this.tabulka = tabulka;
  21.117 -		this.model = tabulka.getModel();
  21.118 -		obnovHodnoty(hodnota);
  21.119 -		// TODO: více různých instancí?
  21.120 -		return this;
  21.121 -	}
  21.122 -
  21.123 -	@Override
  21.124 -	public Object getCellEditorValue() {
  21.125 -		return getSelectedItem();
  21.126 -	}
  21.127 -
  21.128 -	@Override
  21.129 -	public boolean isCellEditable(EventObject anEvent) {
  21.130 -		return true;
  21.131 -	}
  21.132 -
  21.133 -	@Override
  21.134 -	public boolean shouldSelectCell(EventObject anEvent) {
  21.135 -		return true;
  21.136 -	}
  21.137 -
  21.138 -	@Override
  21.139 -	public boolean stopCellEditing() {
  21.140 -		fireEditiaceSkončila();
  21.141 -		return true;
  21.142 -	}
  21.143 -
  21.144 -	@Override
  21.145 -	public void cancelCellEditing() {
  21.146 -		fireEditiaceZrušena();
  21.147 -	}
  21.148 -
  21.149 -	@Override
  21.150 -	public void addCellEditorListener(CellEditorListener l) {
  21.151 -		posluchače.add(CellEditorListener.class, l);
  21.152 -	}
  21.153 -
  21.154 -	@Override
  21.155 -	public void removeCellEditorListener(CellEditorListener l) {
  21.156 -		posluchače.remove(CellEditorListener.class, l);
  21.157 -	}
  21.158 -}
    22.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/EditorNázvůAtributů.java	Sat Dec 16 19:09:35 2023 +0100
    22.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.3 @@ -1,190 +0,0 @@
    22.4 -/**
    22.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    22.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    22.7 - *
    22.8 - * This program is free software: you can redistribute it and/or modify
    22.9 - * it under the terms of the GNU General Public License as published by
   22.10 - * the Free Software Foundation, either version 3 of the License.
   22.11 - *
   22.12 - * This program is distributed in the hope that it will be useful,
   22.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   22.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   22.15 - * GNU General Public License for more details.
   22.16 - *
   22.17 - * You should have received a copy of the GNU General Public License
   22.18 - * along with this program. If not, see <http://www.gnu.org/licenses/>.
   22.19 - */
   22.20 -package cz.frantovo.rozsireneatributy.gui;
   22.21 -
   22.22 -import cz.frantovo.rozsireneatributy.Konfigurace;
   22.23 -import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   22.24 -import java.awt.Component;
   22.25 -import java.awt.event.ActionEvent;
   22.26 -import java.awt.event.ActionListener;
   22.27 -import java.util.EventObject;
   22.28 -import javax.swing.JComboBox;
   22.29 -import javax.swing.JTable;
   22.30 -import javax.swing.event.CellEditorListener;
   22.31 -import javax.swing.event.ChangeEvent;
   22.32 -import javax.swing.event.EventListenerList;
   22.33 -import javax.swing.table.TableCellEditor;
   22.34 -
   22.35 -/**
   22.36 - * Umožňuje výběr názvu atributu z předvoleného seznamu
   22.37 - * (standardizované atributy).
   22.38 - *
   22.39 - * @author Ing. František Kučera (frantovo.cz)
   22.40 - */
   22.41 -public class EditorNázvůAtributů
   22.42 -	extends JComboBox<String>
   22.43 -	implements TableCellEditor {
   22.44 -
   22.45 -	private final Konfigurace konfigurace;
   22.46 -	protected EventListenerList posluchače = new EventListenerList();
   22.47 -	protected ChangeEvent událost = new ChangeEvent(this);
   22.48 -
   22.49 -	public EditorNázvůAtributů(Konfigurace konfigurace) {
   22.50 -		super();
   22.51 -		this.konfigurace = konfigurace;
   22.52 -		setEditable(true);
   22.53 -		addActionListener(new ActionListener() {
   22.54 -
   22.55 -			@Override
   22.56 -			public void actionPerformed(ActionEvent e) {
   22.57 -				fireEditiaceSkončila();
   22.58 -			}
   22.59 -		});
   22.60 -	}
   22.61 -
   22.62 -	protected void fireEditiaceSkončila() {
   22.63 -		for (Object posluchač : posluchače.getListenerList()) {
   22.64 -			if (posluchač instanceof CellEditorListener) {
   22.65 -				((CellEditorListener) posluchač).editingStopped(událost);
   22.66 -			}
   22.67 -		}
   22.68 -	}
   22.69 -
   22.70 -	protected void fireEditiaceZrušena() {
   22.71 -		for (Object posluchač : posluchače.getListenerList()) {
   22.72 -			if (posluchač instanceof CellEditorListener) {
   22.73 -				((CellEditorListener) posluchač).editingCanceled(událost);
   22.74 -			}
   22.75 -		}
   22.76 -	}
   22.77 -
   22.78 -	/**
   22.79 -	 * TODO:
   22.80 -	 * - další standardní atributy
   22.81 -	 * - načítat z XML souboru
   22.82 -	 *
   22.83 -	 * @see http://www.freedesktop.org/wiki/CommonExtendedAttributes
   22.84 -	 */
   22.85 -	private void obnovHodnoty(Object názevAtributu) {
   22.86 -		removeAllItems();
   22.87 -
   22.88 -		if (názevAtributu == null) {
   22.89 -			názevAtributu = "";
   22.90 -		} else if (!(názevAtributu instanceof String)) {
   22.91 -			názevAtributu = String.valueOf(názevAtributu);
   22.92 -		}
   22.93 -		addItem((String) názevAtributu);
   22.94 -		setSelectedItem(názevAtributu);
   22.95 -		
   22.96 -		for (DefiniceAtributu da : konfigurace.getAtributy()) {
   22.97 -			addItem(da.getNázev());
   22.98 -		}
   22.99 -		
  22.100 -		if (!konfigurace.getAtributy().isEmpty()) return;
  22.101 -
  22.102 -		// General attributes in current use
  22.103 -		addItem("mime_type");
  22.104 -		addItem("charset");
  22.105 -		addItem("creator");
  22.106 -
  22.107 -		// Proposed metadata attributes
  22.108 -		addItem("xdg.comment");
  22.109 -		addItem("xdg.origin.url");
  22.110 -		addItem("xdg.origin.email.subject");
  22.111 -		addItem("xdg.origin.email.from");
  22.112 -		addItem("xdg.origin.email.message-id");
  22.113 -		addItem("xdg.language");
  22.114 -		addItem("xdg.creator");
  22.115 -		addItem("xdg.publisher");
  22.116 -
  22.117 -		// Proposed control attributes
  22.118 -		addItem("xdg.robots.index");
  22.119 -		addItem("xdg.robots.backup");
  22.120 -
  22.121 -		// Dublin Core
  22.122 -		addItem("dublincore.title");
  22.123 -		addItem("dublincore.creator");
  22.124 -		addItem("dublincore.subject");
  22.125 -		addItem("dublincore.description");
  22.126 -		addItem("dublincore.publisher");
  22.127 -		addItem("dublincore.contributor");
  22.128 -		addItem("dublincore.date");
  22.129 -		addItem("dublincore.type");
  22.130 -		addItem("dublincore.format");
  22.131 -		addItem("dublincore.identifier");
  22.132 -		addItem("dublincore.source");
  22.133 -		addItem("dublincore.language");
  22.134 -		addItem("dublincore.relation");
  22.135 -		addItem("dublincore.coverage");
  22.136 -		addItem("dublincore.rights");
  22.137 -
  22.138 -		// Application-specific attributes in current use
  22.139 -		addItem("mime_encoding");
  22.140 -		addItem("apache_handler");
  22.141 -		addItem("Beagle.AttrTime");
  22.142 -		addItem("Beagle.Fingerprint");
  22.143 -		addItem("Beagle.MTime");
  22.144 -		addItem("Beagle.Uid");
  22.145 -	}
  22.146 -
  22.147 -	@Override
  22.148 -	public Component getTableCellEditorComponent(
  22.149 -		JTable tabulka,
  22.150 -		Object hodnota,
  22.151 -		boolean vybraná,
  22.152 -		int řádek,
  22.153 -		int sloupec) {
  22.154 -		obnovHodnoty(hodnota);
  22.155 -		return this;
  22.156 -	}
  22.157 -
  22.158 -	@Override
  22.159 -	public Object getCellEditorValue() {
  22.160 -		return getSelectedItem();
  22.161 -	}
  22.162 -
  22.163 -	@Override
  22.164 -	public boolean isCellEditable(EventObject anEvent) {
  22.165 -		return true;
  22.166 -	}
  22.167 -
  22.168 -	@Override
  22.169 -	public boolean shouldSelectCell(EventObject anEvent) {
  22.170 -		return true;
  22.171 -	}
  22.172 -
  22.173 -	@Override
  22.174 -	public boolean stopCellEditing() {
  22.175 -		fireEditiaceSkončila();
  22.176 -		return true;
  22.177 -	}
  22.178 -
  22.179 -	@Override
  22.180 -	public void cancelCellEditing() {
  22.181 -		fireEditiaceZrušena();
  22.182 -	}
  22.183 -
  22.184 -	@Override
  22.185 -	public void addCellEditorListener(CellEditorListener l) {
  22.186 -		posluchače.add(CellEditorListener.class, l);
  22.187 -	}
  22.188 -
  22.189 -	@Override
  22.190 -	public void removeCellEditorListener(CellEditorListener l) {
  22.191 -		posluchače.remove(CellEditorListener.class, l);
  22.192 -	}
  22.193 -}
    23.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Model.java	Sat Dec 16 19:09:35 2023 +0100
    23.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.3 @@ -1,218 +0,0 @@
    23.4 -/**
    23.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    23.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    23.7 - *
    23.8 - * This program is free software: you can redistribute it and/or modify
    23.9 - * it under the terms of the GNU General Public License as published by
   23.10 - * the Free Software Foundation, either version 3 of the License.
   23.11 - *
   23.12 - * This program is distributed in the hope that it will be useful,
   23.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   23.15 - * GNU General Public License for more details.
   23.16 - *
   23.17 - * You should have received a copy of the GNU General Public License
   23.18 - * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   23.19 - */
   23.20 -package cz.frantovo.rozsireneatributy.gui;
   23.21 -
   23.22 -import cz.frantovo.rozsireneatributy.Atribut;
   23.23 -import cz.frantovo.rozsireneatributy.Konfigurace;
   23.24 -import java.io.File;
   23.25 -import java.io.IOException;
   23.26 -import java.io.RandomAccessFile;
   23.27 -import java.nio.ByteBuffer;
   23.28 -import java.nio.channels.FileChannel;
   23.29 -import java.nio.channels.FileLock;
   23.30 -import java.nio.file.Path;
   23.31 -import java.nio.file.attribute.UserDefinedFileAttributeView;
   23.32 -import java.nio.file.spi.FileSystemProvider;
   23.33 -import java.util.ArrayList;
   23.34 -import java.util.HashSet;
   23.35 -import java.util.List;
   23.36 -import java.util.ResourceBundle;
   23.37 -import java.util.Set;
   23.38 -import java.util.logging.Level;
   23.39 -import java.util.logging.Logger;
   23.40 -import javax.swing.event.TableModelEvent;
   23.41 -import javax.swing.event.TableModelListener;
   23.42 -import javax.swing.table.TableModel;
   23.43 -
   23.44 -/**
   23.45 - * @author Ing. František Kučera (frantovo.cz)
   23.46 - */
   23.47 -public class Model implements TableModel {
   23.48 -
   23.49 -	private static final Logger log = Logger
   23.50 -		.getLogger(Model.class.getSimpleName());
   23.51 -	private static final ResourceBundle překlady = ResourceBundle
   23.52 -		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   23.53 -	private final String[] sloupečky = {
   23.54 -		překlady.getString("tabulka.název"),
   23.55 -		překlady.getString("tabulka.hodnota")
   23.56 -	};
   23.57 -	private final Set<TableModelListener> posluchače = new HashSet<>();
   23.58 -	private final Konfigurace konfigurace;
   23.59 -	private final UserDefinedFileAttributeView souborovýSystém;
   23.60 -	private final List<Atribut> atributy = new ArrayList<>();
   23.61 -
   23.62 -	private RandomAccessFile zámekSoubor;
   23.63 -	private FileChannel zámekKanál;
   23.64 -	private FileLock zámek;
   23.65 -
   23.66 -	public Model(Konfigurace konfigurace) throws IOException {
   23.67 -		this.konfigurace = konfigurace;
   23.68 -		Path cesta = konfigurace.getSoubor().toPath();
   23.69 -		FileSystemProvider posyktovatelFS = cesta.getFileSystem().provider();
   23.70 -		souborovýSystém = posyktovatelFS
   23.71 -			.getFileAttributeView(cesta, UserDefinedFileAttributeView.class);
   23.72 -		načtiAtributy();
   23.73 -	}
   23.74 -
   23.75 -	public Konfigurace getKonfigurace() {
   23.76 -		return konfigurace;
   23.77 -	}
   23.78 -
   23.79 -	@Override
   23.80 -	public int getRowCount() {
   23.81 -		return atributy.size();
   23.82 -	}
   23.83 -
   23.84 -	@Override
   23.85 -	public int getColumnCount() {
   23.86 -		return sloupečky.length;
   23.87 -	}
   23.88 -
   23.89 -	@Override
   23.90 -	public String getColumnName(int n) {
   23.91 -		return sloupečky[n];
   23.92 -	}
   23.93 -
   23.94 -	@Override
   23.95 -	public Class<?> getColumnClass(int n) {
   23.96 -		return String.class;
   23.97 -	}
   23.98 -
   23.99 -	@Override
  23.100 -	public boolean isCellEditable(int m, int n) {
  23.101 -		return true;
  23.102 -	}
  23.103 -
  23.104 -	@Override
  23.105 -	public Object getValueAt(int m, int n) {
  23.106 -		switch (n) {
  23.107 -			case 0:
  23.108 -				return atributy.get(m).getKlíč();
  23.109 -			case 1:
  23.110 -				return atributy.get(m).getHodnota();
  23.111 -			default:
  23.112 -				return null;
  23.113 -		}
  23.114 -	}
  23.115 -
  23.116 -	@Override
  23.117 -	public void setValueAt(Object hodnota, int m, int n) {
  23.118 -		Atribut a = atributy.get(m);
  23.119 -		try {
  23.120 -			if (n == 0) {
  23.121 -				/**
  23.122 -				 * Měníme klíč – název atributu
  23.123 -				 */
  23.124 -				String novýKlíč = String.valueOf(hodnota);
  23.125 -				if (!novýKlíč.equals(a.getKlíč())) {
  23.126 -					if (a.isPlatnýKlíč()) {
  23.127 -						souborovýSystém.delete(a.getKlíč());
  23.128 -					}
  23.129 -					a.setKlíč(novýKlíč);
  23.130 -					if (a.isPlatnýKlíč() && a.isPlatnáHodnota()) {
  23.131 -						souborovýSystém.write(a.getKlíč(), a.getHodnotaBajty());
  23.132 -					}
  23.133 -				}
  23.134 -			} else if (n == 1) {
  23.135 -				/**
  23.136 -				 * Měníme hodnotu atributu
  23.137 -				 */
  23.138 -				a.setHodnota(String.valueOf(hodnota));
  23.139 -				if (a.isPlatnýKlíč() && a.isPlatnáHodnota()) {
  23.140 -					souborovýSystém.write(a.getKlíč(), a.getHodnotaBajty());
  23.141 -				}
  23.142 -			}
  23.143 -		} catch (IOException e) {
  23.144 -			log.log(Level.SEVERE, "Selhalo ukládání atributu na FS", e);
  23.145 -		}
  23.146 -	}
  23.147 -
  23.148 -	@Override
  23.149 -	public void addTableModelListener(TableModelListener l) {
  23.150 -		posluchače.add(l);
  23.151 -	}
  23.152 -
  23.153 -	@Override
  23.154 -	public void removeTableModelListener(TableModelListener l) {
  23.155 -		posluchače.remove(l);
  23.156 -	}
  23.157 -
  23.158 -	/**
  23.159 -	 * @param m číslo řádku
  23.160 -	 * @return atribut, který se na něm nachází
  23.161 -	 */
  23.162 -	public Atribut getAtribut(int m) {
  23.163 -		return atributy.get(m);
  23.164 -	}
  23.165 -
  23.166 -	public void přidejAtribut(Atribut a) {
  23.167 -		atributy.add(a);
  23.168 -		upozorniPosluchače();
  23.169 -	}
  23.170 -
  23.171 -	public void odeberAtribut(Atribut a) throws IOException {
  23.172 -		atributy.remove(a);
  23.173 -		if (a.isPlatnýKlíč()) {
  23.174 -			souborovýSystém.delete(a.getKlíč());
  23.175 -		}
  23.176 -		upozorniPosluchače();
  23.177 -	}
  23.178 -
  23.179 -	public final void načtiAtributy() throws IOException {
  23.180 -		List<String> jménaAtributů = souborovýSystém.list();
  23.181 -		atributy.clear();
  23.182 -		for (String jménoAtributu : jménaAtributů) {
  23.183 -			ByteBuffer hodnotaAtributu = ByteBuffer
  23.184 -				.allocate(souborovýSystém.size(jménoAtributu));
  23.185 -			souborovýSystém.read(jménoAtributu, hodnotaAtributu);
  23.186 -			atributy.add(new Atribut(jménoAtributu, hodnotaAtributu));
  23.187 -		}
  23.188 -		upozorniPosluchače();
  23.189 -	}
  23.190 -
  23.191 -	private void upozorniPosluchače() {
  23.192 -		for (TableModelListener p : posluchače) {
  23.193 -			p.tableChanged(new TableModelEvent(this));
  23.194 -		}
  23.195 -	}
  23.196 -
  23.197 -	public boolean isZámekPodporovaný() {
  23.198 -		return konfigurace.getSoubor().isFile();
  23.199 -	}
  23.200 -
  23.201 -	public void nastavZámek(boolean zamknout) throws IOException {
  23.202 -		if (!isZámekPodporovaný()) {
  23.203 -			throw new IOException(překlady
  23.204 -				.getString("chyba.lzeZamknoutJenSoubor"));
  23.205 -		}
  23.206 -
  23.207 -		if (zamknout && zámekSoubor == null) {
  23.208 -			zámekSoubor = new RandomAccessFile(konfigurace.getSoubor(), "rw");
  23.209 -			zámekKanál = zámekSoubor.getChannel();
  23.210 -			zámek = zámekKanál.lock();
  23.211 -		} else if (!zamknout && zámekSoubor != null) {
  23.212 -			zámek.release();
  23.213 -			zámekKanál.close();
  23.214 -			zámekSoubor.close();
  23.215 -			zámek = null;
  23.216 -			zámekKanál = null;
  23.217 -			zámekSoubor = null;
  23.218 -		}
  23.219 -
  23.220 -	}
  23.221 -}
    24.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Panel.form	Sat Dec 16 19:09:35 2023 +0100
    24.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.3 @@ -1,112 +0,0 @@
    24.4 -<?xml version="1.0" encoding="UTF-8" ?>
    24.5 -
    24.6 -<Form version="1.6" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    24.7 -  <AuxValues>
    24.8 -    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
    24.9 -    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   24.10 -    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   24.11 -    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   24.12 -    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
   24.13 -    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   24.14 -    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   24.15 -    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   24.16 -    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   24.17 -  </AuxValues>
   24.18 -
   24.19 -  <Layout>
   24.20 -    <DimensionLayout dim="0">
   24.21 -      <Group type="103" groupAlignment="0" attributes="0">
   24.22 -          <Group type="102" alignment="0" attributes="0">
   24.23 -              <EmptySpace max="-2" attributes="0"/>
   24.24 -              <Component id="tlačítkoPřidat" min="-2" max="-2" attributes="0"/>
   24.25 -              <EmptySpace max="-2" attributes="0"/>
   24.26 -              <Component id="tlačítkoSmazat" min="-2" max="-2" attributes="0"/>
   24.27 -              <EmptySpace max="-2" attributes="0"/>
   24.28 -              <Component id="tlačítkoZnovuNačíst" min="-2" max="-2" attributes="0"/>
   24.29 -              <EmptySpace max="-2" attributes="0"/>
   24.30 -              <Component id="tlačítkoZamknout" min="-2" max="-2" attributes="0"/>
   24.31 -              <EmptySpace max="-2" attributes="0"/>
   24.32 -              <Component id="tlačítkoKopírovat" min="-2" max="-2" attributes="0"/>
   24.33 -              <EmptySpace pref="25" max="32767" attributes="0"/>
   24.34 -          </Group>
   24.35 -          <Component id="posuvnýPanel" alignment="0" pref="543" max="32767" attributes="0"/>
   24.36 -      </Group>
   24.37 -    </DimensionLayout>
   24.38 -    <DimensionLayout dim="1">
   24.39 -      <Group type="103" groupAlignment="0" attributes="0">
   24.40 -          <Group type="102" alignment="1" attributes="0">
   24.41 -              <Component id="posuvnýPanel" pref="277" max="32767" attributes="0"/>
   24.42 -              <EmptySpace max="-2" attributes="0"/>
   24.43 -              <Group type="103" groupAlignment="3" attributes="0">
   24.44 -                  <Component id="tlačítkoPřidat" alignment="3" min="-2" max="-2" attributes="0"/>
   24.45 -                  <Component id="tlačítkoSmazat" alignment="3" min="-2" max="-2" attributes="0"/>
   24.46 -                  <Component id="tlačítkoZnovuNačíst" alignment="3" min="-2" max="-2" attributes="0"/>
   24.47 -                  <Component id="tlačítkoZamknout" alignment="3" min="-2" max="-2" attributes="0"/>
   24.48 -                  <Component id="tlačítkoKopírovat" alignment="3" min="-2" max="-2" attributes="0"/>
   24.49 -              </Group>
   24.50 -              <EmptySpace max="-2" attributes="0"/>
   24.51 -          </Group>
   24.52 -      </Group>
   24.53 -    </DimensionLayout>
   24.54 -  </Layout>
   24.55 -  <SubComponents>
   24.56 -    <Container class="javax.swing.JScrollPane" name="posuvn&#xfd;Panel">
   24.57 -
   24.58 -      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
   24.59 -    </Container>
   24.60 -    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoP&#x159;idat">
   24.61 -      <Properties>
   24.62 -        <Property name="mnemonic" type="int" value="112"/>
   24.63 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   24.64 -          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="p&#x159;idatAtribut" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   24.65 -        </Property>
   24.66 -      </Properties>
   24.67 -      <Events>
   24.68 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoP&#x159;idatActionPerformed"/>
   24.69 -      </Events>
   24.70 -    </Component>
   24.71 -    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoSmazat">
   24.72 -      <Properties>
   24.73 -        <Property name="mnemonic" type="int" value="115"/>
   24.74 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   24.75 -          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="smazatAtribut" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   24.76 -        </Property>
   24.77 -        <Property name="enabled" type="boolean" value="false"/>
   24.78 -      </Properties>
   24.79 -      <Events>
   24.80 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoSmazatActionPerformed"/>
   24.81 -      </Events>
   24.82 -    </Component>
   24.83 -    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoZnovuNa&#x10d;&#xed;st">
   24.84 -      <Properties>
   24.85 -        <Property name="mnemonic" type="int" value="122"/>
   24.86 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   24.87 -          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="znovuNa&#x10d;&#xed;st" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   24.88 -        </Property>
   24.89 -      </Properties>
   24.90 -      <Events>
   24.91 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoZnovuNa&#x10d;&#xed;stActionPerformed"/>
   24.92 -      </Events>
   24.93 -    </Component>
   24.94 -    <Component class="javax.swing.JToggleButton" name="tla&#x10d;&#xed;tkoZamknout">
   24.95 -      <Properties>
   24.96 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   24.97 -          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="zamknout" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   24.98 -        </Property>
   24.99 -      </Properties>
  24.100 -      <Events>
  24.101 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoZamknoutActionPerformed"/>
  24.102 -      </Events>
  24.103 -    </Component>
  24.104 -    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoKop&#xed;rovat">
  24.105 -      <Properties>
  24.106 -        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  24.107 -          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="schr&#xe1;nka.kop&#xed;rovat" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
  24.108 -        </Property>
  24.109 -      </Properties>
  24.110 -      <Events>
  24.111 -        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoKop&#xed;rovatActionPerformed"/>
  24.112 -      </Events>
  24.113 -    </Component>
  24.114 -  </SubComponents>
  24.115 -</Form>
    25.1 --- a/java/rozsirene-atributy/src/cz/frantovo/rozsireneatributy/gui/Panel.java	Sat Dec 16 19:09:35 2023 +0100
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,259 +0,0 @@
    25.4 -/**
    25.5 - * Rozšířené atributy – program na správu rozšířených atributů souborů
    25.6 - * Copyright © 2012 František Kučera (frantovo.cz)
    25.7 - *
    25.8 - * This program is free software: you can redistribute it and/or modify
    25.9 - * it under the terms of the GNU General Public License as published by
   25.10 - * the Free Software Foundation, either version 3 of the License.
   25.11 - *
   25.12 - * This program is distributed in the hope that it will be useful,
   25.13 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.14 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   25.15 - * GNU General Public License for more details.
   25.16 - *
   25.17 - * You should have received a copy of the GNU General Public License
   25.18 - * along with this program. If not, see <http://www.gnu.org/licenses/>.
   25.19 - */
   25.20 -package cz.frantovo.rozsireneatributy.gui;
   25.21 -
   25.22 -import cz.frantovo.rozsireneatributy.Atribut;
   25.23 -import cz.frantovo.rozsireneatributy.CSV;
   25.24 -import java.awt.Toolkit;
   25.25 -import java.awt.datatransfer.StringSelection;
   25.26 -import java.io.IOException;
   25.27 -import java.io.StringWriter;
   25.28 -import java.util.ResourceBundle;
   25.29 -import java.util.logging.Level;
   25.30 -import java.util.logging.Logger;
   25.31 -import javax.swing.JOptionPane;
   25.32 -import javax.swing.JTable;
   25.33 -import javax.swing.ListSelectionModel;
   25.34 -import javax.swing.event.ListSelectionEvent;
   25.35 -import javax.swing.event.ListSelectionListener;
   25.36 -
   25.37 -/**
   25.38 - * @author Ing. František Kučera (frantovo.cz)
   25.39 - */
   25.40 -public class Panel extends javax.swing.JPanel {
   25.41 -
   25.42 -	public static final int SLOUPEC_NÁZVU = 0;
   25.43 -	public static final int SLOUPEC_HODNOTY = 1;
   25.44 -	private static final Logger log = Logger
   25.45 -		.getLogger(Panel.class.getSimpleName());
   25.46 -	private static final ResourceBundle překlady = ResourceBundle
   25.47 -		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   25.48 -	private Model model;
   25.49 -	private Atribut vybranýAtribut;
   25.50 -	private JTable tabulka;
   25.51 -
   25.52 -	public Panel(Model model) {
   25.53 -		this.model = model;
   25.54 -		initComponents();
   25.55 -
   25.56 -		tlačítkoZamknout.setEnabled(model.isZámekPodporovaný());
   25.57 -		tlačítkoZamknout.setToolTipText(model.isZámekPodporovaný()
   25.58 -			? překlady.getString("zamknout.popis")
   25.59 -			: překlady.getString("chyba.lzeZamknoutJenSoubor"));
   25.60 -
   25.61 -		tabulka = new JTable(model);
   25.62 -		nastavEditor();
   25.63 -		tabulka.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
   25.64 -		posuvnýPanel.setViewportView(tabulka);
   25.65 -
   25.66 -		tabulka.setRowHeight((int) (tabulka.getRowHeight() * 1.3));
   25.67 -
   25.68 -		/** Výběr aktuálního atributu v tabulce */
   25.69 -		tabulka.getSelectionModel().addListSelectionListener(
   25.70 -			new ListSelectionListener() {
   25.71 -
   25.72 -			@Override
   25.73 -			public void valueChanged(ListSelectionEvent e) {
   25.74 -				int řádek = tabulka.getSelectedRow();
   25.75 -				if (řádek < 0) {
   25.76 -					vybranýAtribut = null;
   25.77 -					tlačítkoSmazat.setEnabled(false);
   25.78 -				} else {
   25.79 -					vybranýAtribut = getModel().getAtribut(řádek);
   25.80 -					tlačítkoSmazat.setEnabled(true);
   25.81 -				}
   25.82 -			}
   25.83 -		});
   25.84 -	}
   25.85 -
   25.86 -	private void nastavEditor() {
   25.87 -		tabulka.getColumnModel().getColumn(SLOUPEC_NÁZVU)
   25.88 -			.setCellEditor(new EditorNázvůAtributů(model.getKonfigurace()));
   25.89 -		tabulka.getColumnModel().getColumn(SLOUPEC_HODNOTY)
   25.90 -			.setCellEditor(new EditorHodnotAtributů(model.getKonfigurace()));
   25.91 -	}
   25.92 -
   25.93 -	private Model getModel() {
   25.94 -		return model;
   25.95 -	}
   25.96 -
   25.97 -	public void setModel(Model model) {
   25.98 -		this.model = model;
   25.99 -		tabulka.setModel(model);
  25.100 -		nastavEditor();
  25.101 -	}
  25.102 -
  25.103 -	private void zobrazChybovouHlášku(String hláška, Throwable chyba) {
  25.104 -		JOptionPane.showMessageDialog(this, hláška + "\n"
  25.105 -			+ chyba.getLocalizedMessage(),
  25.106 -			překlady.getString("chyba.titulek"), JOptionPane.ERROR_MESSAGE);
  25.107 -		log.log(Level.WARNING, hláška, chyba);
  25.108 -	}
  25.109 -	
  25.110 -	private void kopírujDoSchránky() {
  25.111 -		try {
  25.112 -			StringWriter výstup = new StringWriter();
  25.113 -			CSV csv = new CSV(výstup);
  25.114 -
  25.115 -			csv.hodnota(překlady.getString("tabulka.název").toLowerCase());
  25.116 -			csv.hodnota(překlady.getString("tabulka.hodnota").toLowerCase());
  25.117 -			csv.konecŘádku();
  25.118 -
  25.119 -			for (int i = 0; i < model.getRowCount(); i++) {
  25.120 -				csv.hodnota(String.valueOf(model.getValueAt(i, 0)));
  25.121 -				csv.hodnota(String.valueOf(model.getValueAt(i, 1)));
  25.122 -				csv.konecŘádku();
  25.123 -			}
  25.124 -
  25.125 -			Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
  25.126 -				new StringSelection(výstup.toString()),
  25.127 -				null
  25.128 -			);
  25.129 -		} catch (Exception e) {
  25.130 -			zobrazChybovouHlášku(překlady
  25.131 -				.getString("chyba.nepodařiloSeZkopírovat"), e);
  25.132 -		}
  25.133 -	}
  25.134 -
  25.135 -	@SuppressWarnings("unchecked")
  25.136 -    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  25.137 -    private void initComponents() {
  25.138 -
  25.139 -        posuvnýPanel = new javax.swing.JScrollPane();
  25.140 -        tlačítkoPřidat = new javax.swing.JButton();
  25.141 -        tlačítkoSmazat = new javax.swing.JButton();
  25.142 -        tlačítkoZnovuNačíst = new javax.swing.JButton();
  25.143 -        tlačítkoZamknout = new javax.swing.JToggleButton();
  25.144 -        tlačítkoKopírovat = new javax.swing.JButton();
  25.145 -
  25.146 -        tlačítkoPřidat.setMnemonic('p');
  25.147 -        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("cz/frantovo/rozsireneatributy/Překlady"); // NOI18N
  25.148 -        tlačítkoPřidat.setText(bundle.getString("přidatAtribut")); // NOI18N
  25.149 -        tlačítkoPřidat.addActionListener(new java.awt.event.ActionListener() {
  25.150 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  25.151 -                tlačítkoPřidatActionPerformed(evt);
  25.152 -            }
  25.153 -        });
  25.154 -
  25.155 -        tlačítkoSmazat.setMnemonic('s');
  25.156 -        tlačítkoSmazat.setText(bundle.getString("smazatAtribut")); // NOI18N
  25.157 -        tlačítkoSmazat.setEnabled(false);
  25.158 -        tlačítkoSmazat.addActionListener(new java.awt.event.ActionListener() {
  25.159 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  25.160 -                tlačítkoSmazatActionPerformed(evt);
  25.161 -            }
  25.162 -        });
  25.163 -
  25.164 -        tlačítkoZnovuNačíst.setMnemonic('z');
  25.165 -        tlačítkoZnovuNačíst.setText(bundle.getString("znovuNačíst")); // NOI18N
  25.166 -        tlačítkoZnovuNačíst.addActionListener(new java.awt.event.ActionListener() {
  25.167 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  25.168 -                tlačítkoZnovuNačístActionPerformed(evt);
  25.169 -            }
  25.170 -        });
  25.171 -
  25.172 -        tlačítkoZamknout.setText(bundle.getString("zamknout")); // NOI18N
  25.173 -        tlačítkoZamknout.addActionListener(new java.awt.event.ActionListener() {
  25.174 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  25.175 -                tlačítkoZamknoutActionPerformed(evt);
  25.176 -            }
  25.177 -        });
  25.178 -
  25.179 -        tlačítkoKopírovat.setText(bundle.getString("schránka.kopírovat")); // NOI18N
  25.180 -        tlačítkoKopírovat.addActionListener(new java.awt.event.ActionListener() {
  25.181 -            public void actionPerformed(java.awt.event.ActionEvent evt) {
  25.182 -                tlačítkoKopírovatActionPerformed(evt);
  25.183 -            }
  25.184 -        });
  25.185 -
  25.186 -        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  25.187 -        this.setLayout(layout);
  25.188 -        layout.setHorizontalGroup(
  25.189 -            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  25.190 -            .addGroup(layout.createSequentialGroup()
  25.191 -                .addContainerGap()
  25.192 -                .addComponent(tlačítkoPřidat)
  25.193 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  25.194 -                .addComponent(tlačítkoSmazat)
  25.195 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  25.196 -                .addComponent(tlačítkoZnovuNačíst)
  25.197 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  25.198 -                .addComponent(tlačítkoZamknout)
  25.199 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  25.200 -                .addComponent(tlačítkoKopírovat)
  25.201 -                .addContainerGap(25, Short.MAX_VALUE))
  25.202 -            .addComponent(posuvnýPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
  25.203 -        );
  25.204 -        layout.setVerticalGroup(
  25.205 -            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  25.206 -            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  25.207 -                .addComponent(posuvnýPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
  25.208 -                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  25.209 -                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  25.210 -                    .addComponent(tlačítkoPřidat)
  25.211 -                    .addComponent(tlačítkoSmazat)
  25.212 -                    .addComponent(tlačítkoZnovuNačíst)
  25.213 -                    .addComponent(tlačítkoZamknout)
  25.214 -                    .addComponent(tlačítkoKopírovat))
  25.215 -                .addContainerGap())
  25.216 -        );
  25.217 -    }// </editor-fold>//GEN-END:initComponents
  25.218 -
  25.219 -	private void tlačítkoPřidatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoPřidatActionPerformed
  25.220 -		model.přidejAtribut(new Atribut());
  25.221 -	}//GEN-LAST:event_tlačítkoPřidatActionPerformed
  25.222 -
  25.223 -	private void tlačítkoSmazatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoSmazatActionPerformed
  25.224 -		try {
  25.225 -			model.odeberAtribut(vybranýAtribut);
  25.226 -		} catch (IOException e) {
  25.227 -			zobrazChybovouHlášku(překlady
  25.228 -				.getString("chyba.nepodařiloSeSmazat"), e);
  25.229 -		}
  25.230 -	}//GEN-LAST:event_tlačítkoSmazatActionPerformed
  25.231 -
  25.232 -	private void tlačítkoZnovuNačístActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoZnovuNačístActionPerformed
  25.233 -		try {
  25.234 -			model.načtiAtributy();
  25.235 -		} catch (IOException e) {
  25.236 -			zobrazChybovouHlášku(překlady
  25.237 -				.getString("chyba.nepodařiloSeNačíst"), e);
  25.238 -		}
  25.239 -	}//GEN-LAST:event_tlačítkoZnovuNačístActionPerformed
  25.240 -
  25.241 -    private void tlačítkoZamknoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoZamknoutActionPerformed
  25.242 -		try {
  25.243 -			model.nastavZámek(tlačítkoZamknout.isSelected());
  25.244 -		} catch (Exception e) {
  25.245 -			zobrazChybovouHlášku(překlady
  25.246 -				.getString("chyba.nepodařiloSeNastavitZámek"), e);
  25.247 -		}
  25.248 -    }//GEN-LAST:event_tlačítkoZamknoutActionPerformed
  25.249 -
  25.250 -    private void tlačítkoKopírovatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoKopírovatActionPerformed
  25.251 -		kopírujDoSchránky();
  25.252 -    }//GEN-LAST:event_tlačítkoKopírovatActionPerformed
  25.253 -
  25.254 -    // Variables declaration - do not modify//GEN-BEGIN:variables
  25.255 -    private javax.swing.JScrollPane posuvnýPanel;
  25.256 -    private javax.swing.JButton tlačítkoKopírovat;
  25.257 -    private javax.swing.JButton tlačítkoPřidat;
  25.258 -    private javax.swing.JButton tlačítkoSmazat;
  25.259 -    private javax.swing.JToggleButton tlačítkoZamknout;
  25.260 -    private javax.swing.JButton tlačítkoZnovuNačíst;
  25.261 -    // End of variables declaration//GEN-END:variables
  25.262 -}
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/licence/header.txt	Sat Dec 16 20:13:13 2023 +0100
    26.3 @@ -0,0 +1,16 @@
    26.4 +/**
    26.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    26.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    26.7 + *
    26.8 + * This program is free software: you can redistribute it and/or modify
    26.9 + * it under the terms of the GNU General Public License as published by
   26.10 + * the Free Software Foundation, either version 3 of the License.
   26.11 + *
   26.12 + * This program is distributed in the hope that it will be useful,
   26.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   26.15 + * GNU General Public License for more details.
   26.16 + *
   26.17 + * You should have received a copy of the GNU General Public License
   26.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   26.19 + */
   26.20 \ No newline at end of file
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/nb-configuration.xml	Sat Dec 16 20:13:13 2023 +0100
    27.3 @@ -0,0 +1,18 @@
    27.4 +<?xml version="1.0" encoding="UTF-8"?>
    27.5 +<project-shared-configuration>
    27.6 +    <!--
    27.7 +This file contains additional configuration written by modules in the NetBeans IDE.
    27.8 +The configuration is intended to be shared among all the users of project and
    27.9 +therefore it is assumed to be part of version control checkout.
   27.10 +Without this configuration present, some functionality in the IDE may be limited or fail altogether.
   27.11 +-->
   27.12 +    <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
   27.13 +        <!--
   27.14 +Properties that influence various parts of the IDE, especially code formatting and the like. 
   27.15 +You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
   27.16 +That way multiple projects can share the same settings (useful for formatting rules for example).
   27.17 +Any value defined here will override the pom.xml file value but is only applicable to the current project.
   27.18 +-->
   27.19 +        <netbeans.hint.licensePath>${project.basedir}/licence/header.txt</netbeans.hint.licensePath>
   27.20 +    </properties>
   27.21 +</project-shared-configuration>
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/nbactions.xml	Sat Dec 16 20:13:13 2023 +0100
    28.3 @@ -0,0 +1,55 @@
    28.4 +<?xml version="1.0" encoding="UTF-8"?>
    28.5 +<actions>
    28.6 +        <action>
    28.7 +            <actionName>run</actionName>
    28.8 +            <packagings>
    28.9 +                <packaging>jar</packaging>
   28.10 +            </packagings>
   28.11 +            <goals>
   28.12 +                <goal>process-classes</goal>
   28.13 +                <goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
   28.14 +            </goals>
   28.15 +            <properties>
   28.16 +                <exec.vmArgs></exec.vmArgs>
   28.17 +                <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
   28.18 +                <exec.appArgs>--soubor target</exec.appArgs>
   28.19 +                <exec.mainClass>${packageClassName}</exec.mainClass>
   28.20 +                <exec.executable>java</exec.executable>
   28.21 +            </properties>
   28.22 +        </action>
   28.23 +        <action>
   28.24 +            <actionName>debug</actionName>
   28.25 +            <packagings>
   28.26 +                <packaging>jar</packaging>
   28.27 +            </packagings>
   28.28 +            <goals>
   28.29 +                <goal>process-classes</goal>
   28.30 +                <goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
   28.31 +            </goals>
   28.32 +            <properties>
   28.33 +                <exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
   28.34 +                <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
   28.35 +                <exec.appArgs>--soubor target</exec.appArgs>
   28.36 +                <exec.mainClass>${packageClassName}</exec.mainClass>
   28.37 +                <exec.executable>java</exec.executable>
   28.38 +                <jpda.listen>true</jpda.listen>
   28.39 +            </properties>
   28.40 +        </action>
   28.41 +        <action>
   28.42 +            <actionName>profile</actionName>
   28.43 +            <packagings>
   28.44 +                <packaging>jar</packaging>
   28.45 +            </packagings>
   28.46 +            <goals>
   28.47 +                <goal>process-classes</goal>
   28.48 +                <goal>org.codehaus.mojo:exec-maven-plugin:3.0.0:exec</goal>
   28.49 +            </goals>
   28.50 +            <properties>
   28.51 +                <exec.vmArgs></exec.vmArgs>
   28.52 +                <exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
   28.53 +                <exec.mainClass>${packageClassName}</exec.mainClass>
   28.54 +                <exec.executable>java</exec.executable>
   28.55 +                <exec.appArgs>--soubor target</exec.appArgs>
   28.56 +            </properties>
   28.57 +        </action>
   28.58 +    </actions>
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/pom.xml	Sat Dec 16 20:13:13 2023 +0100
    29.3 @@ -0,0 +1,42 @@
    29.4 +<project
    29.5 +	xmlns="http://maven.apache.org/POM/4.0.0"
    29.6 +	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    29.7 +	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
    29.8 +		https://maven.apache.org/xsd/maven-4.0.0.xsd">
    29.9 +
   29.10 +	<modelVersion>4.0.0</modelVersion>
   29.11 +    
   29.12 +	<groupId>cz.frantovo.xattr</groupId>
   29.13 +	<artifactId>rozsirene-atributy</artifactId>
   29.14 +	<version>0.1-SNAPSHOT</version>
   29.15 +	<packaging>jar</packaging>
   29.16 +
   29.17 +	<properties>
   29.18 +		<maven.compiler.source>1.7</maven.compiler.source>
   29.19 +		<maven.compiler.target>1.7</maven.compiler.target>
   29.20 +		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
   29.21 +		<project.reporting.outputEncoding
   29.22 +		>UTF-8</project.reporting.outputEncoding>
   29.23 +		<main-class>cz.frantovo.rozsireneatributy.Startér</main-class>
   29.24 +	</properties>
   29.25 +	
   29.26 +	<build>
   29.27 +		<plugins>
   29.28 +			<plugin>
   29.29 +				<groupId>org.apache.maven.plugins</groupId>
   29.30 +				<artifactId>maven-jar-plugin</artifactId>
   29.31 +				<version>3.3.0</version>
   29.32 +				<configuration>
   29.33 +					<archive>
   29.34 +						<index>true</index>
   29.35 +						<manifest>
   29.36 +							<addClasspath>true</addClasspath>
   29.37 +							<mainClass>${main-class}</mainClass>
   29.38 +						</manifest>
   29.39 +					</archive>
   29.40 +				</configuration>
   29.41 +			</plugin>
   29.42 +		</plugins>
   29.43 +	</build>
   29.44 +
   29.45 +</project>
    30.1 --- a/rozšířené-atributy.sh	Sat Dec 16 19:09:35 2023 +0100
    30.2 +++ b/rozšířené-atributy.sh	Sat Dec 16 20:13:13 2023 +0100
    30.3 @@ -1,11 +1,11 @@
    30.4  #!/bin/bash
    30.5  
    30.6 -JAVA_HOME="/opt/jdk1.7.0";
    30.7 -JAVA_BIN="${JAVA_HOME}/bin/java";
    30.8 +#JAVA_HOME="/opt/jdk1.7.0";
    30.9 +#JAVA_BIN="${JAVA_HOME}/bin/java";
   30.10 +JAVA_BIN="java";
   30.11  SWING_LAF="-Dswing.defaultlaf=com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel";
   30.12 -JAR="java/rozsirene-atributy/dist/rozsirene-atributy.jar";
   30.13 +SWING_LAF="-Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel";
   30.14 +VER="0.1-SNAPSHOT"
   30.15 +JAR="$(dirname $(realpath $0))/target/rozsirene-atributy-${VER}.jar";
   30.16  
   30.17 -# For English localization uncomment this:
   30.18 -# LANG="en_US.utf8";
   30.19 -
   30.20 -${JAVA_BIN} ${SWING_LAF} -jar ${JAR} "${1}";
   30.21 +${JAVA_BIN} ${SWING_LAF} -jar ${JAR} "${@}";
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/Atribut.java	Sat Dec 16 20:13:13 2023 +0100
    31.3 @@ -0,0 +1,97 @@
    31.4 +/**
    31.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    31.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    31.7 + * 
    31.8 + * This program is free software: you can redistribute it and/or modify
    31.9 + * it under the terms of the GNU General Public License as published by
   31.10 + * the Free Software Foundation, either version 3 of the License.
   31.11 + * 
   31.12 + * This program is distributed in the hope that it will be useful,
   31.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   31.15 + * GNU General Public License for more details.
   31.16 + * 
   31.17 + * You should have received a copy of the GNU General Public License
   31.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   31.19 + */
   31.20 +package cz.frantovo.rozsireneatributy;
   31.21 +
   31.22 +import java.nio.ByteBuffer;
   31.23 +import java.nio.charset.Charset;
   31.24 +
   31.25 +/**
   31.26 + * @author Ing. František Kučera (frantovo.cz)
   31.27 + */
   31.28 +public class Atribut {
   31.29 +
   31.30 +	private String klíč;
   31.31 +	private String hodnota;
   31.32 +
   31.33 +	public Atribut(String klíč, String hodnota) {
   31.34 +		this.klíč = klíč;
   31.35 +		this.hodnota = hodnota;
   31.36 +	}
   31.37 +
   31.38 +	public Atribut(String klíč, ByteBuffer hodnota) {
   31.39 +		this.klíč = klíč;
   31.40 +		setHodnota(hodnota);
   31.41 +	}
   31.42 +
   31.43 +	public Atribut() {
   31.44 +	}
   31.45 +
   31.46 +	public String getKlíč() {
   31.47 +		return klíč;
   31.48 +	}
   31.49 +
   31.50 +	public void setKlíč(String klíč) {
   31.51 +		this.klíč = klíč;
   31.52 +	}
   31.53 +
   31.54 +	/**
   31.55 +	 * Název atributu musí být nenulový a mít nějakou délku, aby šel uložit
   31.56 +	 * TODO: další kontroly?
   31.57 +	 * @return jestli je platný
   31.58 +	 */
   31.59 +	public boolean isPlatnýKlíč() {
   31.60 +		return klíč != null && klíč.length() > 0;
   31.61 +	}
   31.62 +
   31.63 +	/**
   31.64 +	 * nulová hodnota → smazání atributu
   31.65 +	 * (ale může být prázdný řetězec)
   31.66 +	 * @return jestli je platná
   31.67 +	 */
   31.68 +	public boolean isPlatnáHodnota() {
   31.69 +		return hodnota != null;
   31.70 +	}
   31.71 +
   31.72 +	public String getHodnota() {
   31.73 +		return hodnota;
   31.74 +	}
   31.75 +
   31.76 +	public final ByteBuffer getHodnotaBajty() {
   31.77 +		return zakóduj(getHodnota());
   31.78 +	}
   31.79 +
   31.80 +	public void setHodnota(String hodnota) {
   31.81 +		this.hodnota = hodnota;
   31.82 +	}
   31.83 +
   31.84 +	public final void setHodnota(ByteBuffer hodnota) {
   31.85 +		setHodnota(dekóduj(hodnota));
   31.86 +	}
   31.87 +
   31.88 +	private static String dekóduj(ByteBuffer bajty) {
   31.89 +		bajty.flip();
   31.90 +		return Charset.defaultCharset().decode(bajty).toString();
   31.91 +	}
   31.92 +
   31.93 +	private static ByteBuffer zakóduj(String text) {
   31.94 +		if (text == null) {
   31.95 +			return null;
   31.96 +		} else {
   31.97 +			return Charset.defaultCharset().encode(text);
   31.98 +		}
   31.99 +	}
  31.100 +}
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/CLIParser.java	Sat Dec 16 20:13:13 2023 +0100
    32.3 @@ -0,0 +1,173 @@
    32.4 +/**
    32.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    32.6 + * Copyright © 2023 František Kučera (frantovo.cz)
    32.7 + *
    32.8 + * This program is free software: you can redistribute it and/or modify
    32.9 + * it under the terms of the GNU General Public License as published by
   32.10 + * the Free Software Foundation, either version 3 of the License.
   32.11 + *
   32.12 + * This program is distributed in the hope that it will be useful,
   32.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   32.15 + * GNU General Public License for more details.
   32.16 + *
   32.17 + * You should have received a copy of the GNU General Public License
   32.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   32.19 + */
   32.20 +package cz.frantovo.rozsireneatributy;
   32.21 +
   32.22 +import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   32.23 +import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceHodnoty;
   32.24 +import java.io.File;
   32.25 +import java.util.Arrays;
   32.26 +import java.util.Collection;
   32.27 +import java.util.ResourceBundle;
   32.28 +
   32.29 +/**
   32.30 + * Converts command line arguments from String array to object. Checks basic
   32.31 + * constraints (if only supported options are used and if they have correct
   32.32 + * number of parameters)
   32.33 + *
   32.34 + * @author Ing. František Kučera (frantovo.cz)
   32.35 + */
   32.36 +public class CLIParser {
   32.37 +
   32.38 +	private static final ResourceBundle překlady = ResourceBundle
   32.39 +		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   32.40 +
   32.41 +	public Konfigurace parsujParametry(String[] parametry)
   32.42 +		throws CLIParserException {
   32.43 +		Konfigurace k = new Konfigurace();
   32.44 +
   32.45 +		for (int i = 0; i < parametry.length; i++) {
   32.46 +			String parametr = parametry[i];
   32.47 +
   32.48 +			boolean odpovídá = false;
   32.49 +
   32.50 +			for (Token t : Token.values()) {
   32.51 +				if (t.odpovídá(parametr)) {
   32.52 +					int parsedArgs = t.parsuj(parametry, i, k);
   32.53 +					i = i + parsedArgs;
   32.54 +					odpovídá = true;
   32.55 +				}
   32.56 +			}
   32.57 +
   32.58 +			if (!odpovídá) {
   32.59 +				throw new CLIParserException(
   32.60 +					překlady.getString("chyba.cli.neznámýParametr") + parametr);
   32.61 +			}
   32.62 +		}
   32.63 +
   32.64 +		if (k.getSoubor() == null)
   32.65 +			throw new CLIParserException(
   32.66 +					překlady.getString("chyba.cli.chybíSoubor"));
   32.67 +		
   32.68 +		return k;
   32.69 +	}
   32.70 +
   32.71 +	private static String načtiDalší(String[] parametry, int index)
   32.72 +		throws CLIParserException {
   32.73 +		if (index < parametry.length) {
   32.74 +			return parametry[index];
   32.75 +		} else {
   32.76 +			throw new CLIParserException("Expecting value for option: "
   32.77 +				+ parametry[index - 1]);
   32.78 +		}
   32.79 +	}
   32.80 +
   32.81 +	private static boolean načtiDalšíBoolean(String[] parametry, int index)
   32.82 +		throws CLIParserException {
   32.83 +		String s = načtiDalší(parametry, index);
   32.84 +		switch (s) {
   32.85 +			case "true":
   32.86 +			case "ano":
   32.87 +				return true;
   32.88 +			case "false":
   32.89 +			case "ne":
   32.90 +				return false;
   32.91 +			default:
   32.92 +				throw new CLIParserException("Neplatná logická hodnota: " + s);
   32.93 +		}
   32.94 +	}
   32.95 +
   32.96 +	private static enum Token {
   32.97 +
   32.98 +		SOUBOR("--soubor", "--file") {
   32.99 +			@Override
  32.100 +			public int parsuj(String[] parametry, int index, Konfigurace k)
  32.101 +				throws CLIParserException {
  32.102 +				int originalIndex = index;
  32.103 +				k.setSoubor(new File(načtiDalší(parametry, ++index)));
  32.104 +				return index - originalIndex;
  32.105 +			}
  32.106 +		},
  32.107 +		POVINNÉ_ZAMYKÁNÍ("--povinné-zamykání", "--mandatory-locking") {
  32.108 +			@Override
  32.109 +			public int parsuj(String[] parametry, int index, Konfigurace k)
  32.110 +				throws CLIParserException {
  32.111 +				int originalIndex = index;
  32.112 +				k.setPovinnéZamykání(načtiDalšíBoolean(parametry, ++index));
  32.113 +				return index - originalIndex;
  32.114 +			}
  32.115 +		},
  32.116 +		DEFINICE_ATRIBUTU("--definice-atributu", "--attribute-definition") {
  32.117 +			@Override
  32.118 +			public int parsuj(String[] parametry, int index, Konfigurace k)
  32.119 +				throws CLIParserException {
  32.120 +				int originalIndex = index;
  32.121 +				String název = načtiDalší(parametry, ++index);
  32.122 +				String popis = načtiDalší(parametry, ++index);
  32.123 +				k.addAtribut(new DefiniceAtributu(název, popis));
  32.124 +				return index - originalIndex;
  32.125 +			}
  32.126 +		},
  32.127 +		HODNOTA_ATRIBUTU("--hodnota", "--value") {
  32.128 +			@Override
  32.129 +			public int parsuj(String[] parametry, int index, Konfigurace k)
  32.130 +				throws CLIParserException {
  32.131 +				int originalIndex = index;
  32.132 +				String hodnota = načtiDalší(parametry, ++index);
  32.133 +				String popis = načtiDalší(parametry, ++index);
  32.134 +
  32.135 +				if (k.getAtributy().isEmpty())
  32.136 +					throw new CLIParserException(
  32.137 +						překlady.getString("chyba.cli.chybíDefiniceAtributu"));
  32.138 +
  32.139 +				k.getAtributy()
  32.140 +					.get(k.getAtributy().size() - 1)
  32.141 +					.addHodnota(new DefiniceHodnoty(hodnota, popis));
  32.142 +
  32.143 +				return index - originalIndex;
  32.144 +			}
  32.145 +		};
  32.146 +
  32.147 +		private final Collection<String> parametry;
  32.148 +
  32.149 +		private Token(String... parametry) {
  32.150 +			this.parametry = Arrays.asList(parametry);
  32.151 +		}
  32.152 +
  32.153 +		/**
  32.154 +		 * @param parametr e.g. „--input-file“
  32.155 +		 * @return whether option is this token
  32.156 +		 */
  32.157 +		public boolean odpovídá(String parametr) {
  32.158 +			return parametry.contains(parametr);
  32.159 +		}
  32.160 +
  32.161 +		/**
  32.162 +		 * Parse String arguments and fill values into the options object.
  32.163 +		 *
  32.164 +		 * @param parametry CLI arguments
  32.165 +		 * @param index index of the option matched by this token, like
  32.166 +		 * „--input-file“
  32.167 +		 * @param k object to be filled
  32.168 +		 * @return number of parsed arguments – if option has no arguments (just
  32.169 +		 * boolean flag), return 0, otherwise return positive integer: number of
  32.170 +		 * eaten arguments.
  32.171 +		 * @throws CLIParserException
  32.172 +		 */
  32.173 +		public abstract int parsuj(String[] parametry, int index, Konfigurace k)
  32.174 +			throws CLIParserException;
  32.175 +	}
  32.176 +}
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/CLIParserException.java	Sat Dec 16 20:13:13 2023 +0100
    33.3 @@ -0,0 +1,39 @@
    33.4 +/**
    33.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    33.6 + * Copyright © 2023 František Kučera (frantovo.cz)
    33.7 + *
    33.8 + * This program is free software: you can redistribute it and/or modify
    33.9 + * it under the terms of the GNU General Public License as published by
   33.10 + * the Free Software Foundation, either version 3 of the License.
   33.11 + *
   33.12 + * This program is distributed in the hope that it will be useful,
   33.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33.15 + * GNU General Public License for more details.
   33.16 + *
   33.17 + * You should have received a copy of the GNU General Public License
   33.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   33.19 + */
   33.20 +package cz.frantovo.rozsireneatributy;
   33.21 +
   33.22 +/**
   33.23 + *
   33.24 + * @author Ing. František Kučera (frantovo.cz)
   33.25 + */
   33.26 +public class CLIParserException extends Exception {
   33.27 +
   33.28 +	public CLIParserException() {
   33.29 +	}
   33.30 +
   33.31 +	public CLIParserException(String message) {
   33.32 +		super(message);
   33.33 +	}
   33.34 +
   33.35 +	public CLIParserException(Throwable cause) {
   33.36 +		super(cause);
   33.37 +	}
   33.38 +
   33.39 +	public CLIParserException(String message, Throwable cause) {
   33.40 +		super(message, cause);
   33.41 +	}
   33.42 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/CSV.java	Sat Dec 16 20:13:13 2023 +0100
    34.3 @@ -0,0 +1,65 @@
    34.4 +/**
    34.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    34.6 + * Copyright © 2023 František Kučera (frantovo.cz)
    34.7 + *
    34.8 + * This program is free software: you can redistribute it and/or modify
    34.9 + * it under the terms of the GNU General Public License as published by
   34.10 + * the Free Software Foundation, either version 3 of the License.
   34.11 + *
   34.12 + * This program is distributed in the hope that it will be useful,
   34.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   34.15 + * GNU General Public License for more details.
   34.16 + *
   34.17 + * You should have received a copy of the GNU General Public License
   34.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
   34.19 + */
   34.20 +package cz.frantovo.rozsireneatributy;
   34.21 +
   34.22 +import java.io.IOException;
   34.23 +import java.io.Writer;
   34.24 +
   34.25 +/**
   34.26 + * Generátor standardních CSV.
   34.27 + *
   34.28 + * @author Ing. František Kučera
   34.29 + */
   34.30 +public class CSV {
   34.31 +
   34.32 +	private final Writer výstup;
   34.33 +	private int sloupec = 0;
   34.34 +	private int početSloupců = -1;
   34.35 +
   34.36 +	public CSV(Writer výstup) {
   34.37 +		this.výstup = výstup;
   34.38 +	}
   34.39 +
   34.40 +	public void hodnota(String hodnota) throws IOException {
   34.41 +		if (sloupec > 0) výstup.write(',');
   34.42 +		if (hodnota != null && !hodnota.isEmpty()) {
   34.43 +			výstup.write('"');
   34.44 +			for (char ch : hodnota.toCharArray()) {
   34.45 +				if (ch == '"') výstup.write('"');
   34.46 +				výstup.write(ch);
   34.47 +			}
   34.48 +			výstup.write('"');
   34.49 +		}
   34.50 +		sloupec++;
   34.51 +		výstup.flush();
   34.52 +	}
   34.53 +
   34.54 +	public void konecŘádku() throws IOException {
   34.55 +		if (početSloupců < 0) početSloupců = sloupec;
   34.56 +		if (sloupec == početSloupců) {
   34.57 +			výstup.write("\r\n");
   34.58 +			sloupec = 0;
   34.59 +		} else {
   34.60 +			throw new IOException("Neodpovídá počet sloupců:"
   34.61 +				+ " aktuální=" + sloupec
   34.62 +				+ " celkový=" + početSloupců
   34.63 +			);
   34.64 +		}
   34.65 +		výstup.flush();
   34.66 +	}
   34.67 +
   34.68 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/Konfigurace.java	Sat Dec 16 20:13:13 2023 +0100
    35.3 @@ -0,0 +1,122 @@
    35.4 +/**
    35.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    35.6 + * Copyright © 2023 František Kučera (frantovo.cz)
    35.7 + *
    35.8 + * This program is free software: you can redistribute it and/or modify
    35.9 + * it under the terms of the GNU General Public License as published by
   35.10 + * the Free Software Foundation, either version 3 of the License.
   35.11 + *
   35.12 + * This program is distributed in the hope that it will be useful,
   35.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   35.15 + * GNU General Public License for more details.
   35.16 + *
   35.17 + * You should have received a copy of the GNU General Public License
   35.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   35.19 + */
   35.20 +package cz.frantovo.rozsireneatributy;
   35.21 +
   35.22 +import java.io.File;
   35.23 +import java.util.LinkedList;
   35.24 +import java.util.List;
   35.25 +
   35.26 +/**
   35.27 + * @author Ing. František Kučera (frantovo.cz)
   35.28 + */
   35.29 +public class Konfigurace {
   35.30 +
   35.31 +	public static class DefiniceAtributu {
   35.32 +
   35.33 +		private String název;
   35.34 +		private String popis;
   35.35 +		private final List<DefiniceHodnoty> hodnoty = new LinkedList<>();
   35.36 +
   35.37 +		public DefiniceAtributu(String název, String popis) {
   35.38 +			this.název = název;
   35.39 +			this.popis = popis;
   35.40 +		}
   35.41 +
   35.42 +		public String getNázev() {
   35.43 +			return název;
   35.44 +		}
   35.45 +
   35.46 +		public void setNázev(String název) {
   35.47 +			this.název = název;
   35.48 +		}
   35.49 +
   35.50 +		public String getPopis() {
   35.51 +			return popis;
   35.52 +		}
   35.53 +
   35.54 +		public void setPopis(String popis) {
   35.55 +			this.popis = popis;
   35.56 +		}
   35.57 +
   35.58 +		public List<DefiniceHodnoty> getHodnoty() {
   35.59 +			return hodnoty;
   35.60 +		}
   35.61 +
   35.62 +		public void addHodnota(DefiniceHodnoty hodnota) {
   35.63 +			this.hodnoty.add(hodnota);
   35.64 +		}
   35.65 +
   35.66 +	}
   35.67 +
   35.68 +	public static class DefiniceHodnoty {
   35.69 +
   35.70 +		private String název;
   35.71 +		private String popis;
   35.72 +
   35.73 +		public DefiniceHodnoty(String název, String popis) {
   35.74 +			this.název = název;
   35.75 +			this.popis = popis;
   35.76 +		}
   35.77 +
   35.78 +		public String getNázev() {
   35.79 +			return název;
   35.80 +		}
   35.81 +
   35.82 +		public void setNázev(String název) {
   35.83 +			this.název = název;
   35.84 +		}
   35.85 +
   35.86 +		public String getPopis() {
   35.87 +			return popis;
   35.88 +		}
   35.89 +
   35.90 +		public void setPopis(String popis) {
   35.91 +			this.popis = popis;
   35.92 +		}
   35.93 +	}
   35.94 +
   35.95 +	private File soubor;
   35.96 +
   35.97 +	private boolean povinnéZamykání = false;
   35.98 +
   35.99 +	private final List<DefiniceAtributu> atributy = new LinkedList<>();
  35.100 +
  35.101 +	public File getSoubor() {
  35.102 +		return soubor;
  35.103 +	}
  35.104 +
  35.105 +	public void setSoubor(File soubor) {
  35.106 +		this.soubor = soubor;
  35.107 +	}
  35.108 +
  35.109 +	public boolean isPovinnéZamykání() {
  35.110 +		return povinnéZamykání;
  35.111 +	}
  35.112 +
  35.113 +	public void setPovinnéZamykání(boolean povinnéZamykání) {
  35.114 +		this.povinnéZamykání = povinnéZamykání;
  35.115 +	}
  35.116 +
  35.117 +	public List<DefiniceAtributu> getAtributy() {
  35.118 +		return atributy;
  35.119 +	}
  35.120 +
  35.121 +	public void addAtribut(DefiniceAtributu atribut) {
  35.122 +		this.atributy.add(atribut);
  35.123 +	}
  35.124 +
  35.125 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/Startér.java	Sat Dec 16 20:13:13 2023 +0100
    36.3 @@ -0,0 +1,111 @@
    36.4 +/**
    36.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    36.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    36.7 + *
    36.8 + * This program is free software: you can redistribute it and/or modify
    36.9 + * it under the terms of the GNU General Public License as published by
   36.10 + * the Free Software Foundation, either version 3 of the License.
   36.11 + *
   36.12 + * This program is distributed in the hope that it will be useful,
   36.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   36.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   36.15 + * GNU General Public License for more details.
   36.16 + *
   36.17 + * You should have received a copy of the GNU General Public License
   36.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   36.19 + */
   36.20 +package cz.frantovo.rozsireneatributy;
   36.21 +
   36.22 +import cz.frantovo.rozsireneatributy.gui.Model;
   36.23 +import cz.frantovo.rozsireneatributy.gui.Panel;
   36.24 +import java.awt.BorderLayout;
   36.25 +import java.awt.event.ActionEvent;
   36.26 +import java.awt.event.ActionListener;
   36.27 +import java.awt.event.KeyEvent;
   36.28 +import java.io.File;
   36.29 +import java.text.MessageFormat;
   36.30 +import java.util.ResourceBundle;
   36.31 +import java.util.logging.Level;
   36.32 +import java.util.logging.Logger;
   36.33 +import javax.swing.JComponent;
   36.34 +import javax.swing.JFrame;
   36.35 +import javax.swing.JOptionPane;
   36.36 +import javax.swing.KeyStroke;
   36.37 +
   36.38 +/**
   36.39 + * Spouštěč programu
   36.40 + *
   36.41 + * http://freedesktop.org/wiki/CommonExtendedAttributes
   36.42 + * http://download.oracle.com/javase/tutorial/essential/io/fileAttr.html#user
   36.43 + * http://today.java.net/pub/a/today/2008/07/03/jsr-203-new-file-apis.html
   36.44 + * #so-what-is-a-path-really
   36.45 + *
   36.46 + * $ setfattr -n "user.franta.pozdrav" -v 'Dobrý den!' pokus.txt (v javě pak
   36.47 + * pracujeme s klíči bez předpony „user.“)
   36.48 + *
   36.49 + * @author Ing. František Kučera (frantovo.cz)
   36.50 + */
   36.51 +public class Startér {
   36.52 +
   36.53 +	private static final Logger log = Logger
   36.54 +		.getLogger(Startér.class.getSimpleName());
   36.55 +	private static final ResourceBundle překlady = ResourceBundle
   36.56 +		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   36.57 +
   36.58 +	/**
   36.59 +	 * @param args název souboru
   36.60 +	 */
   36.61 +	public static void main(String[] args) {
   36.62 +
   36.63 +		try {
   36.64 +			// TODO: načítat konfiguraci i z XML souboru
   36.65 +			CLIParser parser = new CLIParser();
   36.66 +			Konfigurace konfigurace = parser.parsujParametry(args);
   36.67 +
   36.68 +			File soubor = konfigurace.getSoubor();
   36.69 +
   36.70 +			if (soubor.exists()) {
   36.71 +				log.log(Level.INFO, "Pracuji se souborem: {0}", soubor);
   36.72 +
   36.73 +				Model model = new Model(konfigurace);
   36.74 +
   36.75 +				final JFrame f = new JFrame();
   36.76 +				Panel p = new Panel(model);
   36.77 +
   36.78 +				f.setLayout(new BorderLayout());
   36.79 +				f.add(p, BorderLayout.CENTER);
   36.80 +
   36.81 +				// Ukončení programu klávesou Escape:
   36.82 +				f.getRootPane().registerKeyboardAction(new ActionListener() {
   36.83 +
   36.84 +					@Override
   36.85 +					public void actionPerformed(ActionEvent ae) {
   36.86 +						f.dispose();
   36.87 +					}
   36.88 +				},
   36.89 +					KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
   36.90 +					JComponent.WHEN_IN_FOCUSED_WINDOW);
   36.91 +
   36.92 +				f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
   36.93 +				f.setTitle(MessageFormat
   36.94 +					.format(překlady.getString("titulek"), soubor));
   36.95 +				f.setSize(640, 240);
   36.96 +				f.setLocationRelativeTo(null);
   36.97 +				f.setVisible(true);
   36.98 +			} else {
   36.99 +				ukončiChybou(MessageFormat.format(překlady
  36.100 +					.getString("chyba.souborNeexistuje"), soubor));
  36.101 +			}
  36.102 +		} catch (Exception e) {
  36.103 +			log.log(Level.SEVERE, překlady.getString("chyba"), e);
  36.104 +			ukončiChybou(e.getLocalizedMessage());
  36.105 +		}
  36.106 +	}
  36.107 +
  36.108 +	private static void ukončiChybou(String hláška) {
  36.109 +		log.log(Level.SEVERE, hláška);
  36.110 +		JOptionPane.showMessageDialog(null, hláška, překlady
  36.111 +			.getString("chyba.titulek"), JOptionPane.ERROR_MESSAGE);
  36.112 +		System.exit(1);
  36.113 +	}
  36.114 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/EditorHodnotAtributů.java	Sat Dec 16 20:13:13 2023 +0100
    37.3 @@ -0,0 +1,155 @@
    37.4 +/**
    37.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    37.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    37.7 + *
    37.8 + * This program is free software: you can redistribute it and/or modify
    37.9 + * it under the terms of the GNU General Public License as published by
   37.10 + * the Free Software Foundation, either version 3 of the License.
   37.11 + *
   37.12 + * This program is distributed in the hope that it will be useful,
   37.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   37.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   37.15 + * GNU General Public License for more details.
   37.16 + *
   37.17 + * You should have received a copy of the GNU General Public License
   37.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
   37.19 + */
   37.20 +package cz.frantovo.rozsireneatributy.gui;
   37.21 +
   37.22 +import cz.frantovo.rozsireneatributy.Konfigurace;
   37.23 +import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   37.24 +import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceHodnoty;
   37.25 +import java.awt.Component;
   37.26 +import java.awt.event.ActionEvent;
   37.27 +import java.awt.event.ActionListener;
   37.28 +import java.util.EventObject;
   37.29 +import java.util.Objects;
   37.30 +import javax.swing.JComboBox;
   37.31 +import javax.swing.JTable;
   37.32 +import javax.swing.event.CellEditorListener;
   37.33 +import javax.swing.event.ChangeEvent;
   37.34 +import javax.swing.event.EventListenerList;
   37.35 +import javax.swing.table.TableCellEditor;
   37.36 +import javax.swing.table.TableModel;
   37.37 +
   37.38 +/**
   37.39 + * Umožňuje výběr hodnoty atributu z předvoleného seznamu.
   37.40 + *
   37.41 + * @author Ing. František Kučera (frantovo.cz)
   37.42 + */
   37.43 +public class EditorHodnotAtributů
   37.44 +	extends JComboBox<String>
   37.45 +	implements TableCellEditor {
   37.46 +
   37.47 +	private final Konfigurace konfigurace;
   37.48 +	private JTable tabulka;
   37.49 +	private TableModel model;
   37.50 +	private int řádek;
   37.51 +	private int sloupec;
   37.52 +	protected EventListenerList posluchače = new EventListenerList();
   37.53 +	protected ChangeEvent událost = new ChangeEvent(this);
   37.54 +
   37.55 +	public EditorHodnotAtributů(Konfigurace konfigurace) {
   37.56 +		super();
   37.57 +		this.konfigurace = konfigurace;
   37.58 +		setEditable(true);
   37.59 +		addActionListener(new ActionListener() {
   37.60 +
   37.61 +			@Override
   37.62 +			public void actionPerformed(ActionEvent e) {
   37.63 +				fireEditiaceSkončila();
   37.64 +			}
   37.65 +		});
   37.66 +	}
   37.67 +
   37.68 +	protected void fireEditiaceSkončila() {
   37.69 +		for (Object posluchač : posluchače.getListenerList()) {
   37.70 +			if (posluchač instanceof CellEditorListener) {
   37.71 +				((CellEditorListener) posluchač).editingStopped(událost);
   37.72 +			}
   37.73 +		}
   37.74 +	}
   37.75 +
   37.76 +	protected void fireEditiaceZrušena() {
   37.77 +		for (Object posluchač : posluchače.getListenerList()) {
   37.78 +			if (posluchač instanceof CellEditorListener) {
   37.79 +				((CellEditorListener) posluchač).editingCanceled(událost);
   37.80 +			}
   37.81 +		}
   37.82 +	}
   37.83 +
   37.84 +	private void obnovHodnoty(Object hodnotaAtributu) {
   37.85 +		removeAllItems();
   37.86 +
   37.87 +		if (hodnotaAtributu == null) {
   37.88 +			hodnotaAtributu = "";
   37.89 +		} else if (!(hodnotaAtributu instanceof String)) {
   37.90 +			hodnotaAtributu = String.valueOf(hodnotaAtributu);
   37.91 +		}
   37.92 +		addItem((String) hodnotaAtributu);
   37.93 +		setSelectedItem(hodnotaAtributu);
   37.94 +
   37.95 +		Object názevAtributu = model.getValueAt(řádek, Panel.SLOUPEC_NÁZVU);
   37.96 +		for (DefiniceAtributu da : konfigurace.getAtributy()) {
   37.97 +			if (Objects.equals(názevAtributu, da.getNázev())) {
   37.98 +				for (DefiniceHodnoty dh : da.getHodnoty()) {
   37.99 +					addItem(dh.getNázev());
  37.100 +				}
  37.101 +			}
  37.102 +		}
  37.103 +
  37.104 +	}
  37.105 +
  37.106 +	@Override
  37.107 +	public Component getTableCellEditorComponent(
  37.108 +		JTable tabulka,
  37.109 +		Object hodnota,
  37.110 +		boolean vybraná,
  37.111 +		int řádek,
  37.112 +		int sloupec) //
  37.113 +	{
  37.114 +		this.řádek = řádek;
  37.115 +		this.sloupec = sloupec;
  37.116 +		this.tabulka = tabulka;
  37.117 +		this.model = tabulka.getModel();
  37.118 +		obnovHodnoty(hodnota);
  37.119 +		// TODO: více různých instancí?
  37.120 +		return this;
  37.121 +	}
  37.122 +
  37.123 +	@Override
  37.124 +	public Object getCellEditorValue() {
  37.125 +		return getSelectedItem();
  37.126 +	}
  37.127 +
  37.128 +	@Override
  37.129 +	public boolean isCellEditable(EventObject anEvent) {
  37.130 +		return true;
  37.131 +	}
  37.132 +
  37.133 +	@Override
  37.134 +	public boolean shouldSelectCell(EventObject anEvent) {
  37.135 +		return true;
  37.136 +	}
  37.137 +
  37.138 +	@Override
  37.139 +	public boolean stopCellEditing() {
  37.140 +		fireEditiaceSkončila();
  37.141 +		return true;
  37.142 +	}
  37.143 +
  37.144 +	@Override
  37.145 +	public void cancelCellEditing() {
  37.146 +		fireEditiaceZrušena();
  37.147 +	}
  37.148 +
  37.149 +	@Override
  37.150 +	public void addCellEditorListener(CellEditorListener l) {
  37.151 +		posluchače.add(CellEditorListener.class, l);
  37.152 +	}
  37.153 +
  37.154 +	@Override
  37.155 +	public void removeCellEditorListener(CellEditorListener l) {
  37.156 +		posluchače.remove(CellEditorListener.class, l);
  37.157 +	}
  37.158 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/EditorNázvůAtributů.java	Sat Dec 16 20:13:13 2023 +0100
    38.3 @@ -0,0 +1,190 @@
    38.4 +/**
    38.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    38.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    38.7 + *
    38.8 + * This program is free software: you can redistribute it and/or modify
    38.9 + * it under the terms of the GNU General Public License as published by
   38.10 + * the Free Software Foundation, either version 3 of the License.
   38.11 + *
   38.12 + * This program is distributed in the hope that it will be useful,
   38.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   38.15 + * GNU General Public License for more details.
   38.16 + *
   38.17 + * You should have received a copy of the GNU General Public License
   38.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
   38.19 + */
   38.20 +package cz.frantovo.rozsireneatributy.gui;
   38.21 +
   38.22 +import cz.frantovo.rozsireneatributy.Konfigurace;
   38.23 +import cz.frantovo.rozsireneatributy.Konfigurace.DefiniceAtributu;
   38.24 +import java.awt.Component;
   38.25 +import java.awt.event.ActionEvent;
   38.26 +import java.awt.event.ActionListener;
   38.27 +import java.util.EventObject;
   38.28 +import javax.swing.JComboBox;
   38.29 +import javax.swing.JTable;
   38.30 +import javax.swing.event.CellEditorListener;
   38.31 +import javax.swing.event.ChangeEvent;
   38.32 +import javax.swing.event.EventListenerList;
   38.33 +import javax.swing.table.TableCellEditor;
   38.34 +
   38.35 +/**
   38.36 + * Umožňuje výběr názvu atributu z předvoleného seznamu
   38.37 + * (standardizované atributy).
   38.38 + *
   38.39 + * @author Ing. František Kučera (frantovo.cz)
   38.40 + */
   38.41 +public class EditorNázvůAtributů
   38.42 +	extends JComboBox<String>
   38.43 +	implements TableCellEditor {
   38.44 +
   38.45 +	private final Konfigurace konfigurace;
   38.46 +	protected EventListenerList posluchače = new EventListenerList();
   38.47 +	protected ChangeEvent událost = new ChangeEvent(this);
   38.48 +
   38.49 +	public EditorNázvůAtributů(Konfigurace konfigurace) {
   38.50 +		super();
   38.51 +		this.konfigurace = konfigurace;
   38.52 +		setEditable(true);
   38.53 +		addActionListener(new ActionListener() {
   38.54 +
   38.55 +			@Override
   38.56 +			public void actionPerformed(ActionEvent e) {
   38.57 +				fireEditiaceSkončila();
   38.58 +			}
   38.59 +		});
   38.60 +	}
   38.61 +
   38.62 +	protected void fireEditiaceSkončila() {
   38.63 +		for (Object posluchač : posluchače.getListenerList()) {
   38.64 +			if (posluchač instanceof CellEditorListener) {
   38.65 +				((CellEditorListener) posluchač).editingStopped(událost);
   38.66 +			}
   38.67 +		}
   38.68 +	}
   38.69 +
   38.70 +	protected void fireEditiaceZrušena() {
   38.71 +		for (Object posluchač : posluchače.getListenerList()) {
   38.72 +			if (posluchač instanceof CellEditorListener) {
   38.73 +				((CellEditorListener) posluchač).editingCanceled(událost);
   38.74 +			}
   38.75 +		}
   38.76 +	}
   38.77 +
   38.78 +	/**
   38.79 +	 * TODO:
   38.80 +	 * - další standardní atributy
   38.81 +	 * - načítat z XML souboru
   38.82 +	 *
   38.83 +	 * @see http://www.freedesktop.org/wiki/CommonExtendedAttributes
   38.84 +	 */
   38.85 +	private void obnovHodnoty(Object názevAtributu) {
   38.86 +		removeAllItems();
   38.87 +
   38.88 +		if (názevAtributu == null) {
   38.89 +			názevAtributu = "";
   38.90 +		} else if (!(názevAtributu instanceof String)) {
   38.91 +			názevAtributu = String.valueOf(názevAtributu);
   38.92 +		}
   38.93 +		addItem((String) názevAtributu);
   38.94 +		setSelectedItem(názevAtributu);
   38.95 +		
   38.96 +		for (DefiniceAtributu da : konfigurace.getAtributy()) {
   38.97 +			addItem(da.getNázev());
   38.98 +		}
   38.99 +		
  38.100 +		if (!konfigurace.getAtributy().isEmpty()) return;
  38.101 +
  38.102 +		// General attributes in current use
  38.103 +		addItem("mime_type");
  38.104 +		addItem("charset");
  38.105 +		addItem("creator");
  38.106 +
  38.107 +		// Proposed metadata attributes
  38.108 +		addItem("xdg.comment");
  38.109 +		addItem("xdg.origin.url");
  38.110 +		addItem("xdg.origin.email.subject");
  38.111 +		addItem("xdg.origin.email.from");
  38.112 +		addItem("xdg.origin.email.message-id");
  38.113 +		addItem("xdg.language");
  38.114 +		addItem("xdg.creator");
  38.115 +		addItem("xdg.publisher");
  38.116 +
  38.117 +		// Proposed control attributes
  38.118 +		addItem("xdg.robots.index");
  38.119 +		addItem("xdg.robots.backup");
  38.120 +
  38.121 +		// Dublin Core
  38.122 +		addItem("dublincore.title");
  38.123 +		addItem("dublincore.creator");
  38.124 +		addItem("dublincore.subject");
  38.125 +		addItem("dublincore.description");
  38.126 +		addItem("dublincore.publisher");
  38.127 +		addItem("dublincore.contributor");
  38.128 +		addItem("dublincore.date");
  38.129 +		addItem("dublincore.type");
  38.130 +		addItem("dublincore.format");
  38.131 +		addItem("dublincore.identifier");
  38.132 +		addItem("dublincore.source");
  38.133 +		addItem("dublincore.language");
  38.134 +		addItem("dublincore.relation");
  38.135 +		addItem("dublincore.coverage");
  38.136 +		addItem("dublincore.rights");
  38.137 +
  38.138 +		// Application-specific attributes in current use
  38.139 +		addItem("mime_encoding");
  38.140 +		addItem("apache_handler");
  38.141 +		addItem("Beagle.AttrTime");
  38.142 +		addItem("Beagle.Fingerprint");
  38.143 +		addItem("Beagle.MTime");
  38.144 +		addItem("Beagle.Uid");
  38.145 +	}
  38.146 +
  38.147 +	@Override
  38.148 +	public Component getTableCellEditorComponent(
  38.149 +		JTable tabulka,
  38.150 +		Object hodnota,
  38.151 +		boolean vybraná,
  38.152 +		int řádek,
  38.153 +		int sloupec) {
  38.154 +		obnovHodnoty(hodnota);
  38.155 +		return this;
  38.156 +	}
  38.157 +
  38.158 +	@Override
  38.159 +	public Object getCellEditorValue() {
  38.160 +		return getSelectedItem();
  38.161 +	}
  38.162 +
  38.163 +	@Override
  38.164 +	public boolean isCellEditable(EventObject anEvent) {
  38.165 +		return true;
  38.166 +	}
  38.167 +
  38.168 +	@Override
  38.169 +	public boolean shouldSelectCell(EventObject anEvent) {
  38.170 +		return true;
  38.171 +	}
  38.172 +
  38.173 +	@Override
  38.174 +	public boolean stopCellEditing() {
  38.175 +		fireEditiaceSkončila();
  38.176 +		return true;
  38.177 +	}
  38.178 +
  38.179 +	@Override
  38.180 +	public void cancelCellEditing() {
  38.181 +		fireEditiaceZrušena();
  38.182 +	}
  38.183 +
  38.184 +	@Override
  38.185 +	public void addCellEditorListener(CellEditorListener l) {
  38.186 +		posluchače.add(CellEditorListener.class, l);
  38.187 +	}
  38.188 +
  38.189 +	@Override
  38.190 +	public void removeCellEditorListener(CellEditorListener l) {
  38.191 +		posluchače.remove(CellEditorListener.class, l);
  38.192 +	}
  38.193 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/Model.java	Sat Dec 16 20:13:13 2023 +0100
    39.3 @@ -0,0 +1,218 @@
    39.4 +/**
    39.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    39.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    39.7 + *
    39.8 + * This program is free software: you can redistribute it and/or modify
    39.9 + * it under the terms of the GNU General Public License as published by
   39.10 + * the Free Software Foundation, either version 3 of the License.
   39.11 + *
   39.12 + * This program is distributed in the hope that it will be useful,
   39.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   39.15 + * GNU General Public License for more details.
   39.16 + *
   39.17 + * You should have received a copy of the GNU General Public License
   39.18 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
   39.19 + */
   39.20 +package cz.frantovo.rozsireneatributy.gui;
   39.21 +
   39.22 +import cz.frantovo.rozsireneatributy.Atribut;
   39.23 +import cz.frantovo.rozsireneatributy.Konfigurace;
   39.24 +import java.io.File;
   39.25 +import java.io.IOException;
   39.26 +import java.io.RandomAccessFile;
   39.27 +import java.nio.ByteBuffer;
   39.28 +import java.nio.channels.FileChannel;
   39.29 +import java.nio.channels.FileLock;
   39.30 +import java.nio.file.Path;
   39.31 +import java.nio.file.attribute.UserDefinedFileAttributeView;
   39.32 +import java.nio.file.spi.FileSystemProvider;
   39.33 +import java.util.ArrayList;
   39.34 +import java.util.HashSet;
   39.35 +import java.util.List;
   39.36 +import java.util.ResourceBundle;
   39.37 +import java.util.Set;
   39.38 +import java.util.logging.Level;
   39.39 +import java.util.logging.Logger;
   39.40 +import javax.swing.event.TableModelEvent;
   39.41 +import javax.swing.event.TableModelListener;
   39.42 +import javax.swing.table.TableModel;
   39.43 +
   39.44 +/**
   39.45 + * @author Ing. František Kučera (frantovo.cz)
   39.46 + */
   39.47 +public class Model implements TableModel {
   39.48 +
   39.49 +	private static final Logger log = Logger
   39.50 +		.getLogger(Model.class.getSimpleName());
   39.51 +	private static final ResourceBundle překlady = ResourceBundle
   39.52 +		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   39.53 +	private final String[] sloupečky = {
   39.54 +		překlady.getString("tabulka.název"),
   39.55 +		překlady.getString("tabulka.hodnota")
   39.56 +	};
   39.57 +	private final Set<TableModelListener> posluchače = new HashSet<>();
   39.58 +	private final Konfigurace konfigurace;
   39.59 +	private final UserDefinedFileAttributeView souborovýSystém;
   39.60 +	private final List<Atribut> atributy = new ArrayList<>();
   39.61 +
   39.62 +	private RandomAccessFile zámekSoubor;
   39.63 +	private FileChannel zámekKanál;
   39.64 +	private FileLock zámek;
   39.65 +
   39.66 +	public Model(Konfigurace konfigurace) throws IOException {
   39.67 +		this.konfigurace = konfigurace;
   39.68 +		Path cesta = konfigurace.getSoubor().toPath();
   39.69 +		FileSystemProvider posyktovatelFS = cesta.getFileSystem().provider();
   39.70 +		souborovýSystém = posyktovatelFS
   39.71 +			.getFileAttributeView(cesta, UserDefinedFileAttributeView.class);
   39.72 +		načtiAtributy();
   39.73 +	}
   39.74 +
   39.75 +	public Konfigurace getKonfigurace() {
   39.76 +		return konfigurace;
   39.77 +	}
   39.78 +
   39.79 +	@Override
   39.80 +	public int getRowCount() {
   39.81 +		return atributy.size();
   39.82 +	}
   39.83 +
   39.84 +	@Override
   39.85 +	public int getColumnCount() {
   39.86 +		return sloupečky.length;
   39.87 +	}
   39.88 +
   39.89 +	@Override
   39.90 +	public String getColumnName(int n) {
   39.91 +		return sloupečky[n];
   39.92 +	}
   39.93 +
   39.94 +	@Override
   39.95 +	public Class<?> getColumnClass(int n) {
   39.96 +		return String.class;
   39.97 +	}
   39.98 +
   39.99 +	@Override
  39.100 +	public boolean isCellEditable(int m, int n) {
  39.101 +		return true;
  39.102 +	}
  39.103 +
  39.104 +	@Override
  39.105 +	public Object getValueAt(int m, int n) {
  39.106 +		switch (n) {
  39.107 +			case 0:
  39.108 +				return atributy.get(m).getKlíč();
  39.109 +			case 1:
  39.110 +				return atributy.get(m).getHodnota();
  39.111 +			default:
  39.112 +				return null;
  39.113 +		}
  39.114 +	}
  39.115 +
  39.116 +	@Override
  39.117 +	public void setValueAt(Object hodnota, int m, int n) {
  39.118 +		Atribut a = atributy.get(m);
  39.119 +		try {
  39.120 +			if (n == 0) {
  39.121 +				/**
  39.122 +				 * Měníme klíč – název atributu
  39.123 +				 */
  39.124 +				String novýKlíč = String.valueOf(hodnota);
  39.125 +				if (!novýKlíč.equals(a.getKlíč())) {
  39.126 +					if (a.isPlatnýKlíč()) {
  39.127 +						souborovýSystém.delete(a.getKlíč());
  39.128 +					}
  39.129 +					a.setKlíč(novýKlíč);
  39.130 +					if (a.isPlatnýKlíč() && a.isPlatnáHodnota()) {
  39.131 +						souborovýSystém.write(a.getKlíč(), a.getHodnotaBajty());
  39.132 +					}
  39.133 +				}
  39.134 +			} else if (n == 1) {
  39.135 +				/**
  39.136 +				 * Měníme hodnotu atributu
  39.137 +				 */
  39.138 +				a.setHodnota(String.valueOf(hodnota));
  39.139 +				if (a.isPlatnýKlíč() && a.isPlatnáHodnota()) {
  39.140 +					souborovýSystém.write(a.getKlíč(), a.getHodnotaBajty());
  39.141 +				}
  39.142 +			}
  39.143 +		} catch (IOException e) {
  39.144 +			log.log(Level.SEVERE, "Selhalo ukládání atributu na FS", e);
  39.145 +		}
  39.146 +	}
  39.147 +
  39.148 +	@Override
  39.149 +	public void addTableModelListener(TableModelListener l) {
  39.150 +		posluchače.add(l);
  39.151 +	}
  39.152 +
  39.153 +	@Override
  39.154 +	public void removeTableModelListener(TableModelListener l) {
  39.155 +		posluchače.remove(l);
  39.156 +	}
  39.157 +
  39.158 +	/**
  39.159 +	 * @param m číslo řádku
  39.160 +	 * @return atribut, který se na něm nachází
  39.161 +	 */
  39.162 +	public Atribut getAtribut(int m) {
  39.163 +		return atributy.get(m);
  39.164 +	}
  39.165 +
  39.166 +	public void přidejAtribut(Atribut a) {
  39.167 +		atributy.add(a);
  39.168 +		upozorniPosluchače();
  39.169 +	}
  39.170 +
  39.171 +	public void odeberAtribut(Atribut a) throws IOException {
  39.172 +		atributy.remove(a);
  39.173 +		if (a.isPlatnýKlíč()) {
  39.174 +			souborovýSystém.delete(a.getKlíč());
  39.175 +		}
  39.176 +		upozorniPosluchače();
  39.177 +	}
  39.178 +
  39.179 +	public final void načtiAtributy() throws IOException {
  39.180 +		List<String> jménaAtributů = souborovýSystém.list();
  39.181 +		atributy.clear();
  39.182 +		for (String jménoAtributu : jménaAtributů) {
  39.183 +			ByteBuffer hodnotaAtributu = ByteBuffer
  39.184 +				.allocate(souborovýSystém.size(jménoAtributu));
  39.185 +			souborovýSystém.read(jménoAtributu, hodnotaAtributu);
  39.186 +			atributy.add(new Atribut(jménoAtributu, hodnotaAtributu));
  39.187 +		}
  39.188 +		upozorniPosluchače();
  39.189 +	}
  39.190 +
  39.191 +	private void upozorniPosluchače() {
  39.192 +		for (TableModelListener p : posluchače) {
  39.193 +			p.tableChanged(new TableModelEvent(this));
  39.194 +		}
  39.195 +	}
  39.196 +
  39.197 +	public boolean isZámekPodporovaný() {
  39.198 +		return konfigurace.getSoubor().isFile();
  39.199 +	}
  39.200 +
  39.201 +	public void nastavZámek(boolean zamknout) throws IOException {
  39.202 +		if (!isZámekPodporovaný()) {
  39.203 +			throw new IOException(překlady
  39.204 +				.getString("chyba.lzeZamknoutJenSoubor"));
  39.205 +		}
  39.206 +
  39.207 +		if (zamknout && zámekSoubor == null) {
  39.208 +			zámekSoubor = new RandomAccessFile(konfigurace.getSoubor(), "rw");
  39.209 +			zámekKanál = zámekSoubor.getChannel();
  39.210 +			zámek = zámekKanál.lock();
  39.211 +		} else if (!zamknout && zámekSoubor != null) {
  39.212 +			zámek.release();
  39.213 +			zámekKanál.close();
  39.214 +			zámekSoubor.close();
  39.215 +			zámek = null;
  39.216 +			zámekKanál = null;
  39.217 +			zámekSoubor = null;
  39.218 +		}
  39.219 +
  39.220 +	}
  39.221 +}
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.form	Sat Dec 16 20:13:13 2023 +0100
    40.3 @@ -0,0 +1,112 @@
    40.4 +<?xml version="1.0" encoding="UTF-8" ?>
    40.5 +
    40.6 +<Form version="1.6" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
    40.7 +  <AuxValues>
    40.8 +    <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
    40.9 +    <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
   40.10 +    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
   40.11 +    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
   40.12 +    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
   40.13 +    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
   40.14 +    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
   40.15 +    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
   40.16 +    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
   40.17 +  </AuxValues>
   40.18 +
   40.19 +  <Layout>
   40.20 +    <DimensionLayout dim="0">
   40.21 +      <Group type="103" groupAlignment="0" attributes="0">
   40.22 +          <Group type="102" alignment="0" attributes="0">
   40.23 +              <EmptySpace max="-2" attributes="0"/>
   40.24 +              <Component id="tlačítkoPřidat" min="-2" max="-2" attributes="0"/>
   40.25 +              <EmptySpace max="-2" attributes="0"/>
   40.26 +              <Component id="tlačítkoSmazat" min="-2" max="-2" attributes="0"/>
   40.27 +              <EmptySpace max="-2" attributes="0"/>
   40.28 +              <Component id="tlačítkoZnovuNačíst" min="-2" max="-2" attributes="0"/>
   40.29 +              <EmptySpace max="-2" attributes="0"/>
   40.30 +              <Component id="tlačítkoZamknout" min="-2" max="-2" attributes="0"/>
   40.31 +              <EmptySpace max="-2" attributes="0"/>
   40.32 +              <Component id="tlačítkoKopírovat" min="-2" max="-2" attributes="0"/>
   40.33 +              <EmptySpace pref="25" max="32767" attributes="0"/>
   40.34 +          </Group>
   40.35 +          <Component id="posuvnýPanel" alignment="0" pref="543" max="32767" attributes="0"/>
   40.36 +      </Group>
   40.37 +    </DimensionLayout>
   40.38 +    <DimensionLayout dim="1">
   40.39 +      <Group type="103" groupAlignment="0" attributes="0">
   40.40 +          <Group type="102" alignment="1" attributes="0">
   40.41 +              <Component id="posuvnýPanel" pref="277" max="32767" attributes="0"/>
   40.42 +              <EmptySpace max="-2" attributes="0"/>
   40.43 +              <Group type="103" groupAlignment="3" attributes="0">
   40.44 +                  <Component id="tlačítkoPřidat" alignment="3" min="-2" max="-2" attributes="0"/>
   40.45 +                  <Component id="tlačítkoSmazat" alignment="3" min="-2" max="-2" attributes="0"/>
   40.46 +                  <Component id="tlačítkoZnovuNačíst" alignment="3" min="-2" max="-2" attributes="0"/>
   40.47 +                  <Component id="tlačítkoZamknout" alignment="3" min="-2" max="-2" attributes="0"/>
   40.48 +                  <Component id="tlačítkoKopírovat" alignment="3" min="-2" max="-2" attributes="0"/>
   40.49 +              </Group>
   40.50 +              <EmptySpace max="-2" attributes="0"/>
   40.51 +          </Group>
   40.52 +      </Group>
   40.53 +    </DimensionLayout>
   40.54 +  </Layout>
   40.55 +  <SubComponents>
   40.56 +    <Container class="javax.swing.JScrollPane" name="posuvn&#xfd;Panel">
   40.57 +
   40.58 +      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
   40.59 +    </Container>
   40.60 +    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoP&#x159;idat">
   40.61 +      <Properties>
   40.62 +        <Property name="mnemonic" type="int" value="112"/>
   40.63 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   40.64 +          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="p&#x159;idatAtribut" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   40.65 +        </Property>
   40.66 +      </Properties>
   40.67 +      <Events>
   40.68 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoP&#x159;idatActionPerformed"/>
   40.69 +      </Events>
   40.70 +    </Component>
   40.71 +    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoSmazat">
   40.72 +      <Properties>
   40.73 +        <Property name="mnemonic" type="int" value="115"/>
   40.74 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   40.75 +          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="smazatAtribut" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   40.76 +        </Property>
   40.77 +        <Property name="enabled" type="boolean" value="false"/>
   40.78 +      </Properties>
   40.79 +      <Events>
   40.80 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoSmazatActionPerformed"/>
   40.81 +      </Events>
   40.82 +    </Component>
   40.83 +    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoZnovuNa&#x10d;&#xed;st">
   40.84 +      <Properties>
   40.85 +        <Property name="mnemonic" type="int" value="122"/>
   40.86 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   40.87 +          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="znovuNa&#x10d;&#xed;st" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   40.88 +        </Property>
   40.89 +      </Properties>
   40.90 +      <Events>
   40.91 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoZnovuNa&#x10d;&#xed;stActionPerformed"/>
   40.92 +      </Events>
   40.93 +    </Component>
   40.94 +    <Component class="javax.swing.JToggleButton" name="tla&#x10d;&#xed;tkoZamknout">
   40.95 +      <Properties>
   40.96 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
   40.97 +          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="zamknout" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
   40.98 +        </Property>
   40.99 +      </Properties>
  40.100 +      <Events>
  40.101 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoZamknoutActionPerformed"/>
  40.102 +      </Events>
  40.103 +    </Component>
  40.104 +    <Component class="javax.swing.JButton" name="tla&#x10d;&#xed;tkoKop&#xed;rovat">
  40.105 +      <Properties>
  40.106 +        <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
  40.107 +          <ResourceString bundle="cz/frantovo/rozsireneatributy/P&#x159;eklady.properties" key="schr&#xe1;nka.kop&#xed;rovat" replaceFormat="java.util.ResourceBundle.getBundle(&quot;{bundleNameSlashes}&quot;).getString(&quot;{key}&quot;)"/>
  40.108 +        </Property>
  40.109 +      </Properties>
  40.110 +      <Events>
  40.111 +        <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="tla&#x10d;&#xed;tkoKop&#xed;rovatActionPerformed"/>
  40.112 +      </Events>
  40.113 +    </Component>
  40.114 +  </SubComponents>
  40.115 +</Form>
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/src/main/java/cz/frantovo/rozsireneatributy/gui/Panel.java	Sat Dec 16 20:13:13 2023 +0100
    41.3 @@ -0,0 +1,259 @@
    41.4 +/**
    41.5 + * Rozšířené atributy – program na správu rozšířených atributů souborů
    41.6 + * Copyright © 2012 František Kučera (frantovo.cz)
    41.7 + *
    41.8 + * This program is free software: you can redistribute it and/or modify
    41.9 + * it under the terms of the GNU General Public License as published by
   41.10 + * the Free Software Foundation, either version 3 of the License.
   41.11 + *
   41.12 + * This program is distributed in the hope that it will be useful,
   41.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   41.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
   41.15 + * GNU General Public License for more details.
   41.16 + *
   41.17 + * You should have received a copy of the GNU General Public License
   41.18 + * along with this program. If not, see <http://www.gnu.org/licenses/>.
   41.19 + */
   41.20 +package cz.frantovo.rozsireneatributy.gui;
   41.21 +
   41.22 +import cz.frantovo.rozsireneatributy.Atribut;
   41.23 +import cz.frantovo.rozsireneatributy.CSV;
   41.24 +import java.awt.Toolkit;
   41.25 +import java.awt.datatransfer.StringSelection;
   41.26 +import java.io.IOException;
   41.27 +import java.io.StringWriter;
   41.28 +import java.util.ResourceBundle;
   41.29 +import java.util.logging.Level;
   41.30 +import java.util.logging.Logger;
   41.31 +import javax.swing.JOptionPane;
   41.32 +import javax.swing.JTable;
   41.33 +import javax.swing.ListSelectionModel;
   41.34 +import javax.swing.event.ListSelectionEvent;
   41.35 +import javax.swing.event.ListSelectionListener;
   41.36 +
   41.37 +/**
   41.38 + * @author Ing. František Kučera (frantovo.cz)
   41.39 + */
   41.40 +public class Panel extends javax.swing.JPanel {
   41.41 +
   41.42 +	public static final int SLOUPEC_NÁZVU = 0;
   41.43 +	public static final int SLOUPEC_HODNOTY = 1;
   41.44 +	private static final Logger log = Logger
   41.45 +		.getLogger(Panel.class.getSimpleName());
   41.46 +	private static final ResourceBundle překlady = ResourceBundle
   41.47 +		.getBundle(Atribut.class.getPackageName() + ".Překlady");
   41.48 +	private Model model;
   41.49 +	private Atribut vybranýAtribut;
   41.50 +	private JTable tabulka;
   41.51 +
   41.52 +	public Panel(Model model) {
   41.53 +		this.model = model;
   41.54 +		initComponents();
   41.55 +
   41.56 +		tlačítkoZamknout.setEnabled(model.isZámekPodporovaný());
   41.57 +		tlačítkoZamknout.setToolTipText(model.isZámekPodporovaný()
   41.58 +			? překlady.getString("zamknout.popis")
   41.59 +			: překlady.getString("chyba.lzeZamknoutJenSoubor"));
   41.60 +
   41.61 +		tabulka = new JTable(model);
   41.62 +		nastavEditor();
   41.63 +		tabulka.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
   41.64 +		posuvnýPanel.setViewportView(tabulka);
   41.65 +
   41.66 +		tabulka.setRowHeight((int) (tabulka.getRowHeight() * 1.3));
   41.67 +
   41.68 +		/** Výběr aktuálního atributu v tabulce */
   41.69 +		tabulka.getSelectionModel().addListSelectionListener(
   41.70 +			new ListSelectionListener() {
   41.71 +
   41.72 +			@Override
   41.73 +			public void valueChanged(ListSelectionEvent e) {
   41.74 +				int řádek = tabulka.getSelectedRow();
   41.75 +				if (řádek < 0) {
   41.76 +					vybranýAtribut = null;
   41.77 +					tlačítkoSmazat.setEnabled(false);
   41.78 +				} else {
   41.79 +					vybranýAtribut = getModel().getAtribut(řádek);
   41.80 +					tlačítkoSmazat.setEnabled(true);
   41.81 +				}
   41.82 +			}
   41.83 +		});
   41.84 +	}
   41.85 +
   41.86 +	private void nastavEditor() {
   41.87 +		tabulka.getColumnModel().getColumn(SLOUPEC_NÁZVU)
   41.88 +			.setCellEditor(new EditorNázvůAtributů(model.getKonfigurace()));
   41.89 +		tabulka.getColumnModel().getColumn(SLOUPEC_HODNOTY)
   41.90 +			.setCellEditor(new EditorHodnotAtributů(model.getKonfigurace()));
   41.91 +	}
   41.92 +
   41.93 +	private Model getModel() {
   41.94 +		return model;
   41.95 +	}
   41.96 +
   41.97 +	public void setModel(Model model) {
   41.98 +		this.model = model;
   41.99 +		tabulka.setModel(model);
  41.100 +		nastavEditor();
  41.101 +	}
  41.102 +
  41.103 +	private void zobrazChybovouHlášku(String hláška, Throwable chyba) {
  41.104 +		JOptionPane.showMessageDialog(this, hláška + "\n"
  41.105 +			+ chyba.getLocalizedMessage(),
  41.106 +			překlady.getString("chyba.titulek"), JOptionPane.ERROR_MESSAGE);
  41.107 +		log.log(Level.WARNING, hláška, chyba);
  41.108 +	}
  41.109 +	
  41.110 +	private void kopírujDoSchránky() {
  41.111 +		try {
  41.112 +			StringWriter výstup = new StringWriter();
  41.113 +			CSV csv = new CSV(výstup);
  41.114 +
  41.115 +			csv.hodnota(překlady.getString("tabulka.název").toLowerCase());
  41.116 +			csv.hodnota(překlady.getString("tabulka.hodnota").toLowerCase());
  41.117 +			csv.konecŘádku();
  41.118 +
  41.119 +			for (int i = 0; i < model.getRowCount(); i++) {
  41.120 +				csv.hodnota(String.valueOf(model.getValueAt(i, 0)));
  41.121 +				csv.hodnota(String.valueOf(model.getValueAt(i, 1)));
  41.122 +				csv.konecŘádku();
  41.123 +			}
  41.124 +
  41.125 +			Toolkit.getDefaultToolkit().getSystemClipboard().setContents(
  41.126 +				new StringSelection(výstup.toString()),
  41.127 +				null
  41.128 +			);
  41.129 +		} catch (Exception e) {
  41.130 +			zobrazChybovouHlášku(překlady
  41.131 +				.getString("chyba.nepodařiloSeZkopírovat"), e);
  41.132 +		}
  41.133 +	}
  41.134 +
  41.135 +	@SuppressWarnings("unchecked")
  41.136 +    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  41.137 +    private void initComponents() {
  41.138 +
  41.139 +        posuvnýPanel = new javax.swing.JScrollPane();
  41.140 +        tlačítkoPřidat = new javax.swing.JButton();
  41.141 +        tlačítkoSmazat = new javax.swing.JButton();
  41.142 +        tlačítkoZnovuNačíst = new javax.swing.JButton();
  41.143 +        tlačítkoZamknout = new javax.swing.JToggleButton();
  41.144 +        tlačítkoKopírovat = new javax.swing.JButton();
  41.145 +
  41.146 +        tlačítkoPřidat.setMnemonic('p');
  41.147 +        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("cz/frantovo/rozsireneatributy/Překlady"); // NOI18N
  41.148 +        tlačítkoPřidat.setText(bundle.getString("přidatAtribut")); // NOI18N
  41.149 +        tlačítkoPřidat.addActionListener(new java.awt.event.ActionListener() {
  41.150 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  41.151 +                tlačítkoPřidatActionPerformed(evt);
  41.152 +            }
  41.153 +        });
  41.154 +
  41.155 +        tlačítkoSmazat.setMnemonic('s');
  41.156 +        tlačítkoSmazat.setText(bundle.getString("smazatAtribut")); // NOI18N
  41.157 +        tlačítkoSmazat.setEnabled(false);
  41.158 +        tlačítkoSmazat.addActionListener(new java.awt.event.ActionListener() {
  41.159 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  41.160 +                tlačítkoSmazatActionPerformed(evt);
  41.161 +            }
  41.162 +        });
  41.163 +
  41.164 +        tlačítkoZnovuNačíst.setMnemonic('z');
  41.165 +        tlačítkoZnovuNačíst.setText(bundle.getString("znovuNačíst")); // NOI18N
  41.166 +        tlačítkoZnovuNačíst.addActionListener(new java.awt.event.ActionListener() {
  41.167 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  41.168 +                tlačítkoZnovuNačístActionPerformed(evt);
  41.169 +            }
  41.170 +        });
  41.171 +
  41.172 +        tlačítkoZamknout.setText(bundle.getString("zamknout")); // NOI18N
  41.173 +        tlačítkoZamknout.addActionListener(new java.awt.event.ActionListener() {
  41.174 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  41.175 +                tlačítkoZamknoutActionPerformed(evt);
  41.176 +            }
  41.177 +        });
  41.178 +
  41.179 +        tlačítkoKopírovat.setText(bundle.getString("schránka.kopírovat")); // NOI18N
  41.180 +        tlačítkoKopírovat.addActionListener(new java.awt.event.ActionListener() {
  41.181 +            public void actionPerformed(java.awt.event.ActionEvent evt) {
  41.182 +                tlačítkoKopírovatActionPerformed(evt);
  41.183 +            }
  41.184 +        });
  41.185 +
  41.186 +        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
  41.187 +        this.setLayout(layout);
  41.188 +        layout.setHorizontalGroup(
  41.189 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  41.190 +            .addGroup(layout.createSequentialGroup()
  41.191 +                .addContainerGap()
  41.192 +                .addComponent(tlačítkoPřidat)
  41.193 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  41.194 +                .addComponent(tlačítkoSmazat)
  41.195 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  41.196 +                .addComponent(tlačítkoZnovuNačíst)
  41.197 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  41.198 +                .addComponent(tlačítkoZamknout)
  41.199 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  41.200 +                .addComponent(tlačítkoKopírovat)
  41.201 +                .addContainerGap(25, Short.MAX_VALUE))
  41.202 +            .addComponent(posuvnýPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 543, Short.MAX_VALUE)
  41.203 +        );
  41.204 +        layout.setVerticalGroup(
  41.205 +            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  41.206 +            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
  41.207 +                .addComponent(posuvnýPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)
  41.208 +                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  41.209 +                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  41.210 +                    .addComponent(tlačítkoPřidat)
  41.211 +                    .addComponent(tlačítkoSmazat)
  41.212 +                    .addComponent(tlačítkoZnovuNačíst)
  41.213 +                    .addComponent(tlačítkoZamknout)
  41.214 +                    .addComponent(tlačítkoKopírovat))
  41.215 +                .addContainerGap())
  41.216 +        );
  41.217 +    }// </editor-fold>//GEN-END:initComponents
  41.218 +
  41.219 +	private void tlačítkoPřidatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoPřidatActionPerformed
  41.220 +		model.přidejAtribut(new Atribut());
  41.221 +	}//GEN-LAST:event_tlačítkoPřidatActionPerformed
  41.222 +
  41.223 +	private void tlačítkoSmazatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoSmazatActionPerformed
  41.224 +		try {
  41.225 +			model.odeberAtribut(vybranýAtribut);
  41.226 +		} catch (IOException e) {
  41.227 +			zobrazChybovouHlášku(překlady
  41.228 +				.getString("chyba.nepodařiloSeSmazat"), e);
  41.229 +		}
  41.230 +	}//GEN-LAST:event_tlačítkoSmazatActionPerformed
  41.231 +
  41.232 +	private void tlačítkoZnovuNačístActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoZnovuNačístActionPerformed
  41.233 +		try {
  41.234 +			model.načtiAtributy();
  41.235 +		} catch (IOException e) {
  41.236 +			zobrazChybovouHlášku(překlady
  41.237 +				.getString("chyba.nepodařiloSeNačíst"), e);
  41.238 +		}
  41.239 +	}//GEN-LAST:event_tlačítkoZnovuNačístActionPerformed
  41.240 +
  41.241 +    private void tlačítkoZamknoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoZamknoutActionPerformed
  41.242 +		try {
  41.243 +			model.nastavZámek(tlačítkoZamknout.isSelected());
  41.244 +		} catch (Exception e) {
  41.245 +			zobrazChybovouHlášku(překlady
  41.246 +				.getString("chyba.nepodařiloSeNastavitZámek"), e);
  41.247 +		}
  41.248 +    }//GEN-LAST:event_tlačítkoZamknoutActionPerformed
  41.249 +
  41.250 +    private void tlačítkoKopírovatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tlačítkoKopírovatActionPerformed
  41.251 +		kopírujDoSchránky();
  41.252 +    }//GEN-LAST:event_tlačítkoKopírovatActionPerformed
  41.253 +
  41.254 +    // Variables declaration - do not modify//GEN-BEGIN:variables
  41.255 +    private javax.swing.JScrollPane posuvnýPanel;
  41.256 +    private javax.swing.JButton tlačítkoKopírovat;
  41.257 +    private javax.swing.JButton tlačítkoPřidat;
  41.258 +    private javax.swing.JButton tlačítkoSmazat;
  41.259 +    private javax.swing.JToggleButton tlačítkoZamknout;
  41.260 +    private javax.swing.JButton tlačítkoZnovuNačíst;
  41.261 +    // End of variables declaration//GEN-END:variables
  41.262 +}
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/src/main/resources/cz/frantovo/rozsireneatributy/Překlady.properties	Sat Dec 16 20:13:13 2023 +0100
    42.3 @@ -0,0 +1,1 @@
    42.4 +Překlady_cs.properties
    42.5 \ No newline at end of file
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/src/main/resources/cz/frantovo/rozsireneatributy/Překlady_cs.properties	Sat Dec 16 20:13:13 2023 +0100
    43.3 @@ -0,0 +1,25 @@
    43.4 +titulek=Roz\u0161\u00ed\u0159en\u00e9 stributy souboru: {0}
    43.5 +
    43.6 +chyba=Chyba:
    43.7 +chyba.titulek=Chyba
    43.8 +chyba.souborNeexistuje=Soubor neexistuje: {0}
    43.9 +chyba.nepoda\u0159iloSeSmazat=Nepoda\u0159ilo se smazat atribut.
   43.10 +chyba.nepoda\u0159iloSeNa\u010d\u00edst=Nepoda\u0159ilo se na\u010d\u00edst atributy.
   43.11 +chyba.nepoda\u0159iloSeZkop\u00edrovat=Nepoda\u0159ilo se zkop\u00edrovat atributy do schr\u00e1nky.
   43.12 +chyba.nepoda\u0159iloSeNastavitZ\u00e1mek=Nepoda\u0159ilo se nastavit z\u00e1mek.
   43.13 +chyba.lzeZamknoutJenSoubor=Je podporov\u00e1no zamyk\u00e1n\u00ed pouze norm\u00e1ln\u00edch sobour\u016f ne adres\u00e1\u0159\u016f atd.
   43.14 +chyba.cli.nezn\u00e1m\u00fdParametr=Nezn\u00e1m\u00fd parametr: 
   43.15 +chyba.cli.chyb\u00edDefiniceAtributu=Chyb\u00ed definice atributu (hodnota se vztahuje k n\u00ed).
   43.16 +chyba.cli.chyb\u00edSoubor=Nebyl uveden soubor.
   43.17 +
   43.18 +tabulka.n\u00e1zev=N\u00e1zev
   43.19 +tabulka.hodnota=Hodnota
   43.20 +
   43.21 +schr\u00e1nka.kop\u00edrovat=Kop\u00edrovat
   43.22 +schr\u00e1nka.vlo\u017eit=Vlo\u017eit
   43.23 +
   43.24 +p\u0159idatAtribut=P\u0159idat atribut
   43.25 +smazatAtribut=Smazat atribut
   43.26 +znovuNa\u010d\u00edst=Znovu na\u010d\u00edst
   43.27 +zamknout=Zamknout
   43.28 +zamknout.popis=Otev\u0159e soubor pro z\u00e1pis a vytvo\u0159\u00ed na n\u011bm z\u00e1mek. P\u0159i odemknut\u00ed uvoln\u00ed z\u00e1mek a zav\u0159e soubor.
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/src/main/resources/cz/frantovo/rozsireneatributy/Překlady_en.properties	Sat Dec 16 20:13:13 2023 +0100
    44.3 @@ -0,0 +1,25 @@
    44.4 +titulek=Extended Attributes of file: {0}
    44.5 +
    44.6 +chyba=Error:
    44.7 +chyba.titulek=Error
    44.8 +chyba.souborNeexistuje=File does not exist: {0}
    44.9 +chyba.nepoda\u0159iloSeSmazat=Failed to delete the attribute.
   44.10 +chyba.nepoda\u0159iloSeNa\u010d\u00edst=Failed to load attributes.
   44.11 +chyba.nepoda\u0159iloSeZkop\u00edrovat=Unable to copy attributes to the clipboard.
   44.12 +chyba.nepoda\u0159iloSeNastavitZ\u00e1mek=Unable to lock the file.
   44.13 +chyba.lzeZamknoutJenSoubor=File locking is supported only for regular files, not for directories or specials.
   44.14 +chyba.cli.nezn\u00e1m\u00fdParametr=Unknown option: 
   44.15 +chyba.cli.chyb\u00edDefiniceAtributu=Missing attribute definition (value is associated with it).
   44.16 +chyba.cli.chyb\u00edSoubor=File name was not specified.
   44.17 +
   44.18 +tabulka.n\u00e1zev=Name
   44.19 +tabulka.hodnota=Value
   44.20 +
   44.21 +schr\u00e1nka.kop\u00edrovat=Copy
   44.22 +schr\u00e1nka.vlo\u017eit=Paste
   44.23 +
   44.24 +p\u0159idatAtribut=Add attribute
   44.25 +smazatAtribut=Delete attribute
   44.26 +znovuNa\u010d\u00edst=Reload all
   44.27 +zamknout=Lock
   44.28 +zamknout.popis=Open the file for write and lock it. On unlocking, release the lock and close the file.