Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 306039 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT/common/org/eclipse/swt/SWT.java (-1 / +33 lines)
Lines 3971-3977 Link Here
3971
	 */
3971
	 */
3972
	public static final String SKIN_ID = "org.eclipse.swt.skin.id";
3972
	public static final String SKIN_ID = "org.eclipse.swt.skin.id";
3973
3973
3974
	
3974
	/**
3975
	 * Key value for setting and getting the executable information
3976
	 * for items in TaskBar.
3977
	 * 
3978
	 * @see org.eclipse.swt.widgets.Widget#getData(String)
3979
	 * @see org.eclipse.swt.widgets.Widget#setData(String, Object)
3980
	 * 
3981
	 * @since 3.7
3982
	 */
3983
	public static final String TASKBAR_ITEM_EXECUTABLE = "org.eclipse.swt.win32.taskbar.executable";
3984
3985
	/**
3986
	 * Key value for setting and getting the arguments information
3987
	 * for items in TaskBar.
3988
	 * 
3989
	 * @see org.eclipse.swt.widgets.Widget#getData(String)
3990
	 * @see org.eclipse.swt.widgets.Widget#setData(String, Object)
3991
	 * 
3992
	 * @since 3.7
3993
	 */
3994
	public static final String TASKBAR_ITEM_ARGUMENTS = "org.eclipse.swt.win32.taskbar.arguments";
3995
3996
	/**
3997
	 * Key value for setting and getting the icon file name
3998
	 * for items in TaskBar.
3999
	 * 
4000
	 * @see org.eclipse.swt.widgets.Widget#getData(String)
4001
	 * @see org.eclipse.swt.widgets.Widget#setData(String, Object)
4002
	 * 
4003
	 * @since 3.7
4004
	 */
4005
	public static final String TASKBAR_ITEM_ICON = "org.eclipse.swt.win32.taskbar.icon";
4006
3975
/**
4007
/**
3976
 * Answers a concise, human readable description of the error code.
4008
 * Answers a concise, human readable description of the error code.
3977
 *
4009
 *
(-)Eclipse SWT/win32/org/eclipse/swt/widgets/TaskBar.java (-5 / +29 lines)
Lines 148-157 Link Here
148
		key = PKEY_Title;
148
		key = PKEY_Title;
149
		
149
		
150
		/*IShellLink::SetPath*/
150
		/*IShellLink::SetPath*/
151
		hr = OS.VtblCall (20, pLink, EXE_PATH);
151
		char[] exePath = EXE_PATH;
152
		if (item.getData(SWT.TASKBAR_ITEM_EXECUTABLE) != null) {
153
			exePath = ((String) item.getData(SWT.TASKBAR_ITEM_EXECUTABLE)).toCharArray();
154
		}
155
156
		hr = OS.VtblCall (20, pLink, exePath);
152
		if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
157
		if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
153
		
158
		
154
		text = Display.LAUNCHER_PREFIX + Display.TASKBAR_EVENT + item.id;
159
		if (item.getData(SWT.TASKBAR_ITEM_ARGUMENTS) != null) {
160
			StringBuffer argsBuffer = new StringBuffer();
161
			String[] args = (String[]) item.getData(SWT.TASKBAR_ITEM_ARGUMENTS);
162
			for (int i = 0; i < args.length; i++) {
163
					argsBuffer.append((args[i].indexOf(' ') >= 0
164
							&& args[i].charAt(0) != '"' ? '"' + args[i] + '"' : args[i]) + " ");
165
			}
166
			text = argsBuffer.toString().trim();
167
		} else {
168
			text = Display.LAUNCHER_PREFIX + Display.TASKBAR_EVENT + item.id;
169
		}
170
155
		length = text.length ();
171
		length = text.length ();
156
		buffer = new char [length + 1];
172
		buffer = new char [length + 1];
157
		text.getChars (0, length, buffer, 0);
173
		text.getChars (0, length, buffer, 0);
Lines 169-178 Link Here
169
//			hr = OS.VtblCall (7, pLink, buffer);
185
//			hr = OS.VtblCall (7, pLink, buffer);
170
//			if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
186
//			if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
171
//		}
187
//		}
172
		
188
173
		Image image = item.getImage ();
189
		Image image = item.getImage ();
174
		if (image != null && directory != null) {
190
		if (item.getData(SWT.TASKBAR_ITEM_ICON) != null) {
175
			String imageFilename = directory + "\\menu" + item.id + ".ico" ;
191
			String imageFilename = (String) item.getData(SWT.TASKBAR_ITEM_ICON);
192
			length = imageFilename.length ();
193
			buffer = new char [length + 1];
194
			imageFilename.getChars (0, length, buffer, 0);
195
			/*IShellLink::SetIconLocation*/
196
			hr = OS.VtblCall (17, pLink, buffer, 0);
197
			if (hr != OS.S_OK) error (SWT.ERROR_INVALID_ARGUMENT);
198
		} else if (image != null && directory != null) {
199
			String imageFilename = directory + "\\menu" + item.id + ".ico";
176
			ImageData data;
200
			ImageData data;
177
			if (item.hBitmap != 0) {
201
			if (item.hBitmap != 0) {
178
				Image image2 = Image.win32_new (display, SWT.BITMAP, item.hBitmap);
202
				Image image2 = Image.win32_new (display, SWT.BITMAP, item.hBitmap);

Return to bug 306039