Source Code Cross Referenced for Shortcut.java in  » Installer » IzPack » com » izforge » izpack » util » os » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Installer » IzPack » com.izforge.izpack.util.os 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003:         * 
004:         * http://izpack.org/
005:         * http://izpack.codehaus.org/
006:         * 
007:         * Copyright 2002 Elmar Grom
008:         * 
009:         * Licensed under the Apache License, Version 2.0 (the "License");
010:         * you may not use this file except in compliance with the License.
011:         * You may obtain a copy of the License at
012:         * 
013:         *     http://www.apache.org/licenses/LICENSE-2.0
014:         *     
015:         * Unless required by applicable law or agreed to in writing, software
016:         * distributed under the License is distributed on an "AS IS" BASIS,
017:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018:         * See the License for the specific language governing permissions and
019:         * limitations under the License.
020:         */
021:
022:        package com.izforge.izpack.util.os;
023:
024:        import java.io.UnsupportedEncodingException;
025:        import java.util.Vector;
026:
027:        import com.izforge.izpack.installer.UninstallData;
028:
029:        /*---------------------------------------------------------------------------*/
030:        /**
031:         * This class represents a shortcut in a operating system independent way. OS specific subclasses
032:         * are used to implement the necessary mapping from this generic API to the classes that reflect the
033:         * system dependent AIP.
034:         * 
035:         * @see com.izforge.izpack.util.TargetFactory
036:         * 
037:         * @version 0.0.1 / 3/4/02
038:         * @author Elmar Grom
039:         */
040:        public class Shortcut {
041:
042:            // ------------------------------------------------------------------------
043:            // Constant Definitions
044:            // ------------------------------------------------------------------------
045:            /** APPLICATIONS = 1 */
046:            public static final int APPLICATIONS = 1;
047:
048:            /** START_MENU = 2 */
049:            public static final int START_MENU = 2;
050:
051:            /** DESKTOP = 3 */
052:            public static final int DESKTOP = 3;
053:
054:            /** START_UP = 4 */
055:            public static final int START_UP = 4;
056:
057:            /** HIDE = 0 (Hide the window when starting.) */
058:            public static final int HIDE = 0;
059:
060:            /**
061:             * NORMAL = 1 Show the window 'normal' when starting. Usually restores the window properties at
062:             * the last shut-down.
063:             */
064:            public static final int NORMAL = 1;
065:
066:            /** MINIMIZED = 2 */
067:            public static final int MINIMIZED = 2;
068:
069:            /** MAXIMIZED = 3 (Show the window maximized when starting.) */
070:            public static final int MAXIMIZED = 3;
071:
072:            /** CURRENT_USER = 1 (identifies the user type as the current user) */
073:            public static final int CURRENT_USER = 1;
074:
075:            /** ALL_USERS = 2 (identifies the user type as valid for all users) */
076:            public static final int ALL_USERS = 2;
077:
078:            /** indicates that this shortcut should be created for all users or only me * */
079:            private Boolean createForAll;
080:
081:            /** internal field UninstallData uninstaller */
082:            protected UninstallData uninstaller;
083:
084:            /*--------------------------------------------------------------------------*/
085:            /**
086:             * This method initializes the object. It is used as a replacement for the contructor because of
087:             * the way it is instantiated through the <code>TargetFactory</code>.
088:             * 
089:             * @param type the type or classification of the program group in which the link should exist.
090:             * @param name the name of the shortcut.
091:             */
092:            public void initialize(int type, String name) throws Exception {
093:            }
094:
095:            /*--------------------------------------------------------------------------*/
096:            /**
097:             * Returns the base path of the shortcut depending on type. The base path is the directory that
098:             * the short cut, (or its program group) will be created in. For instance, on Windows NT, a
099:             * shortcut with user-type ALL_USERS, and link-type DESKTOP might have the base path
100:             * "C:\Program&nbsp;Files\All&nbsp;Users\Desktop"
101:             * 
102:             * @see #setLinkType(int)
103:             * @see #setUserType(int)
104:             */
105:            public String getBasePath() throws Exception {
106:                return ("");
107:            }
108:
109:            /*--------------------------------------------------------------------------*/
110:            /**
111:             * Returns a list of currently existing program groups, based on the requested type. For example
112:             * if the type is <code>APPLICATIONS</code> then all the names of the program groups in the
113:             * Start Menu\Programs menu would be returned.
114:             * 
115:             * @param userType the type of user for the program group set.
116:             * 
117:             * @return a <code>Vector</code> of <code>String</code> objects that represent the names of
118:             * the existing program groups. It is theoretically possible that this list is empty.
119:             * 
120:             * @see #APPLICATIONS
121:             * @see #START_MENU
122:             */
123:            public Vector<String> getProgramGroups(int userType) {
124:                return (null);
125:            }
126:
127:            /*--------------------------------------------------------------------------*/
128:            /**
129:             * Subclass implementations return the fully qualified file name under which the link is saved
130:             * on disk. <b>Note:</b> this method returns valid results only if the instance was created
131:             * from a file on disk or after a successful save operation. An instance of this class returns
132:             * an empty string.
133:             * 
134:             * @return an empty <code>String</code>
135:             */
136:            public String getFileName() {
137:                return ("");
138:            }
139:
140:            /*--------------------------------------------------------------------------*/
141:            /**
142:             * Subclass implementations return the path of the directory where the link file is stored, if
143:             * it was necessary during the previous save operation to create the directory. This method
144:             * returns <code>null</code> if no save operation was carried out or there was no need to
145:             * create a directory during the previous save operation.
146:             * 
147:             * @return this implementation returns always <code>null</code>.
148:             */
149:            public String getDirectoryCreated() {
150:                return (null);
151:            }
152:
153:            /*--------------------------------------------------------------------------*/
154:            /**
155:             * Returns <code>true</code> if the target OS supports current user and all users.
156:             * 
157:             * @return <code>true</code> if the target OS supports current and all users.
158:             */
159:            public boolean multipleUsers() {
160:                return (false);
161:            }
162:
163:            /*--------------------------------------------------------------------------*/
164:            /**
165:             * Determines if a specific instance of this class supports the creation of shortcuts. The use
166:             * of this method might seem odd, since one would not implement a flavor of this class that does
167:             * not actually support the creation of shortcuts. In other words all flavors will in all
168:             * probability return true. The only version that can be expected to return false is this class
169:             * itself, since it has no actual implementation for shortcut creation. This is left to OS
170:             * specific flavors. If the installer is launched on a unsupported OS there will be no
171:             * appropriate flavor of this class, which will cause this class itself to be instantiated. The
172:             * client code can now determine by calling this method if the active OS is supported and take
173:             * appropriate action.
174:             * 
175:             * @return <code>true</code> if the creation of shortcuts is supported, <code>false</code>
176:             * if this is not supported.
177:             */
178:            public boolean supported() {
179:                return (false);
180:            }
181:
182:            /*--------------------------------------------------------------------------*/
183:            /**
184:             * Sets the command line arguments that will be passed to the target when the link is activated.
185:             * 
186:             * @param arguments the command line arguments
187:             */
188:            public void setArguments(String arguments) {
189:            }
190:
191:            /*--------------------------------------------------------------------------*/
192:            /**
193:             * Sets the description string that is used to identify the link in a menu or on the desktop.
194:             * 
195:             * @param description the descriptiojn string
196:             */
197:            public void setDescription(String description) {
198:            }
199:
200:            /*--------------------------------------------------------------------------*/
201:            /**
202:             * Sets the location of the icon that is shown for the shortcut on the desktop.
203:             * 
204:             * @param path a fully qualified file name of a file that contains the icon.
205:             * @param index the index of the specific icon to use in the file. If there is only one icon in
206:             * the file, use an index of 0.
207:             */
208:            public void setIconLocation(String path, int index) {
209:            }
210:
211:            /*--------------------------------------------------------------------------*/
212:            /**
213:             * returns icon Location
214:             * 
215:             * @return iconLocation
216:             */
217:            public String getIconLocation() {
218:                return "";
219:            }
220:
221:            /*--------------------------------------------------------------------------*/
222:            /**
223:             * Sets the name of the program group this ShellLinbk should be placed in.
224:             * 
225:             * @param groupName the name of the program group
226:             */
227:            public void setProgramGroup(String groupName) {
228:            }
229:
230:            /*--------------------------------------------------------------------------*/
231:            /**
232:             * Sets the show command that is passed to the target application when the link is activated.
233:             * The show command determines if the the window will be restored to the previous size,
234:             * minimized, maximized or visible at all. <br>
235:             * <br>
236:             * <b>Note:</b><br>
237:             * Using <code>HIDE</code> will cause the target window not to show at all. There is not even
238:             * a button on the taskbar. This is a very useful setting when batch files are used to launch a
239:             * Java application as it will then appear to run just like any native Windows application.<br>
240:             * 
241:             * @param show the show command. Valid settings are: <br>
242:             * <ul>
243:             * <li>{@link com.izforge.izpack.util.os.Shortcut#HIDE}
244:             * <li>{@link com.izforge.izpack.util.os.Shortcut#NORMAL}
245:             * <li>{@link com.izforge.izpack.util.os.Shortcut#MINIMIZED}
246:             * <li>{@link com.izforge.izpack.util.os.Shortcut#MAXIMIZED}
247:             * </ul>
248:             * 
249:             * @see #getShowCommand
250:             */
251:            public void setShowCommand(int show) {
252:            }
253:
254:            /*
255:             * retrieves showCommand from the OS. Translates it into Shortcut.XXX terms.
256:             */
257:            public int getShowCommand() {
258:                return Shortcut.NORMAL;
259:            }
260:
261:            /*--------------------------------------------------------------------------*/
262:            /**
263:             * Sets the absolute path to the shortcut target.
264:             * 
265:             * @param path the fully qualified file name of the target
266:             */
267:            public void setTargetPath(String path) {
268:            }
269:
270:            /*--------------------------------------------------------------------------*/
271:            /**
272:             * Sets the working directory for the link target.
273:             * 
274:             * @param dir the working directory
275:             */
276:            public void setWorkingDirectory(String dir) {
277:            }
278:
279:            /*--------------------------------------------------------------------------*/
280:            /**
281:             * Gets the working directory for the link target.
282:             * 
283:             * @return the working directory.
284:             */
285:            public String getWorkingDirectory() {
286:                return "";
287:            }
288:
289:            /*--------------------------------------------------------------------------*/
290:            /**
291:             * Sets the name shown in a menu or on the desktop for the link.
292:             * 
293:             * @param name The name that the link should display on a menu or on the desktop. Do not include
294:             * a file extension.
295:             */
296:            public void setLinkName(String name) {
297:            }
298:
299:            /*--------------------------------------------------------------------------*/
300:            /**
301:             * Gets the type of link types are: <br>
302:             * <ul>
303:             * <li>{@link com.izforge.izpack.util.os.Shortcut#DESKTOP}
304:             * <li>{@link com.izforge.izpack.util.os.Shortcut#APPLICATIONS}
305:             * <li>{@link com.izforge.izpack.util.os.Shortcut#START_MENU}
306:             * <li>{@link com.izforge.izpack.util.os.Shortcut#START_UP}
307:             * </ul>
308:             */
309:            public int getLinkType() {
310:                // fake default.
311:                return Shortcut.DESKTOP;
312:            }
313:
314:            /*--------------------------------------------------------------------------*/
315:            /**
316:             * Sets the type of link
317:             * 
318:             * @param type The type of link desired. The following values can be set:<br>
319:             * <ul>
320:             * <li>{@link com.izforge.izpack.util.os.Shortcut#DESKTOP}
321:             * <li>{@link com.izforge.izpack.util.os.Shortcut#APPLICATIONS}
322:             * <li>{@link com.izforge.izpack.util.os.Shortcut#START_MENU}
323:             * <li>{@link com.izforge.izpack.util.os.Shortcut#START_UP}
324:             * </ul>
325:             * 
326:             * @exception IllegalArgumentException if an an invalid type is passed
327:             * @throws UnsupportedEncodingException
328:             */
329:            public void setLinkType(int type) throws IllegalArgumentException,
330:                    UnsupportedEncodingException {
331:            }
332:
333:            /*--------------------------------------------------------------------------*/
334:            /**
335:             * Sets the user type for the link
336:             * 
337:             * @param type the type of user for the link.
338:             * 
339:             * @see #CURRENT_USER
340:             * @see #ALL_USERS
341:             */
342:            public void setUserType(int type) {
343:            }
344:
345:            /*--------------------------------------------------------------------------*/
346:            /**
347:             * Gets the user type for the link
348:             * 
349:             * @return userType
350:             * @see #CURRENT_USER
351:             * @see #ALL_USERS
352:             */
353:            public int getUserType() {
354:                return CURRENT_USER;
355:            }
356:
357:            /*--------------------------------------------------------------------------*/
358:            /**
359:             * Saves this link.
360:             * 
361:             * @exception Exception if problems are encountered
362:             */
363:            public void save() throws Exception {
364:            }
365:
366:            /*--------------------------------------------------------------------------*/
367:            /**
368:             * Gets the link hotKey
369:             * 
370:             * @return int hotKey
371:             */
372:            public int getHotkey() {
373:                return 0;
374:            }
375:
376:            /*--------------------------------------------------------------------------*/
377:            /**
378:             * Sets the link hotKey
379:             * 
380:             * @param hotkey
381:             */
382:            public void setHotkey(int hotkey) {
383:            }
384:
385:            /**
386:             * Sets the Encoding
387:             * 
388:             * @param string
389:             */
390:            public void setEncoding(String string) {
391:            }
392:
393:            /**
394:             * This sets the Mimetype
395:             * 
396:             * @param string
397:             */
398:            public void setMimetype(String string) {
399:            }
400:
401:            /**
402:             * Sets the terminal
403:             * 
404:             * @param string
405:             */
406:            public void setTerminal(String string) {
407:            }
408:
409:            /**
410:             * This sets the terminals-options
411:             * 
412:             * @param string
413:             */
414:            public void setTerminalOptions(String string) {
415:            }
416:
417:            /**
418:             * This sets the shortcut type
419:             * 
420:             * @param string
421:             */
422:            public void setType(String string) {
423:            }
424:
425:            /**
426:             * This sets the KdeUserName
427:             * 
428:             * @param string The UserName
429:             */
430:            public void setKdeUserName(String string) {
431:            }
432:
433:            /**
434:             * This sets the setKdeSubstUID
435:             * 
436:             * @param string exactly &quot;true&quot; or &quot;false&quot; or nothing
437:             */
438:            public void setKdeSubstUID(String string) {
439:            }
440:
441:            /**
442:             * This sets the URL
443:             * 
444:             * @param string
445:             */
446:            public void setURL(String string) {
447:            }
448:
449:            /**
450:             * Gets the Programs Folder for the given User. This is where to create subfolders or to place
451:             * or create shortcuts.
452:             * 
453:             * @param current_user one of current or all
454:             * 
455:             * @return The Foldername or null on unsupported platforms.
456:             */
457:            public String getProgramsFolder(int current_user) {
458:                return null;
459:            }
460:
461:            /**
462:             * Sets the flag which indicates, that this should created for all.
463:             * 
464:             * @param aCreateForAll A Flag - Set to true, if to create for All.
465:             */
466:            public void setCreateForAll(Boolean aCreateForAll) {
467:                this .createForAll = aCreateForAll.booleanValue();
468:            }
469:
470:            /**
471:             * Gets the create for All Flag
472:             * 
473:             * @return Returns True if this should be for all.
474:             */
475:            public Boolean getCreateForAll() {
476:                return createForAll;
477:            }
478:
479:            /**
480:             * Sets the Categories Field On Unixes
481:             * 
482:             * @param theCategories the categories
483:             */
484:            public void setCategories(String theCategories) {
485:            }
486:
487:            /**
488:             * Sets the TryExecField on Unixes.
489:             * 
490:             * @param aTryExec the try exec command
491:             */
492:            public void setTryExec(String aTryExec) {
493:            }
494:
495:            /**
496:             * Sets the Uninstaller field with the unique Uninstaller Instance.
497:             * 
498:             * @param theUninstaller the unique instance
499:             */
500:            public void setUninstaller(UninstallData theUninstaller) {
501:                uninstaller = theUninstaller;
502:            }
503:
504:            /**
505:             * Dummy Method especially for the Unix Root User. 
506:             *
507:             */
508:            public void execPostAction() {
509:                //Debug.log("Call of unused execPostAction Method in " + this.getClass().getName() );
510:            }
511:
512:            /**
513:             * Clean Up Method to do some cleanups after Shortcut Creation. 
514:             * <br>
515:             * currently unused.
516:             */
517:            public void cleanUp() {
518:                //Debug.log("Call of unused cleanUp Method in " + this.getClass().getName() );     
519:            }
520:
521:        }
522:        /*---------------------------------------------------------------------------*/
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.