|
@@ -1,79 +1,79 @@ |
1 |
|
- |
// This Source Code is in the Public Domain per: http://unlicense.org |
2 |
|
- |
package org.litesoft.GWT.client.taskbar; |
3 |
|
- |
|
4 |
|
- |
import org.litesoft.GWT.client.iconservice.*; |
5 |
|
- |
import org.litesoft.GWT.client.nonpublic.*; |
6 |
|
- |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
7 |
|
- |
|
8 |
|
- |
import com.google.gwt.user.client.ui.*; |
9 |
|
- |
|
10 |
|
- |
public abstract class TaskbarItem { |
11 |
|
- |
private Widget mTaskbarWidget; |
12 |
|
- |
private TaskbarEntry mEntry; |
13 |
|
- |
private TaskbarHelper mTaskbarHelper; |
14 |
|
- |
|
15 |
|
- |
public TaskbarItem( final TaskbarHelper pHelper, TaskbarEntry pEntry, final boolean pFavorite ) { |
16 |
|
- |
Image image = pEntry.getSmallIconImage(); |
17 |
|
- |
mTaskbarWidget = new BackgroundCellForTaskbarItem( image ); |
18 |
|
- |
mEntry = pEntry; |
19 |
|
- |
mTaskbarHelper = pHelper; |
20 |
|
- |
|
21 |
|
- |
image.addMouseListener( new MouseListenerAdapter() { |
22 |
|
- |
public void onMouseEnter( Widget sender ) { |
23 |
|
- |
if ( !mTaskbarHelper.mContextMenuIsShown ) { |
24 |
|
- |
mouseOver( pFavorite ); |
25 |
|
- |
} |
26 |
|
- |
} |
27 |
|
- |
} ); |
28 |
|
- |
|
29 |
|
- |
image.addClickListener( new ClickListener() { |
30 |
|
- |
public void onClick( Widget sender ) { |
31 |
|
- |
mouseOver( pFavorite ); |
32 |
|
- |
mTaskbarHelper.click( sender ); |
33 |
|
- |
} |
34 |
|
- |
} ); |
35 |
|
- |
} |
36 |
|
- |
|
37 |
|
- |
private void mouseOver( boolean pFavorite ) { |
38 |
|
- |
mTaskbarHelper.setupForPopup( pFavorite, getTaskbarItem() ); |
39 |
|
- |
mTaskbarHelper.showPopup( getTaskbarItem() ); |
40 |
|
- |
} |
41 |
|
- |
|
42 |
|
- |
public TaskbarItem getTaskbarItem() { |
43 |
|
- |
return this; |
44 |
|
- |
} |
45 |
|
- |
|
46 |
|
- |
public Widget getTaskbarWidget() { |
47 |
|
- |
return mTaskbarWidget; |
48 |
|
- |
} |
49 |
|
- |
|
50 |
|
- |
public String getTooltip() { |
51 |
|
- |
return mEntry.getTooltip(); |
52 |
|
- |
} |
53 |
|
- |
|
54 |
|
- |
public void bringToFront() { |
55 |
|
- |
TaskbarEntry taskbarEntry = getEntry(); |
56 |
|
- |
ITaskbarFloaterManageable floater = ((TaskbarFloaterEntry) taskbarEntry).getFloater(); |
57 |
|
- |
SizeableFloater sizeableFloater = floater.getFloater(); |
58 |
|
- |
TaskbarDockingPanel dockingPanel = mTaskbarHelper.getTaskbarDockingPanel(); |
59 |
|
- |
dockingPanel.bringFloaterToTop( sizeableFloater ); |
60 |
|
- |
} |
61 |
|
- |
|
62 |
|
- |
public void manageFloater() { |
63 |
|
- |
ITaskbarFloaterManageable floater = getFloaterPanel(); |
64 |
|
- |
SizeableFloater sizeableFloater = floater.getFloater(); |
65 |
|
- |
new FloaterMoveSizeDialog( sizeableFloater.getTitle(), floater ).initialize( null, null ).show(); |
66 |
|
- |
} |
67 |
|
- |
|
68 |
|
- |
public String getLargeURL() { |
69 |
|
- |
return mEntry.getLargeIconURL(); |
70 |
|
- |
} |
71 |
|
- |
|
72 |
|
- |
public TaskbarEntry getEntry() { |
73 |
|
- |
return mEntry; |
74 |
|
- |
} |
75 |
|
- |
|
76 |
|
- |
public ITaskbarFloaterManageable getFloaterPanel() { |
77 |
|
- |
return ((TaskbarFloaterEntry) getEntry()).getFloater(); |
78 |
|
- |
} |
79 |
|
- |
} |
|
1 |
+ |
// This Source Code is in the Public Domain per: http://unlicense.org |
|
2 |
+ |
package org.litesoft.GWT.client.taskbar; |
|
3 |
+ |
|
|
4 |
+ |
import org.litesoft.GWT.client.iconservice.*; |
|
5 |
+ |
import org.litesoft.GWT.client.nonpublic.*; |
|
6 |
+ |
import org.litesoft.GWT.client.widgets.nonpublic.*; |
|
7 |
+ |
|
|
8 |
+ |
import com.google.gwt.user.client.ui.*; |
|
9 |
+ |
|
|
10 |
+ |
public abstract class TaskbarItem { |
|
11 |
+ |
private Widget mTaskbarWidget; |
|
12 |
+ |
private TaskbarEntry mEntry; |
|
13 |
+ |
private TaskbarHelper mTaskbarHelper; |
|
14 |
+ |
|
|
15 |
+ |
public TaskbarItem( final TaskbarHelper pHelper, TaskbarEntry pEntry, final boolean pFavorite ) { |
|
16 |
+ |
Image image = pEntry.getSmallIconImage(); |
|
17 |
+ |
mTaskbarWidget = new BackgroundCellForTaskbarItem( image ); |
|
18 |
+ |
mEntry = pEntry; |
|
19 |
+ |
mTaskbarHelper = pHelper; |
|
20 |
+ |
|
|
21 |
+ |
image.addMouseListener( new MouseListenerAdapter() { |
|
22 |
+ |
public void onMouseEnter( Widget sender ) { |
|
23 |
+ |
if ( !mTaskbarHelper.mContextMenuIsShown ) { |
|
24 |
+ |
mouseOver( pFavorite ); |
|
25 |
+ |
} |
|
26 |
+ |
} |
|
27 |
+ |
} ); |
|
28 |
+ |
|
|
29 |
+ |
image.addClickListener( new ClickListener() { |
|
30 |
+ |
public void onClick( Widget sender ) { |
|
31 |
+ |
mouseOver( pFavorite ); |
|
32 |
+ |
mTaskbarHelper.click( sender ); |
|
33 |
+ |
} |
|
34 |
+ |
} ); |
|
35 |
+ |
} |
|
36 |
+ |
|
|
37 |
+ |
private void mouseOver( boolean pFavorite ) { |
|
38 |
+ |
mTaskbarHelper.setupForPopup( pFavorite, getTaskbarItem() ); |
|
39 |
+ |
mTaskbarHelper.showPopup( getTaskbarItem() ); |
|
40 |
+ |
} |
|
41 |
+ |
|
|
42 |
+ |
public TaskbarItem getTaskbarItem() { |
|
43 |
+ |
return this; |
|
44 |
+ |
} |
|
45 |
+ |
|
|
46 |
+ |
public Widget getTaskbarWidget() { |
|
47 |
+ |
return mTaskbarWidget; |
|
48 |
+ |
} |
|
49 |
+ |
|
|
50 |
+ |
public String getTooltip() { |
|
51 |
+ |
return mEntry.getTooltip(); |
|
52 |
+ |
} |
|
53 |
+ |
|
|
54 |
+ |
public void bringToFront() { |
|
55 |
+ |
TaskbarEntry taskbarEntry = getEntry(); |
|
56 |
+ |
ITaskbarFloaterManageable floater = ((TaskbarFloaterEntry) taskbarEntry).getFloater(); |
|
57 |
+ |
SizeableFloater sizeableFloater = floater.getFloater(); |
|
58 |
+ |
TaskbarDockingPanel dockingPanel = mTaskbarHelper.getTaskbarDockingPanel(); |
|
59 |
+ |
dockingPanel.bringFloaterToTop( sizeableFloater ); |
|
60 |
+ |
} |
|
61 |
+ |
|
|
62 |
+ |
public void manageFloater() { |
|
63 |
+ |
ITaskbarFloaterManageable floater = getFloaterPanel(); |
|
64 |
+ |
SizeableFloater sizeableFloater = floater.getFloater(); |
|
65 |
+ |
new FloaterMoveSizeDialog( sizeableFloater.getTitle(), floater ).initialize( null, null ).show(); |
|
66 |
+ |
} |
|
67 |
+ |
|
|
68 |
+ |
public String getLargeURL() { |
|
69 |
+ |
return mEntry.getLargeIconURL(); |
|
70 |
+ |
} |
|
71 |
+ |
|
|
72 |
+ |
public TaskbarEntry getEntry() { |
|
73 |
+ |
return mEntry; |
|
74 |
+ |
} |
|
75 |
+ |
|
|
76 |
+ |
public ITaskbarFloaterManageable getFloaterPanel() { |
|
77 |
+ |
return ((TaskbarFloaterEntry) getEntry()).getFloater(); |
|
78 |
+ |
} |
|
79 |
+ |
} |