*
* @param table will be added listener.
*/
- public TableToolTipListener (Table table) {
- this.table = table;
- this.addListners();
- }
- private void addListners() {
- this.table.addListener(SWT.MouseMove, this);
- this.table.addListener(SWT.MouseWheel, this);
- this.table.addListener(SWT.Dispose, this);
- this.table.addListener(SWT.MouseHover, this);
+ public void setTable(Table table) {
+ this.table = table;
}
@Override
int eventType = event.type;
if(SWT.MouseMove == eventType || SWT.MouseWheel == eventType || SWT.Dispose == eventType) {
- if(label != null) {
- label.dispose();
+ if(tip != null) {
+ tip.dispose();
+ tip = null;
label = null;
return;
}
-// if(tip != null) {
-// tip.dispose();
-// tip = null;
-// label = null;
-// return;
-// }
}
if(SWT.MouseHover == eventType) {
TableItem item = this.table.getItem(new Point(event.x, event.y));
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
+import org.tizen.common.ui.TableToolTipListener;
@SuppressWarnings("restriction")
return projectPath;
}
+ public static void addTableToolTipListener(Table table, TableToolTipListener listener) {
+ listener.setTable(table);
+ table.addListener(SWT.MouseMove, listener);
+ table.addListener(SWT.MouseWheel, listener);
+ table.addListener(SWT.Dispose, listener);
+ table.addListener(SWT.MouseHover, listener);
+ }
+
/**
* Expands tree and its sub treeitems.
*