diff options
Diffstat (limited to 'languages/java/app_templates/kappjava')
-rw-r--r-- | languages/java/app_templates/kappjava/CMakeLists.txt | 26 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/Makefile.am | 17 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/app.desktop | 41 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/app.java | 281 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/app.tdevelop | 88 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/app_client.java | 28 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/appui.rc | 8 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/appview.java | 115 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/kappjava | 10 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/kappjava.kdevtemplate | 163 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/kappjava.png | bin | 0 -> 5063 bytes | |||
-rw-r--r-- | languages/java/app_templates/kappjava/pref.java | 52 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/src-Makefile.am | 18 | ||||
-rw-r--r-- | languages/java/app_templates/kappjava/subdirs | 3 |
14 files changed, 850 insertions, 0 deletions
diff --git a/languages/java/app_templates/kappjava/CMakeLists.txt b/languages/java/app_templates/kappjava/CMakeLists.txt new file mode 100644 index 00000000..042872fd --- /dev/null +++ b/languages/java/app_templates/kappjava/CMakeLists.txt @@ -0,0 +1,26 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_custom_target( kappjava.tar.gz ALL + COMMAND tar zcf kappjava.tar.gz -C ${CMAKE_CURRENT_SOURCE_DIR} + app.java pref.java appview.java app_client.java appui.rc + src-Makefile.am kappjava.png app.tdevelop subdirs +) + + +install( FILES + ${CMAKE_CURRENT_BINARY_DIR}/kappjava.tar.gz kappjava.png + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard ) + + +install( FILES + kappjava.kdevtemplate + DESTINATION ${DATA_INSTALL_DIR}/kdevappwizard/templates ) diff --git a/languages/java/app_templates/kappjava/Makefile.am b/languages/java/app_templates/kappjava/Makefile.am new file mode 100644 index 00000000..edbd4468 --- /dev/null +++ b/languages/java/app_templates/kappjava/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = app.java pref.java appview.java app_client.java appui.rc \ + src-Makefile.am kappjava.png app.tdevelop subdirs +templateName = kappjava + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz
\ No newline at end of file diff --git a/languages/java/app_templates/kappjava/app.desktop b/languages/java/app_templates/kappjava/app.desktop new file mode 100644 index 00000000..3cc75ad8 --- /dev/null +++ b/languages/java/app_templates/kappjava/app.desktop @@ -0,0 +1,41 @@ +[Desktop Entry] +Name=%{APPNAME} +Exec=%{APPNAMELC} %i -caption "%c" +Icon=%{APPNAMELC} +Type=Application +DocPath=%{APPNAMELC}/%{APPNAMELC}.html +Comment=A Java TDE KPart Application +Comment[ca]=Una aplicació KPart en Java per al TDE +Comment[da]=Et Java TDE KPart-program +Comment[de]=Eine TDE-Komponten-Anwendung in Java +Comment[el]=Μια εφαρμογή Java TDE KPart +Comment[es]=Una aplicación KPart en Java para TDE +Comment[et]=Java TDE KPart rakendus +Comment[eu]=Java TDE KPart aplikazio bat +Comment[fa]=یک کاربرد TDE KPart جاوا +Comment[fr]=Une application KPart en JAVA pour TDE +Comment[ga]=Feidhmchlár KPart TDE i Java +Comment[gl]=Unha aplicación KPart de TDE en Java +Comment[hi]=एक जावा केडीई के-पार्ट अनुप्रयोग +Comment[hu]=Java-ban írt, KPart-alapú TDE-alkalmazás +Comment[is]=Java TDE KPart forrit +Comment[it]=Un'applicazione Java TDE KPart +Comment[ja]= Java TDE KPart アプリケーション +Comment[nds]=En TDE-Programm in Java +Comment[ne]=जाभा केडीई KPart अनुप्रयोग +Comment[nl]=Een Java TDE KPart-toepassing +Comment[pl]=Element osadzalny KPart Javy +Comment[pt]=Uma Aplicação TDE KPart em Java +Comment[pt_BR]=Um Aplicativo KPart do TDE para Java +Comment[ru]=Приложение KPart для TDE на Java +Comment[sk]=Java TDE KPart aplikácia +Comment[sl]=Program za Javo TDE KPart +Comment[sr]=Java TDE KPart програм +Comment[sr@Latn]=Java TDE KPart program +Comment[sv]=Ett Java TDE Kpart-program +Comment[ta]=ஜாவா கெடி கெபாகம் பயன்பாடு +Comment[tg]=Гузориш KPart барои TDE дар Java +Comment[tr]=Bir Java TDE KPart Uygulaması +Comment[zh_CN]=一个 Java TDE KPart 应用程序 +Comment[zh_TW]=Java TDE KPart 應用程式 +Terminal=false diff --git a/languages/java/app_templates/kappjava/app.java b/languages/java/app_templates/kappjava/app.java new file mode 100644 index 00000000..40bc6b93 --- /dev/null +++ b/languages/java/app_templates/kappjava/app.java @@ -0,0 +1,281 @@ +/* + * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}> + */ + +import java.util.*; +import org.kde.qt.*; +import org.kde.koala.*; + +/** + * This class serves as the main window for %{APPNAME}. It handles the + * menus, toolbars, and status bars. + * + * @short Main window class + * @author $AUTHOR <$EMAIL> + * @version $APP_VERSION + */ +public class %{APPNAME} extends TDEMainWindow +{ + private %{APPNAME}View m_view; + private QPrinter m_printer; + +%{APPNAME}() +{ + super( null, "%{APPNAME}" ); + m_view = new %{APPNAME}View(this); + m_printer = new QPrinter(); + // accept dnd + setAcceptDrops(true); + + // tell the TDEMainWindow that this is indeed the main widget + setCentralWidget(m_view); + + // then, setup our actions + setupActions(); + + // and a status bar + statusBar().show(); + + // Apply the create the main window and ask the mainwindow to + // automatically save settings if changed: window size, toolbar + // position, icon size, etc. Also to add actions for the statusbar + // toolbar, and keybindings if necessary. + setupGUI(); + + // allow the view to change the statusbar and caption + connect(m_view, SIGNAL("signalChangeStatusbar(String)"), + this, SLOT("changeStatusbar(String)")); + connect(m_view, SIGNAL("signalChangeCaption(String)"), + this, SLOT("changeCaption(String)")); + +} + +public void load(KURL url) +{ + StringBuffer target = new StringBuffer(); + // the below code is what you should normally do. in this + // example case, we want the url to our own. you probably + // want to use this code instead for your app + + // download the contents + if (NetAccess.download(url, target, null)) + { + // set our caption + setCaption(url.fileName()); + + // load in the file (target is always local) +// loadFile(target); + + // and remove the temp file + NetAccess.removeTempFile(target.toString()); + } + + setCaption(url.url()); + m_view.openURL(url); +} + +public void setupActions() +{ + TDEApplication kapp = TDEApplication.kApplication(); + KStdAction.openNew(this, SLOT("fileNew()"), actionCollection()); + KStdAction.open(this, SLOT("fileOpen()"), actionCollection()); + KStdAction.save(this, SLOT("fileSave()"), actionCollection()); + KStdAction.saveAs(this, SLOT("fileSaveAs()"), actionCollection()); + KStdAction.print(this, SLOT("filePrint()"), actionCollection()); + KStdAction.quit(kapp, SLOT("quit()"), actionCollection()); + + KStdAction.preferences(this, SLOT("optionsPreferences()"), actionCollection()); + + // this doesn't do anything useful. it's just here to illustrate + // how to insert a custom menu and menu item + TDEAction custom = new TDEAction(tr("Cus&tom Menuitem"), new TDEShortcut(), + this, SLOT("optionsPreferences()"), + actionCollection(), "custom_action"); +} + +protected void saveProperties(TDEConfig config) +{ + // the 'config' object points to the session managed + // config file. anything you write here will be available + // later when this app is restored + + if (m_view.currentURL() != null) + config.writeEntry("lastURL", m_view.currentURL()); +} + +protected void readProperties(TDEConfig config) +{ + // the 'config' object points to the session managed + // config file. this function is automatically called whenever + // the app is being restored. read in here whatever you wrote + // in 'saveProperties' + + String url = config.readPathEntry("lastURL"); + + if (url != null) + m_view.openURL(new KURL(url)); +} + +protected void dragEnterEvent(QDragEnterEvent event) +{ + // accept uri drops only + event.accept(QUriDrag.canDecode(event)); +} + +protected void dropEvent(QDropEvent event) +{ + // this is a very simplistic implementation of a drop event. we + // will only accept a dropped URL. the Qt dnd code can do *much* + // much more, so please read the docs there + ArrayList uri = new ArrayList(); + + // see if we can decode a URI.. if not, just ignore it + if (QUriDrag.decode(event, (String[]) uri.toArray())) + { + // okay, we have a URI.. process it + String url, target; + url = (String) uri.get(0); + + // load in the file + load(new KURL(url)); + } +} + +private void fileNew() +{ + // this slot is called whenever the File.New menu is selected, + // the New shortcut is pressed (usually CTRL+N) or the New toolbar + // button is clicked + + // create a new window + (new %{APPNAME}()).show(); +} + +private void fileOpen() +{ + // this slot is called whenever the File.Open menu is selected, + // the Open shortcut is pressed (usually CTRL+O) or the Open toolbar + // button is clicked + KURL url = KURLRequesterDlg.getURL(null, this, tr("Open Location") ); + if (!url.isEmpty()) + m_view.openURL(url); +} + +private void fileSave() +{ + // this slot is called whenever the File.Save menu is selected, + // the Save shortcut is pressed (usually CTRL+S) or the Save toolbar + // button is clicked + + // save the current file +} + +private void fileSaveAs() +{ + // this slot is called whenever the File.Save As menu is selected, + KURL file_url = KFileDialog.getSaveURL(); + if (!file_url.isEmpty() && file_url.isValid()) + { + // save your info, here + } +} + +private void filePrint() +{ + // this slot is called whenever the File.Print menu is selected, + // the Print shortcut is pressed (usually CTRL+P) or the Print toolbar + // button is clicked + if (m_printer == null) m_printer = new QPrinter(); + if (QPrintDialog.getPrinterSetup(m_printer)) + { + // setup the printer. with Qt, you always "print" to a + // QPainter.. whether the output medium is a pixmap, a screen, + // or paper + QPainter p = new QPainter(); + p.begin(m_printer); + + // we let our view do the actual printing + QPaintDeviceMetrics metrics = new QPaintDeviceMetrics(m_printer); + m_view.print(p, metrics.height(), metrics.width()); + + // and send the result to the printer + p.end(); + } +} + +private void optionsPreferences() +{ + // popup some sort of preference dialog, here + %{APPNAME}Preferences dlg = new %{APPNAME}Preferences(); + if (dlg.exec() != 0) + { + // redo your settings + } +} + +private void changeStatusbar(String text) +{ + // display the text on the statusbar + statusBar().message(text); +} + +private void changeCaption(String text) +{ + // display the text on the caption + setCaption(text); +} + +static String description = + "A KDE Application"; + +static String version = "%{VERSION}"; + +static String[][] options = +{ + { "+[URL]", "Document to open.", null } +}; + +static void main(String[] cmdLineArgs) +{ + TDEAboutData about = new TDEAboutData("%{APPNAMELC}", "%{APPNAME}", version, description, + TDEAboutData.License_%{LICENSE}, "(C) %{YEAR} %{AUTHOR}", null, null, "%{EMAIL}"); + about.addAuthor( "%{AUTHOR}", null, "%{EMAIL}" ); + TDECmdLineArgs.init(cmdLineArgs, about); + TDECmdLineArgs.addCmdLineOptions(options); + TDEApplication app = new TDEApplication(); + + // see if we are starting with session management + if (app.isRestored()) + RESTORE("%{APPNAME}"); + else + { + // no session.. just start up normally + TDECmdLineArgs args = TDECmdLineArgs.parsedArgs(); + if (args.count() == 0) + { + %{APPNAME} widget = new %{APPNAME}(); + widget.show(); + } + else + { + int i = 0; + for (; i < args.count(); i++) + { + %{APPNAME} widget = new %{APPNAME}(); + widget.show(); + widget.load(args.url(i)); + } + } + args.clear(); + } + + app.exec(); + return; +} + + static { + qtjava.initialize(); + kdejava.initialize(); + } +} + diff --git a/languages/java/app_templates/kappjava/app.tdevelop b/languages/java/app_templates/kappjava/app.tdevelop new file mode 100644 index 00000000..7ee74558 --- /dev/null +++ b/languages/java/app_templates/kappjava/app.tdevelop @@ -0,0 +1,88 @@ +<?xml version="1.0"?> +<tdevelop> + <general> + <author>%{AUTHOR}</author> + <email>%{EMAIL}</email> + <version>%{VERSION}</version> + <projectmanagement>KDevAutoProject</projectmanagement> + <primarylanguage>Java</primarylanguage> + <keywords> + <keyword>Java</keyword> + <keyword>Code</keyword> + <keyword>Qt</keyword> + <keyword>KDE</keyword> + </keywords> + </general> + <kdevautoproject> + <general> + <activetarget>src/java</activetarget> + </general> + <run> + <mainprogram>src/%{APPNAMELC}</mainprogram> + </run> + </kdevautoproject> + <kdevfileview> + <groups> + <group pattern="*.java" name="Sources" /> + <group pattern="*.ui" name="User Interface" /> + <group pattern="*.png" name="Icons" /> + <group pattern="*.po;*.ts" name="Translations" /> + <group pattern="*" name="Others" /> + </groups> + </kdevfileview> + <kdevdebugger> + <general> + </general> + </kdevdebugger> + <kdevdoctreeview> + <ignoretocs> + <toc>ada</toc> + <toc>ada_bugs_gcc</toc> + <toc>bash</toc> + <toc>bash_bugs</toc> + <toc>c++_bugs_gcc</toc> + <toc>clanlib</toc> + <toc>w3c-dom-level2-html</toc> + <toc>fortran_bugs_gcc</toc> + <toc>gnome1</toc> + <toc>gnustep</toc> + <toc>gtk</toc> + <toc>gtk_bugs</toc> + <toc>haskell</toc> + <toc>haskell_bugs_ghc</toc> + <toc>libc</toc> + <toc>libstdc++</toc> + <toc>opengl</toc> + <toc>pascal_bugs_fp</toc> + <toc>php</toc> + <toc>php_bugs</toc> + <toc>perl</toc> + <toc>perl_bugs</toc> + <toc>python</toc> + <toc>python_bugs</toc> + <toc>ruby</toc> + <toc>ruby_bugs</toc> + <toc>sdl</toc> + <toc>stl</toc> + <toc>w3c-svg</toc> + <toc>sw</toc> + <toc>w3c-uaag10</toc> + <toc>wxwidgets_bugs</toc> + </ignoretocs> + <ignoreqt_xml> + <toc>Guide to the Qt Translation Tools</toc> + <toc>Qt Assistant Manual</toc> + <toc>Qt Designer Manual</toc> + <toc>Qt Reference Documentation</toc> + <toc>qmake User Guide</toc> + </ignoreqt_xml> + <ignoredoxygen> + <toc>KDE Libraries (Doxygen)</toc> + </ignoredoxygen> + </kdevdoctreeview> + <kdevfilecreate> + <useglobaltypes> + <type ext="java"/> + </useglobaltypes> + </kdevfilecreate> +</tdevelop> diff --git a/languages/java/app_templates/kappjava/app_client.java b/languages/java/app_templates/kappjava/app_client.java new file mode 100644 index 00000000..9648cfad --- /dev/null +++ b/languages/java/app_templates/kappjava/app_client.java @@ -0,0 +1,28 @@ +/* + * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}> + */ + +#include <kapp.h> +#include <dcopclient.h> +#include <qdatastream.h> +#include <qstring.h> + +int main(int argc, char **argv) +{ + TDEApplication app(argc, argv, "%{APPNAMELC}_client", false); + + // get our DCOP client and attach so that we may use it + DCOPClient *client = app.dcopClient(); + client->attach(); + + // do a 'send' for now + QByteArray data; + QDataStream ds(data, IO_WriteOnly); + if (argc > 1) + ds << QString(argv[1]); + else + ds << QString("http://www.kde.org"); + client->send("%{APPNAMELC}", "%{APPNAME}Iface", "openURL(QString)", data); + + return app.exec(); +} diff --git a/languages/java/app_templates/kappjava/appui.rc b/languages/java/app_templates/kappjava/appui.rc new file mode 100644 index 00000000..ceb4f14e --- /dev/null +++ b/languages/java/app_templates/kappjava/appui.rc @@ -0,0 +1,8 @@ +<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd"> +<kpartgui name="%{APPNAMELC}" version="1"> +<MenuBar> + <Menu name="custom"><text>C&ustom</text> + <Action name="custom_action" /> + </Menu> +</MenuBar> +</kpartgui> diff --git a/languages/java/app_templates/kappjava/appview.java b/languages/java/app_templates/kappjava/appview.java new file mode 100644 index 00000000..347ff58f --- /dev/null +++ b/languages/java/app_templates/kappjava/appview.java @@ -0,0 +1,115 @@ +/* + * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}> + */ + +import java.util.*; +import org.kde.qt.*; +import org.kde.koala.*; + +/** + * This is the main view class for %{APPNAME}. Most of the non-menu, + * non-toolbar, and non-statusbar (e.g., non frame) GUI code should go + * here. + * + * This %{APPNAMELC} uses an HTML component as an example. + * + * @short Main view + * @author %{AUTHOR} <%{EMAIL}> + * @version %{VERSION} + */ +public class %{APPNAME}View extends QWidget +{ + + QHBoxLayout top_layout; + +public %{APPNAME}View(QWidget parent) +{ + super(parent, null); + // setup our layout manager to automatically add our widgets + top_layout = new QHBoxLayout(this); + top_layout.setAutoAdd(true); + + // we want to look for all components that satisfy our needs. the + // trader will actually search through *all* registered KDE + // applications and components -- not just KParts. So we have to + // specify two things: a service type and a constraint + // + // the service type is like a mime type. we say that we want all + // applications and components that can handle HTML -- 'text/html' + // + // however, by itself, this will return such things as Netscape.. + // not what we wanted. so we constrain it by saying that the + // string 'KParts/ReadOnlyPart' must be found in the ServiceTypes + // field. with this, only components of the type we want will be + // returned. + ArrayList offers = TDETrader.self().query("text/html", "'KParts/ReadOnlyPart' in ServiceTypes"); + + KLibFactory factory = null; + // in theory, we only care about the first one.. but let's try all + // offers just in case the first can't be loaded for some reason + Iterator it = offers.iterator(); + while(it.hasNext()) + { + KService ptr = (KService) it.next(); + + // we now know that our offer can handle HTML and is a part. + // since it is a part, it must also have a library... let's try to + // load that now + factory = KLibLoader.self().factory( ptr.library() ); + if (factory != null) + { + m_html = (ReadOnlyPart) factory.create(this, ptr.name(), "KParts::ReadOnlyPart"); + break; + } + } + + // if our factory is invalid, then we never found our component + // and we might as well just exit now + if (factory == null) + { + KMessageBox.error(this, "Could not find a suitable HTML component"); + return; + } + + connect(m_html, SIGNAL("setWindowCaption(String)"), + this, SLOT("slotSetTitle(String)")); + connect(m_html, SIGNAL("setStatusBarText(String)"), + this, SLOT("slotOnURL(String)")); + +} + + +public void print(QPainter p, int height, int width) +{ + // do the actual printing, here + // p.drawText(etc..) +} + +public String currentURL() +{ + return m_html.url().url(); +} + +public void openURL(String url) +{ + openURL(new KURL(url)); +} + +public void openURL(KURL url) +{ + m_html.openURL(url); +} + +private void slotOnURL(String url) +{ + emit("signalChangeStatusbar", url); +} + +private void slotSetTitle(String title) +{ + emit("signalChangeCaption", title); +} + +private ReadOnlyPart m_html; + +} diff --git a/languages/java/app_templates/kappjava/kappjava b/languages/java/app_templates/kappjava/kappjava new file mode 100644 index 00000000..e199ac25 --- /dev/null +++ b/languages/java/app_templates/kappjava/kappjava @@ -0,0 +1,10 @@ +# KDE Config File +[General] +Name=Application framework +Name[fr]=Squelette d'application +Icon=kappjava.png +Category=Java/KDE +Comment=Generates a simple Java KDE application with one toplevel window, menus and toolbars. +Comment[fr]=Gnre une simple application KDE dans le language JAVA avec une fentre principale, des menus, et des barres d'outils. +FileTemplates=java,CStyle +ShowFilesAfterGeneration=src/APPNAMEView.java diff --git a/languages/java/app_templates/kappjava/kappjava.kdevtemplate b/languages/java/app_templates/kappjava/kappjava.kdevtemplate new file mode 100644 index 00000000..92cf4710 --- /dev/null +++ b/languages/java/app_templates/kappjava/kappjava.kdevtemplate @@ -0,0 +1,163 @@ +# KDE Config File +[General] +Name=Application framework +Name[ca]=Infraestructura d'aplicacions +Name[da]=Programskelet +Name[de]=Anwendungsgrundgerüst +Name[el]=Πλαίσιο εφαρμογής +Name[es]=Infraestructura de aplicación +Name[et]=Rakenduse raamistik +Name[eu]=Aplikazioen lan-markoa +Name[fa]=چارچوب کاربرد +Name[fr]=Infrastructure d'application +Name[ga]=Creatlach feidhmchláir +Name[gl]=Entorno de traballo para aplicación +Name[hu]=Alkalmazás-keretrendszer +Name[it]=Infrastruttura applicativa +Name[ja]=アプリケーションフレームワーク +Name[nds]=Programmrahmenwark +Name[ne]=अनुप्रयोग फ्रेमवर्क +Name[nl]=Applicationframework +Name[pl]=Szablon programu +Name[pt]=Plataforma de aplicações +Name[pt_BR]=Plataforma de aplicações +Name[ru]=Приложение KDE +Name[sk]=Aplikačný framework +Name[sl]=Ogrodje programa +Name[sr]=Радни оквир програма +Name[sr@Latn]=Radni okvir programa +Name[sv]=Programramverk +Name[tr]=Uygulama Çatısı +Name[zh_CN]=应用程序框架 +Name[zh_TW]=應用程式框架 +Icon=kappjava.png +Category=Java/KDE +Comment=Generates a simple Java KDE application with one toplevel window, menus and toolbars. +Comment[ca]=Genera una simple aplicació per al KDE en Java amb una finestra principal, menús i barres d'eines. +Comment[da]=Genererer et simpelt Java KDE program med et vindue på topniveau, menuer og værktøjslinjer. +Comment[de]=Erstellt eine einfache Java-KDE-Anwendung mit einem Toplevel-Fenster, Menüs und Werkzeugleisten. +Comment[el]=Δημιουργεί μια απλή εφαρμογή Java του KDE με ένα ανώτερο παράθυρο, μενού, και γραμμές εργαλείων. +Comment[es]=Genera una sencilla aplicación para KDE en Java, con una ventana principal, menús y barras de herramientas. +Comment[et]=Lihtsa Java KDE rakenduse loomine ühe tipptaseme akna, menüüde ja tööriistaribadega. +Comment[eu]=Goi-mailako lehio bat, menuak eta tresna-barrak dituen Java KDE aplikazio bat sortzen du. +Comment[fa]=یک کاربرد سادۀ KDE جاوا با یک پنجرۀ سطح بالا، گزینگان و میلههای ابزار تولید میکند. +Comment[fr]=Génère une application KDE simple en Java comprenant une fenêtre de premier niveau, des menus et des barres d'outils. +Comment[gl]=Xera unha aplicación sinxela KDE en Java cunha xanela principal, menús e barras de ferramentas. +Comment[hu]=Létrehoz egy egyszerű Java-alapú KDE-alkalmazást egy főablakkal, menükkel és eszköztárakkal. +Comment[it]=Genera una semplice applicazione KDE Java con una finestra toplevel, menu e barre degli strumenti. +Comment[nds]=Stellt en eenfach KDE-Programm in Java mit een böverst Finster, Menüs un Warktüüchbalkens op. +Comment[ne]=एउटा उच्चतह सञ्झ्याल, मेनु र उपकरणपट्टीसँग साधारण जाभा केडीई अनुप्रयोग उत्पन्न गर्दछ । +Comment[nl]=Genereert een eenvoudige Java KDE-toepassing met een toplevel window, menu's en toolbars. +Comment[pl]=Generuje prosty program KDE w Javie posiadający okno, menu i paski narzędzi. +Comment[pt]=Gera uma aplicação para KDE simples em Java, com uma janela de topo, menus e barras de ferramentas. +Comment[pt_BR]=Gera uma aplicação para KDE simples em Java, com uma janela de topo, menus e barras de ferramentas. +Comment[ru]=Создание простого приложения Java KDE с окном, меню и панелями инструментов. +Comment[sk]=Vygeneruje jednoduchú Java KDE aplikáciu s jedným oknom, menu a panelom nástrojov. +Comment[sr]=Прави једноставан Java KDE програм са једним прозором највишег нивоа, менијима и тракама са алатом. +Comment[sr@Latn]=Pravi jednostavan Java KDE program sa jednim prozorom najvišeg nivoa, menijima i trakama sa alatom. +Comment[sv]=Skapar ett enkelt Java KDE-program med ett toppnivåfönster, menyer och verktygsrader. +Comment[tr]=Bir üst seviye penceresi, menüleri ve araç çubukları olan basit bir Java KDE uygulaması yaratır. +Comment[zh_CN]=生成一个简单的带有顶级窗口、菜单和工具栏的 Java KDE 应用程序。 +Comment[zh_TW]=產生一個簡單的 Java KDE 應用程式,內含頂層視窗、選單與工具列。 +FileTemplates=java,CStyle +ShowFilesAfterGeneration=%{dest}/src/%{APPNAME}View.java +Archive=kappjava.tar.gz + +[ADMIN] +Type=include +File=%{tdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{tdevelop}/template-common/gnu.kdevtemplate + +[DOCBOOK] +Type=include +File=%{tdevelop}/template-common/dockbook.kdevtemplate + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/app.tdevelop +Dest=%{dest}/%{APPNAMELC}.tdevelop + +[FILE5] +Type=install +Source=%{tdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE6] +Type=install +Source=%{tdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE7] +Type=install +Source=%{tdevelop}/template-common/tde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{tdevelop}/template-common/tde-app.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE9] +Type=install +Source=%{tdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[FILE10] +Type=install +Source=%{tdevelop}/template-common/hi16-app-app.png +Dest=%{dest}/src/hi16-app-%{APPNAMELC}.png +Process=false + +[FILE11] +Type=install +Source=%{tdevelop}/template-common/hi32-app-app.png +Dest=%{dest}/src/hi32-app-%{APPNAMELC}.png +Process=false + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE12] +Type=install +Source=%{tdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE13] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE14] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE15] +Type=install +Source=%{src}/app.java +Dest=%{dest}/src/%{APPNAME}.java + +[FILE16] +Type=install +Source=%{src}/appview.java +Dest=%{dest}/src/%{APPNAME}View.java + +[FILE17] +Type=install +Source=%{src}/pref.java +Dest=%{dest}/src/%{APPNAME}Preferences.java + +[FILE18] +Type=install +Source=%{src}/appui.rc +Dest=%{dest}/src/%{APPNAMELC}ui.rc + diff --git a/languages/java/app_templates/kappjava/kappjava.png b/languages/java/app_templates/kappjava/kappjava.png Binary files differnew file mode 100644 index 00000000..913ebb87 --- /dev/null +++ b/languages/java/app_templates/kappjava/kappjava.png diff --git a/languages/java/app_templates/kappjava/pref.java b/languages/java/app_templates/kappjava/pref.java new file mode 100644 index 00000000..a50fdb31 --- /dev/null +++ b/languages/java/app_templates/kappjava/pref.java @@ -0,0 +1,52 @@ +/* + * Copyright (C) %{YEAR} %{AUTHOR} <%{EMAIL}> + */ + +import java.util.*; +import org.kde.qt.*; +import org.kde.koala.*; + +public class %{APPNAME}Preferences extends KDialogBase +{ +private %{APPNAME}PrefPageOne m_pageOne; +private %{APPNAME}PrefPageTwo m_pageTwo; + +public %{APPNAME}Preferences() +{ + super(TreeList, "%{APPNAME} Preferences", + Help|Default|Ok|Apply|Cancel, Ok); + + // this is the base class for your preferences dialog. it is now + // a Treelist dialog.. but there are a number of other + // possibilities (including Tab, Swallow, and just Plain) + QFrame frame; + frame = addPage(tr("First Page"), tr("Page One Options")); + m_pageOne = new %{APPNAME}PrefPageOne(frame); + + frame = addPage(tr("Second Page"), tr("Page Two Options")); + m_pageTwo = new %{APPNAME}PrefPageTwo(frame); +} + +public class %{APPNAME}PrefPageOne extends QFrame { +public %{APPNAME}PrefPageOne(QWidget parent) +{ + super(parent); + QHBoxLayout layout = new QHBoxLayout(this); + layout.setAutoAdd(true); + + new QLabel("Add something here", this); +} +} + +public class %{APPNAME}PrefPageTwo extends QFrame { +public %{APPNAME}PrefPageTwo(QWidget parent) +{ + super(parent); + QHBoxLayout layout = new QHBoxLayout(this); + layout.setAutoAdd(true); + + new QLabel("Add something here", this); +} +} + +} diff --git a/languages/java/app_templates/kappjava/src-Makefile.am b/languages/java/app_templates/kappjava/src-Makefile.am new file mode 100644 index 00000000..6468994c --- /dev/null +++ b/languages/java/app_templates/kappjava/src-Makefile.am @@ -0,0 +1,18 @@ +## Makefile.am for %{APPNAMELC} + +JAVAROOT = . + +# which sources should be compiled for %{APPNAMELC} +java_JAVA = %{APPNAME}.java %{APPNAME}View.java \ + %{APPNAME}Preferences.java + + +KDE_ICON = %{APPNAMELC} + +# this is where the kdelnk file will go +kdelnkdir = $(kde_appsdir)/Utilities +kdelnk_DATA = %{APPNAMELC}.desktop + +# this is where the XML-GUI resource file goes +rcdir = $(kde_datadir)/%{APPNAMELC} +rc_DATA = %{APPNAMELC}ui.rc diff --git a/languages/java/app_templates/kappjava/subdirs b/languages/java/app_templates/kappjava/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/java/app_templates/kappjava/subdirs @@ -0,0 +1,3 @@ +doc +po +src |