doc-src/isac/CTP-userinterfaces.tex
branchdecompose-isar
changeset 38106 90c4c3bb47d9
parent 38096 4872b10c8747
parent 38105 89510a21f9c4
child 38107 6a4748fdd60d
equal deleted inserted replaced
38096:4872b10c8747 38106:90c4c3bb47d9
    54 %specifically designed a 'meta language' (ML)
    54 %specifically designed a 'meta language' (ML)
    55 %http://en.wikipedia.org/wiki/ML\_(programming\_language)
    55 %http://en.wikipedia.org/wiki/ML\_(programming\_language)
    56 %\cite{pl:milner97}
    56 %\cite{pl:milner97}
    57 %for developing CTP
    57 %for developing CTP
    58 \subsubsection{Standard ML}
    58 \subsubsection{Standard ML}
    59 Standard ML is a general-purpose, modular, functional programming language. 
    59 Standard ML is a general-purpose, modular, functional programming language. \cite{pl:milner97}
    60 Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. 
    60 Programs written in Standard ML consist of expressions to be evaluated, as opposed to statements or commands. 
    61 SML is a modern descendant of the ML programming language used in the Logic for Computable Functions (LCF) theorem-proving project. 
    61 Functional programming languages constitude a ???? very differnt of object orientated languages, see Sect. \ref{ml-users}. ML originated from the LCF-project(Logic for Computable Functions)\cite{meta-Ml}, where it had been developed as a meta language. Since ML has been standardised this family of language is called Standard ML. Important for the logical foundation of SML is the $\lambda$-calculus.
    62 It is invented by Robin Milner. %http://en.wikipedia.org/wiki/Standard_M 
    62 %http://en.wikipedia.org/wiki/Standard_M 
    63 \subsubsection{Coq}
    63 \subsubsection{Coq}
    64 Coq is an interactive theorem prover, developed in France. The team leader is Senior Scientist Benjamin Werner. 
    64 Coq is an interactive theorem prover, developed in France.
    65 Coq is in Objective Caml programmed, an ML based programming language.
    65 It is programmed in Objective Caml, an ML based programming language.
    66 It has the ability to express  mathematical  assertions and check proof of mathematical  assertions. 
    66 It has the ability to express  mathematical  assertions and check proof of mathematical assertions. 
    67 Furthermore Coq includes automatic theorem proving tactics and decision procedures.
    67 Furthermore Coq includes automatic theorem proving tactics and decision procedures.
    68 Proof development in Coq is done through a language of tactics that allows a user-guided proof process. 
    68 Properties, programs and proofs are written a functional programming language called the Calculus of Inductive Constructions (CIC).
    69 At the end, the user can check that tactics build lambda-terms. 
    69 Proof development in Coq is done through a language of tactics that allows a user-guided proof process.\cite{coq1999}
       
    70   
    70 Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml 
    71 Another feature of Coq is “that it can automatically extract executable programs from specifications, as either Objective Caml 
    71 or Haskell source code.“
    72 or Haskell source code.“
    72 Properties, programs and proofs are written a language called the Calculus of Inductive Constructions (CIC).
    73 
    73 Coq is based on a type-checking algorithm, therefore Coq uses only typing judgements.
    74 There are many easy-to-read introductions to Coq \footnote{http://coq.inria.fr/a-short-introduction-to-coq} on the internet.
    74 Coq supports a functional programming language.
       
    75 (http://coq.inria.fr/a-short-introduction-to-coq)
       
    76 \subsubsection{Isabelle}
    75 \subsubsection{Isabelle}
    77 Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. 
    76 Isabelle is an interactive theorem proving framework for high-level natural deduction proofs \cite{Paulson:Isa94}, written in Standard ML. 
    78 Isabelle is developed at University of Cambridge (Larry Paulson), Technische Universität München (Tobias Nipkow) 
    77 Isabelle is developed at University of Cambridge (Larry Paulson), Technische Universit\"at M\"unchen
    79 and Université Paris-Sud (Makarius Wenzel).
    78 and Université Paris-Sud. Isabelle is called a framework, because it implements serveral object logics.
    80 The most widespread instance of Isabelle nowadays is Isabelle/HOL, providing a higher-order logic theorem proving environment.
    79 The most widespread logic of Isabelle is Isabelle/HOL, short for higher-order logic.
    81 Isabelle/HOL includes several  specification tools, e.g. for datatypes, inductive definitions and functions with complex pattern matching.
    80 Isabelle/HOL includes several  specification tools, e.g. for datatypes, inductive definitions and functions with complex pattern matching.
    82 Proofs are written in the structured proof language Isar. Isabelle implements several tools to increase the user's productivity in theorem proving. 
    81 Proofs are written in the structured proof language Isar.\cite{wenzel:isar} Isabelle implements several tools, e.g. a reasoner, a simplifier and powerful automatic provers(Slegehammer), increase the user's productivity in theorem proving. 
    83 Isabelle's classical reasoner is used to check formulas. The simplifier can reason with and about equations. 
       
    84 Linear arithmetic facts are proved automatically.
       
    85 Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols.
    82 Isabelle provides notational support: new notations can be introduced, using normal mathematical symbols.
    86 Definitions and proofs may include LaTeX source, from which Isabelle can automatically generate typeset documents.
    83 Definitions and proofs may include LaTeX source, from which Isabelle can automatically generate typeset documents.
    87 Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell.
    84 Isabelle/HOL allows to turn executable specifications directly into code in SML, OCaml, and Haskell.\cite{Haftmann-Nipkow:2010:code}
    88 (http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html)
    85 (http://www.cl.cam.ac.uk/research/hvg/Isabelle/overview.html)
    89 \subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa}
    86 \subsection{Userinterfaces for CTP: Coq and Isabelle}\label{gui-coq-isa}
    90 %     CoqIDE, ..
    87 %     CoqIDE, ..
    91 %         http://coq.inria.fr/what-is-coq?q=node/57\\
    88 %         http://coq.inria.fr/what-is-coq?q=node/57\\
    92 %         earlier than Isabelle/jEdit
    89 %         earlier than Isabelle/jEdit
   119 
   116 
   120 
   117 
   121 (http://coq.inria.fr/V8.1/refman/Reference-Manual016.html)
   118 (http://coq.inria.fr/V8.1/refman/Reference-Manual016.html)
   122 \subsubsection{Proof General for Isabelle}
   119 \subsubsection{Proof General for Isabelle}
   123 Proof General is a generic front-end for proof assistants, based on the customizable text editor Emacs.
   120 Proof General is a generic front-end for proof assistants, based on the customizable text editor Emacs.
   124 Proof General has been developed at the LFCS in the University of Edinburgh with contributions from other sites.
   121 It has been developed at  the University of Edinburgh with contributions from other sites.
   125 Proof General comes ready-to-go for these proof assistants: Isabelle, Coq, PhoX, LEGO.
   122 Proof General comes ready-to-go for these proof assistants: Isabelle, Coq, PhoX, LEGO.
   126 Proof General is used to write proof scripts. A Proof Script is a sequence of commands sent to theorem prover. 
   123 Proof General is used to write proof scripts. A Proof Script is a sequence of commands sent to theorem prover. 
   127 The communication between the user and the theorem prover takes place via two or  more Emacs text widgets. 
   124 The communication between the user and the theorem prover takes place via two or  more Emacs text widgets. 
   128 Therefore the user sees only the output from the latest proof step.(proofgeneral.ps.gz)
   125 Therefore the user sees only the output from the latest proof step.(proofgeneral.ps.gz)
   129 
   126 
   140 \subsubsection{Isabelle/Jedit}
   137 \subsubsection{Isabelle/Jedit}
   141 jEdit is a text editor for programmers, written in Java.
   138 jEdit is a text editor for programmers, written in Java.
   142 Compared to fully-featured IDEs, such as Eclipse or Netbeans, jEdit is much 
   139 Compared to fully-featured IDEs, such as Eclipse or Netbeans, jEdit is much 
   143 smaller and better focused on its primary task of text editing.
   140 smaller and better focused on its primary task of text editing.
   144 The general look of the Isabelle/jEdit plugin is similar to existing Java IDEs.
   141 The general look of the Isabelle/jEdit plugin is similar to existing Java IDEs.
   145 The main Isabelle/jEdit plugin consists of ≈ 10 small Scala files  that augment some key jEdit components in order to provide a metaphor of asynchronous 
   142 The main Isabelle/jEdit plugin consists of ten small Scala files  that augment some key jEdit components in order to provide a metaphor of asynchronous 
   146 proof document editing. 
   143 proof document editing. 
   147 Isabelle/jEdit integrates the jEdit 4.3.2 framework  and some further  jEdit plugins. 
   144 Isabelle/jEdit integrates the jEdit 4.3.2 framework  and some further  jEdit plugins. 
   148 It also implements custom-made IsabelleText Unicode font that actually contains the usual Isabelle symbols that users expect from long 
   145 It also implements custom-made IsabelleText Unicode font that actually contains the usual Isabelle symbols that users expect from long 
   149 years of Proof General X-Symbol support. 
   146 years of Proof General X-Symbol support. 
   150 The editor provides useful feedback, via semantic information from the processed document in the background. 
   147 The editor provides useful feedback, via semantic information from the processed document in the background. 
   151 This achieves continuous proof checking based on our 
   148 This achieves continuous proof checking based on 
   152 asynchronous prover toplevel. A lot of information can be directly attached 
   149 asynchronous prover toplevel. A lot of information can be directly attached 
   153 to the source text, via coloring, tooltips, popups etc.
   150 to the source text, via coloring, tooltips, popups etc.
   154 
   151 
   155 \subsection{Upcoming requirements for userinterfaces in CTP}\label{gui-requir}
   152 \subsection{Upcoming requirements for userinterfaces in CTP}\label{gui-requir}
   156 %     @ interaction close to tty (Telegraph)\\
   153 %     @ interaction close to tty (Telegraph)\\
   317 This plan involves the following details.
   314 This plan involves the following details.
   318 
   315 
   319 \subsection{Add a plug-in to jEdit}\label{plugin}
   316 \subsection{Add a plug-in to jEdit}\label{plugin}
   320     % file structure, copied from example project ...
   317     % file structure, copied from example project ...
   321 %Die von jEdit verfolgte Strategie im Bezug auf Plugin-Management und natürlich generell die totale Offenlegegung des Codes ist für ein Projekt wie Isabelle und auch für das Isac-Project an der TU ideal. Plugins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden Plugins ist auch die Adaption von Plugins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\
   318 %Die von jEdit verfolgte Strategie im Bezug auf Plugin-Management und natürlich generell die totale Offenlegegung des Codes ist für ein Projekt wie Isabelle und auch für das Isac-Project an der TU ideal. Plugins lassen sich sehr einfach anfügen und durch die riesige Vielfalt von bereits bestehenden Plugins ist auch die Adaption von Plugins möglich bzw. zu empfehlen, denn warum sollte nicht bereits funktionierender Code verwendet werden?\\
   322 The importance of connecting the ML-world with the world of user interfaces has been is discussed in Sect.\ref{ml-users}. jEdit follows these lines, it is an open-source, Java-based text editor that works on Windows, Mac OS X, and Linux. A big advantage of jEdit is, that there is a very good and also simple way to use and write a Plugin. There are a lot of useful and powerful Plugins available in the net and it is also possible to use a existing Plugin as part of a new one. Because of this facts, jEdit is very suitable for a project like Isabelle and also for the \sisac-project at TU-Graz.
   319 The importance of connecting the ML-world with the world of user interfaces has been is discussed in Sect.\ref{ml-users}. jEdit follows these lines, it is an open-source, Java-based text editor that works on Windows, Mac OS X, and Linux. A big advantage of jEdit is, that there is a very good and also simple way to use and write a Plugin. There are a lot of useful and powerful Plugins available in the net and it is also possible to use a existing Plugin as part of a new one. Because of this facts, jEdit is very suitable for a project like Isabelle and also for the Isac-project at TU-Graz. \\\\
   323 
   320 Each jEdit-Plugin basically consists of source files, written in Java or Scala, XML-files and property files. The XML-Files are important for the administration of a Plugin and provides information like the name, author, ... of the Plugin. They are also containing small pieces of BeanShell code which is executed upon a user request. (Like pressing the 'start plugin' button.) So the XML-files provide the “glue” between user input and specific Plugin routines located in the source files. As you see, this files are used as interface between the Plugin and the jEdit engine itself.\\
   324 Each jEdit-Plugin\footnote{To get more information about the jEdit infrastructure see: http://jedit.org/users-guide/plugin-intro} basically consists of source files, written in Java or Scala, XML-files and property files. The XML-Files are important for the administration of a Plugin and provides information like the name, author, ... of the Plugin. They are also containing small pieces of BeanShell code which is executed upon a user request. (Like pressing the 'start plugin' button.) So the XML-files provide the “glue” between user input and specific Plugin routines located in the source files. As you see, this files are used as interface between the Plugin and the jEdit engine itself.
       
   325 
       
   326 Based on the jEdit API, you are allowed to design your code quit freely and don't have to use a prescribed way to implement your ideas.    
   321 Based on the jEdit API, you are allowed to design your code quit freely and don't have to use a prescribed way to implement your ideas.    
   327 
   322 To get more information about the jEdit infrastructure see: http://jedit.org/users-guide/plugin-intro
   328 
   323 \\\\
   329 %isabell plugin beschreiben!!!!!!!!
   324 %isabell plugin beschreiben!!!!!!!!
   330 The Isabelle-team also follow use this Plugin-structure. In the next paragraph the involved files will be described. The jEdit-Isabelle-Plugin consists of:
   325 The Isabelle-team also follow use this Plugin-structure. In the next paragraph the involved files will be described. The jEdit-Isabelle-Plugin consists of:
   331 \begin{itemize}
   326 \begin{itemize}
       
   327 \item 14 Scala-source-files
       
   328 \item three XML-files
   332 \item one property file
   329 \item one property file
   333 \item three XML-files
       
   334 \item 14 Scala-source-files
       
   335 \end{itemize}
   330 \end{itemize}
   336 %Das vom Isabelle-Team erstellte jEdit-Plugin folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses Plugin eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. 
   331 %Das vom Isabelle-Team erstellte jEdit-Plugin folgt natürlich auch dem oben erklärten Muster. Es wird nun genauer auf dieses Plugin eingegangen. The plugin consits of 14 scala-source-files, three xml-files and one property-file. 
   337 \begin{description}
   332 The property-file \textit{Isabelle.props} contains general informations about the Isabelle-Plugin and the needed dependencies between Isabelle and the other used Plugins like sidekick. \\
   338 \item[Isabelle.props] The property-file \textit{Isabelle.props} contains general informations about the Isabelle-Plugin and the needed dependencies between Isabelle and the other used Plugins like sidekick.
   333 The XML-file \textit{dockables.xml} is used to create the needed dock-able windows which are important to set up the GUI of the Plugin.\\
   339 \item[dockables.xml] The XML-file \textit{dockables.xml} is used to create the needed dock-able windows which are important to set up the GUI of the Plugin.
   334 In the file \textit{actions.xml}, the dockable windows are added to the window-manager \textit{wm} and there is also some Beanshell-code to activate the Isabelle-GUI.\\
   340 \item[actions.xml] In the file \textit{actions.xml}, the dockable windows are added to the window-manager \textit{wm} and there is also some Beanshell-code to activate the Isabelle-GUI.
   335 The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit-Plugins.\\
   341 \item[services.xml] The last XML-file is \textit{services.xml} and is used to create instances of needed jEdit-Plugins.
   336 This four files are located in the folder \textit{plugin}.\\\\
   342 \end{description}
   337 The more interesting files, the scala-files of the Plugin, can be found in the 'src/jedit'-directory. In this directory you can find the file \textit{Dummy.java} which is a dummy class and is simply used to make javadoc work. Just forget about this file. Also there is a folder/package \textit{jedit} which contains all Scala-source-files. Now it is time to take a closer look on the source-files: \\
   343 This four files are located in the folder \textit{plugin}.\\
   338 The file \textit{plugin.scala} is the main-file of the Isabelle-Plugin and there are two important parts. First the \textit{Isabelle object}. This object contains data like name and path and also few basic functions. The second part is the \textit{class Plugin} which is derived from EBPlugin. Here the basic methods \textit{handleMessage}, \textit{start} and \textit{stop} are implemented. Each jEdit-Plugin should have this methods because they are very important for the handling of the Plugin! \\
   344 
   339 jEdit and also the Isabelle Plugin work with dock-able windows. This means that you can move around each single window and dock it somewhere on the screen. So it is possible to individualize the jEdit-GUI. To support this, the file \textit{dockable.scala} is needed. The file \textit{output-dockable.scala} is derived from \textit{dockable.scala} and is used to print the result/output in a dock-able window. The same thing with \textit{protocol-dockable.scala} and \textit{raw-output-dockable.scala}.\\
   345 The more interesting files, the scala-files of the Plugin, can be found in the 'src/jedit'-directory. In this directory you can find the file \textit{Dummy.java} which is a dummy class and is simply used to make javadoc work. Just forget about this file. Also there is a folder/package \textit{jedit} which contains all Scala-source-files. Now it is time to take a closer look on the source-files: 
   340 The next interesting file is \textit{scala-console.scala} with the main-class Scala-Console. This class is used to expand the Console-Plugin in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit.\\ 
   346 \begin{description}
   341 The file \textit{isabelle-sidekick.scala} is related to the file \textit{scala-console.scala} because it is also used to adapt the Plugin Sidekick for Isabelle.\\
   347 \item[plugin.scala] The file \textit{plugin.scala} is the main-file of the Isabelle-Plugin and there are two important parts. First the \textit{Isabelle object}. This object contains data like name and path and also few basic functions. The second part is the \textit{class Plugin} which is derived from EBPlugin. Here the basic methods \textit{handleMessage}, \textit{start} and \textit{stop} are implemented. Each jEdit-Plugin should have this methods because they are very important for the handling of the Plugin!
   342 The files \textit{document-model.scala} and \textit{document-view.scala1} are used to connect the jEdit-buffer/the text-area to Isabelle. Both classes offer, upon others, methods to activate and deactivate this features.\\
   348 \item[dockable.scala] jEdit and also the Isabelle Plugin work with dock-able windows. This means that you can move around each single window and dock it somewhere on the screen. So it is possible to individualize the jEdit-GUI. To support this, the file \textit{dockable.scala} is needed. The file \textit{output-dockable.scala} is derived from \textit{dockable.scala} and is used to print the result/output in a dock-able window. The same thing with \textit{protocol-dockable.scala} and \textit{raw-output-dockable.scala}.
   343 There also some other source-files but they aren’t discussed here, because the main goal of this paragraph is to give a basic idea how a jEdit-Plugin should be set up and the remaining files are not as important for the Isabelle-Plugin-structure:
   349 \item[scala-console.scala] The next interesting file is \textit{scala-console.scala} with the main-class Scala-Console. This class is used to expand the Console-Plugin in a way, that it is possible to interpret Scala-code with a Shell inside of jEdit.
   344 \begin{itemize}
   350 \item[isabelle-sidekick.scala] The file \textit{isabelle-sidekick.scala} is related to the file \textit{scala-console.scala} because it is also used to adapt the Plugin Sidekick for Isabelle.
   345 \item $html_panel.scala$
   351 \item[document-model.scala, document-view.scala] The files \textit{document-model.scala} and \textit{document-view.scala} are used to connect the jEdit-buffer/the text-area to Isabelle. Both classes offer, upon others, methods to activate and deactivate this features.
   346 \item $isabelle_encoding.scala$
   352 \end{description}
   347 \item $isabelle_hyperlinks.scala$
   353 There also some other source-files but they aren’t discussed here, because the main goal of this paragraph is to give a basic idea how a jEdit-Plugin should be set up and the remaining files are not as important for the Isabelle-Plugin-structure.
   348 \item $isabelle_options.scala$
   354 %\begin{itemize}
   349 \item $isabelle_token_maker.scala$
   355 %\item $html_panel.scala$
   350 \item $isabelle_hyperlinks.scala$
   356 %\item $isabelle_encoding.scala$
   351 \end{itemize}
   357 %\item $isabelle_hyperlinks.scala$
       
   358 %\item $isabelle_options.scala$
       
   359 %\item $isabelle_token_maker.scala$
       
   360 %\item $isabelle_hyperlinks.scala$
       
   361 %\end{itemize}
       
   362 
   352 
   363 
   353 
   364 %  Like each other jEdit-Plugin also this 
   354 %  Like each other jEdit-Plugin also this 
   365 
   355 
   366 %Das Konzept des frei wählbaren Designs ist am Beginn villeicht etwas schwierig umzusetzten, da es leichter ist, sich irgendwo anzulehnen bzw. ein bereits bestehendes sowie funktionierendes Konzept zu übernehmen. So wurden auch die ersten Schritte an der TU gemacht. Zu diesem Zweck wurde das von den Entwicklern von jEdit zur Verfügung gestellte plugin 'QuickNotepad' übernommen und in Scala übersetzt. Obwohl Scala eng mit Java verknüpft ist, war doch einiges an 'rewritting' notwendig bis das Scala-plugin lauffähig wurde. Die benötigten XML-files konnten dazu nahezu unberührt gelassen werden.\\
   356 %Das Konzept des frei wählbaren Designs ist am Beginn villeicht etwas schwierig umzusetzten, da es leichter ist, sich irgendwo anzulehnen bzw. ein bereits bestehendes sowie funktionierendes Konzept zu übernehmen. So wurden auch die ersten Schritte an der TU gemacht. Zu diesem Zweck wurde das von den Entwicklern von jEdit zur Verfügung gestellte plugin 'QuickNotepad' übernommen und in Scala übersetzt. Obwohl Scala eng mit Java verknüpft ist, war doch einiges an 'rewritting' notwendig bis das Scala-plugin lauffähig wurde. Die benötigten XML-files konnten dazu nahezu unberührt gelassen werden.\\
   367 
   357 
   368 \subsection{Details of NetBeans projects}\label{netbeans}
   358 \subsection{Details of NetBeans projects}\label{netbeans}
   369 %     Scala + Java: html project files
   359 %     Scala + Java: html project files
   370 As described in the last paragraph, jEdit is a open-source-project. The jEdit-developers use a NetBeans-project to produce the source-code and so it is beneficial to use a NetBeans project too, because there is a quite good documentation about setting up a NetBeans-project with the jEdit-source.\footnote{See http://wiki.netbeans.org/NetbeansedJEdit for further information.} 
   360 As described in the last paragraph, jEdit is a open-source-project. The jEdit-developers use a NetBeans-project to produce the source-code and so it is beneficial to use a NetBeans project too, because there is a quite good documentation about setting up a NetBeans-project with the jEdit-source. See http://wiki.netbeans.org/NetbeansedJEdit for further information.\\\\
   371 
       
   372 If you want to set up a new jEdit-Plugin-project you have to attend that you have to create some source-files and that there must be a connection to the jEdit-source because you will need to exchange data with the jEdit engine. This could probably look like: \textit{jEdit.getProperty("options.isabelle.isabelle")}\\
   361 If you want to set up a new jEdit-Plugin-project you have to attend that you have to create some source-files and that there must be a connection to the jEdit-source because you will need to exchange data with the jEdit engine. This could probably look like: \textit{jEdit.getProperty("options.isabelle.isabelle")}\\
   373 As shown above, the jEdit-source is needed to compile and build your Plugin. There are two ways to organize your project:
   362 As shown above, the jEdit-source is needed to compile and build your Plugin. There are two ways to organize your project:
   374 %\begin{itemize}
   363 \begin{itemize}
   375 %\item with jEdit source code - two projects in one
   364 \item with jEdit source code - two projects in one
   376 %\item with jedit.jar library
   365 \item with jedit.jar library
   377 %\end{itemize}
   366 \end{itemize}
   378 \subsubsection{Plugin with jEdit-source}
   367 \subsubsection{Plugin with jEdit-source}
   379 It is a good way to download the jEdit source as Netbeans project because then it is possible to add another subproject to the existing jEdit-NetBeans-project. As you see it is also possible to mix Scala and Java. A big advantage is, that debugging will now work really fine. If you want to set up a project like this, you should complete the following steps.
   368 It is a good way to download the jEdit source as Netbeans project because then it is possible to add another subproject to the existing jEdit-NetBeans-project. As you see it is also possible to mix Scala and Java. A big advantage is, that debugging will now work really fine. If you want to set up a project like this, you should complete the following steps.
   380 \begin{enumerate}
   369 \begin{enumerate}
   381 \item {Create a new NetBeans-project for your Plugin like \textit{example-plugin}. This will probably be a Scala-Project.}
   370 \item {Create a new NetBeans-project for your Plugin like \textit{example-plugin}. This will probably be a Scala-Project.}
   382 \item Download (and try out) the \textit{jEdit-NetBeans-project}
   371 \item Download (and try out) the \textit{jEdit-NetBeans-project}
   402 \item $	\langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$
   391 \item $	\langle copy $file="plugin/Isabelle.props" todir="\${build.classes.dir}" $/\rangle$
   403 \item $	\langle /target\rangle$
   392 \item $	\langle /target\rangle$
   404 \end{itemize}
   393 \end{itemize}
   405 %* kurze aufzählung der xml-netbeans-files + erklärung\\
   394 %* kurze aufzählung der xml-netbeans-files + erklärung\\
   406 \subsubsection{NetBeans project files}
   395 \subsubsection{NetBeans project files}
   407 As you see in the paragraph above, it is also important to have basic knowledge about NetBeans, the project structure and how to change the operational sequences. A typical NetBeans-project consist of the source- and library-files and administrative XML- and property-files. In this paragraph the administrative part of the project is of note. The most important file is \textit{build.xml}. This file can be found in the project directory. There is also a folder \textit{nbproject} which contains the remaining XML- and property-files and also a folder \textit{private}, where individual user informations about the project is stored. The files in this \textit{private} folder are not important to describe (and they should not be pushed on the repository!).
   396 As you see in the paragraph above, it is also important to have basic knowledge about NetBeans, the project structure and how to change the operational sequences. A typical NetBeans-project consist of the source- and library-files and administrative XML- and property-files. In this paragraph the administrative part of the project is of note. The most important file is \textit{build.xml}. This file can be found in the project directory. There is also a folder \textit{nbproject} which contains the remaining XML- and property-files and also a folder \textit{private}, where individual user informations about the project is stored. The files in this \textit{private} folder are not important to describe (and they should not be pushed on the repository!).\\
   408 
   397 A build-file like \textit{build.xml} contains one project and at least one (default) target. Targets contain task elements. Each task element of the build-file can have an id attribute and can later be referred to by the value supplied to this. So the id has to be unique. Such targets can be "run", "debug", "build", ... and can have dependencies to other targets. Tasks define what should happen, if a target is executed. So like in the example above, the target is \textit{pre-jar}, that means that this things will happen before the jar-package is packed. The tasks of this target are copying some files into the package.\\
   409 A build-file like \textit{build.xml} contains one project and at least one (default) target. Targets contain task elements. Each task element of the build-file can have an id attribute and can later be referred to by the value supplied to this. So the id has to be unique. Such targets can be "run", "debug", "build", ... and can have dependencies to other targets. Tasks define what should happen, if a target is executed. So like in the example above, the target is \textit{pre-jar}, that means that this things will happen before the jar-package is packed. The tasks of this target are copying some files into the package.
       
   410 
       
   411 The files inside the \textit{nbproject}-folder are not so important because some of it are generated from \textit{build.xml} and changes in this files are useless. Just the file project.properties is really interesting because this file gives a nice and tight overview about the project settings.
   398 The files inside the \textit{nbproject}-folder are not so important because some of it are generated from \textit{build.xml} and changes in this files are useless. Just the file project.properties is really interesting because this file gives a nice and tight overview about the project settings.
   412 
   399 
   413 \subsection{Use interfaces between Java and Scala}\label{java-scala}
   400 \subsection{Use interfaces between Java and Scala}\label{java-scala}
   414 %     how are data exchanged between Scala and Java ...
   401 %     how are data exchanged between Scala and Java ...
   415 jEdit is completely written in Java and the required plugin(s) for \sisac{ }will be coded in Scala - so there must be ways to exchange data between Java and Scala. One way is to connect this two worlds with the in 4.2 described XML-files. Here you need to use a third type of code to get an interface between Java and Scala code. But there is also a way to get a direct connection.
   402 jEdit is completely written in Java and the required plugin(s) for Isac will be coded in Scala - so there must be ways to exchange data between Java and Scala. One way is to connect this two worlds with the in 4.2 described XML-files. Here you need to use a third type of code to get an interface between Java and Scala code. But there is also a way to get a direct connection.\\
   416 
   403 This link should be shown on the graphic-library \textit{Swing}. In both languages it is possible to use Swing which provides a lot of different shapes and useful functionality. So there is a Java-Swing and also a Scala-Swing-library. Now it is interesting to examine the connection between this two libraries.\\
   417 This link should be shown on the graphic-library \textit{Swing}. In both languages it is possible to use Swing which provides a lot of different shapes and useful functionality. So there is a Java-Swing and also a Scala-Swing-library. Now it is interesting to examine the connection between this two libraries.
   404 In Scala a direct use of Java-Libs (like Java-Swing) is possible. So if you are Java-Programmer and want to use Java-Swing in Scala, you can simply type \textit{import javax.swing.JButton} to work with a Java-button. But you can also use the Scala-equivalent \textit{scala.swing.Button}. This two button-types will provide nearly the same functionality.\\So what is the idea of creating a nearly similar library a second time? Why have the Scala-developers done such extra work? The answer is, that they have tried to improve and simplify the usage of the Swing-library(and many other libs too!). So big parts of this Scala-Libraries are just Wrapper-objects, Wrapper-Classes and Wrapper-Methods of already existing parts in Java-Libraries. Needless to say that they also added new useful shapes and functionality.\\
   418 
       
   419 In Scala a direct use of Java-Libs (like Java-Swing) is possible. So if you are Java-Programmer and want to use Java-Swing in Scala, you can simply type\\ \textit{import javax.swing.JButton}\footnote{http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JButton.html} to work with a Java-button. But you can also use the Scala-equivalent \textit{scala.swing.Button}\footnote{http://www.scala-lang.org/api/current/scala/swing/Button.html}. This two button-types will provide nearly the same functionality.
       
   420 
       
   421 So what is the idea of creating a nearly similar library a second time? Why have the Scala-developers done such extra work? The answer is, that they have tried to improve and simplify the usage of the Swing-library(and many other libs too!). So big parts of this Scala-Libraries are just Wrapper-objects, Wrapper-Classes and Wrapper-Methods of already existing parts in Java-Libraries. Needless to say that they also added new useful shapes and functionality.
       
   422 But there is one important question left: Is it possible to mix Scala- and Java-objects? And yes, it is possible. There is a really easy way to convert a Scala-object to the Java-equivalent:
   405 But there is one important question left: Is it possible to mix Scala- and Java-objects? And yes, it is possible. There is a really easy way to convert a Scala-object to the Java-equivalent:
   423 \begin{enumerate}
   406 \begin{enumerate}
   424 \item \textit{import javax.swing.JButton}
   407 \item \textit{import javax.swing.JButton}
   425 \item \textit{import scala.swing.Button}
   408 \item \textit{import scala.swing.Button}
   426 \item \textit{var b: scala.swing.Button}
   409 \item \textit{var b: scala.swing.Button}
   427 \item \textit{var jb: javax.swing.JButton}
   410 \item \textit{var jb: javax.swing.JButton}
   428 \item \textit{jb = b.peer}
   411 \item \textit{jb = b.peer}
   429 \end{enumerate}
   412 \end{enumerate}
   430 As the example above illustrates, a conversion of Scala- to Java-objects is possible. It looks easy but also a little bit useless. Why should you need this? Just imagine that there is a Plugin written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two Plugins! 
   413 As the example above illustrates, a conversion of Scala- to Java-objects is possible. It looks easy but also a little bit useless. Why should you need this? Just imagine that there is a Plugin written in Scala and one coded in Java. With this connection between Scala and Java, it would be easy to connect this two Plugins! 
   431 %Diesen direkten Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing. Beide Sprachen stellen diese Grafik-Bibliotheken zur Verfügung (und darin auch eigene Shapes und Funktionalität). Es ist jedoch möglich, Java-Bibliotheken, wie eben auch Java-Swing in Scala zu verwenden. Ein JButton kann zum Beispiel mittels \textit{import javax.swing.JButton} eingebunden und damit sofort auch verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek zur Verfügung: \textit{scala.swing.Button}. Es wird nahezu die selbe Funktionalität angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht(???). Man kann sich nun fragen, warum sich die Scala-Entwickler einerseit die Mühe gemacht haben die Verwendung Java-Swing, wie in Java selbst, möglich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. Die Antwort darauf zeigt wie der objektorientierte Teil von Scala in vielen Bereichen aufgebaut wurden. Es wurde kein neues Konzept für diese Grafikklassen entworfen sondern Wrapper-Objekte/Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung von Java-Komponente in ein Scala-Äquivalent ist problemlos möglich. ...
   414 %Diesen direkten Zusammenhang zwischen Java und Scala soll anhand der Grafik-Bibliotheken Swing. Beide Sprachen stellen diese Grafik-Bibliotheken zur Verfügung (und darin auch eigene Shapes und Funktionalität). Es ist jedoch möglich, Java-Bibliotheken, wie eben auch Java-Swing in Scala zu verwenden. Ein JButton kann zum Beispiel mittels \textit{import javax.swing.JButton} eingebunden und damit sofort auch verwendet werden. Auch Scala stellt in seiner Swing-Bibliothek zur Verfügung: \textit{scala.swing.Button}. Es wird nahezu die selbe Funktionalität angeboten und teilweise die Erzeugung bzw. Verwendung vereinfacht(???). Man kann sich nun fragen, warum sich die Scala-Entwickler einerseit die Mühe gemacht haben die Verwendung Java-Swing, wie in Java selbst, möglich zu machen und andererseits mit Scala-Swing eine nahezu idente Alternative geschaffen haben. Die Antwort darauf zeigt wie der objektorientierte Teil von Scala in vielen Bereichen aufgebaut wurden. Es wurde kein neues Konzept für diese Grafikklassen entworfen sondern Wrapper-Objekte/Methoden/Klassen erstellt, die das Arbeiten mit diesen Grafikkomponenten erleichtern soll. Ein Letztes Problem bleibt noch: Es ist zwar sehr einfach ein Java-Swing-Objekt an einen Scala-Swing-Container (zb. Frame) anzubinden, da eine Konvertierung von Java-Komponente in ein Scala-Äquivalent ist problemlos möglich. ...
       
   415 http://www.scala-lang.org/api/current/scala/swing/Button.html\\
       
   416 http://download.oracle.com/javase/1.4.2/docs/api/javax/swing/JButton.html
       
   417 
   432 \section{Conclusion and future work}
   418 \section{Conclusion and future work}
   433 
   419 
   434 
   420 
   435 \bibliography{CTP-userinterfaces}
   421 \bibliography{CTP-userinterfaces}
   436 %\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl}
   422 %\bibliography{bib/math-eng,bib/bk,bib/RISC_2,bib/isac,bib/pl,bib/math,bib/pl}