00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef JQMENUITEMBRIDGE_H
00010 #define JQMENUITEMBRIDGE_H
00011
00012 #include "JavaQxQSwing.h"
00013
00014 #include "JQActionComponentBridge.h"
00015 #include "QLabelAdapter.h"
00016
00017
00018
00019
00020
00027 class JAVAQX_EXPORT JQMenuItemBridge : public JQActionComponentBridge
00028 {
00029 Q_OBJECT
00030 protected:
00031 JQMenuItemBridge(JNIEnv *env, jobject obj);
00032 public slots:
00033 void setText(JNIEnv *env, jstring text);
00034 void setShortcut(JNIEnv *env, jstring shortcut);
00035 void setIcon(JNIEnv *env, jobject iconSet);
00036 public:
00037 static void initialize(JNIEnv *env, jclass cls);
00038 static jlong newInstance(JNIEnv *env, jobject obj);
00039 public:
00040 void actionTriggered(jint modifiers);
00041 protected slots:
00042 void triggeredSlot();
00043 protected:
00044 inline QLabelAdapter *label() const;
00045 protected:
00046 virtual QWidget *createQWidget();
00047 virtual QAction *createQAction();
00048 virtual void deleteQWidget(QWidget *widget);
00049 virtual void deleteQAction(QAction *action);
00050 virtual QWidget *convertToQWidget(QAction *action);
00051 virtual QAction *convertToQAction(QWidget *widget);
00052 private:
00053 QShortcut *m_shortcut;
00054 private:
00055 static jmethodID sm_actionTriggeredMID;
00056 };
00057
00058
00059
00060
00061
00067 inline QLabelAdapter *JQMenuItemBridge::label() const
00068 {
00069 return static_cast<QLabelAdapter *>(widget());
00070 }
00071
00072
00073
00074
00075
00076 #define jqMenuItemBridge (reinterpret_cast<JQMenuItemBridge *>(bridge))
00077
00078 #endif //JQMENUITEMBRIDGE_H
00079
00080
00081
00082
00083
00084
00085
00086