KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > browser > FilePickerFactory_1_8


1 /*******************************************************************************
2  * Copyright (c) 2003, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.swt.browser;
12
13 import org.eclipse.swt.internal.C;
14 import org.eclipse.swt.internal.mozilla.*;
15
16 class FilePickerFactory_1_8 extends FilePickerFactory {
17
18 void createCOMInterfaces () {
19     /* Create each of the interfaces that this object implements */
20     supports = new XPCOMObject (new int[] {2, 0, 0}) {
21         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
22         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
23         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
24     };
25     
26     factory = new XPCOMObject (new int[] {2, 0, 0, 3, 1}) {
27         public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
28         public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
29         public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
30         public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
31         public int /*long*/ method4 (int /*long*/[] args) {return LockFactory (args[0]);}
32     };
33 }
34
35 /* nsIFactory */
36
37 public int /*long*/ CreateInstance (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result) {
38     FilePicker_1_8 picker = new FilePicker_1_8 ();
39     picker.AddRef ();
40     XPCOM.memmove (result, new int /*long*/[] {picker.getAddress ()}, C.PTR_SIZEOF);
41     return XPCOM.NS_OK;
42 }
43
44 }
45
Popular Tags