\RequirePackage{java-lang}
\RequirePackage{TBcolors}

\lstset{
  keywordstyle={[3]\color{RougeBrique}\bfseries},
  stringstyle=\color{Violet},
  identifierstyle=\color{Bleu},
  moredelim=**[is][\color{Orange}]{/*|*/}{/*|*/},
  moredelim=**[is][\color{Vert}]{/*T*/}{/*T*/}
}

\newcommand{\java}[2][]{{\color{black}\ttfamily\lstinline[#1]!#2!}}
\newcommand{\javawithspaces}[1]{{\color{black}\ttfamily\lstset{showstringspaces=true}\lstinline!#1!}}

\ifthenelse{\boolean{tb@mode@cours}}{%
  \ifthenelse{\boolean{tb@mode@fc}}{%
    \lstnewenvironment{Java}[1][]{\bgroup\color{black}\lstset{basicstyle=\footnotesize\ttfamily,#1}}{\egroup}%
  }{%
    \lstnewenvironment{Java}[1][]{\bgroup\color{black}\lstset{style=numbers,basicstyle=\footnotesize\ttfamily,#1}}{\egroup}%
  }
}{%
  \lstnewenvironment{Java}[1][]{\lstset{basicstyle=\ttfamily,#1}}{}%
}

\newcommand{\inputJava}[2][]{%
  \ifthenelse{\boolean{tb@mode@cours}}{%
    \ifthenelse{\boolean{tb@mode@fc}}{%
      {\color{black}\lstinputlisting[basicstyle=\footnotesize\ttfamily,tabsize=2,#1]{#2}}%
    }{%
      {\color{black}\lstinputlisting[style=numbers,basicstyle=\footnotesize\ttfamily,tabsize=2,#1]{#2}}%
    }
  }{%
    \ifthenelse{\boolean{tb@mode@devoir}}{%
      \lstinputlisting[basicstyle=\ttfamily,tabsize=2,#1]{#2}%
    }{%
      \ifthenelse{\boolean{tb@boolean@inCorrection}}{%
        {\color{black}\lstinputlisting[style=correction,tabsize=2,#1]{#2}}%
      }{%
        \lstinputlisting[style=smallframe,tabsize=2,#1]{#2}%
      }
    }
  }
}

