Source Code Cross Referenced for ConfigurationAreaBlock.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » launcher » 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 » IDE Eclipse » Eclipse plug in development » org.eclipse.pde.internal.ui.launcher 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2005, 2007 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.pde.internal.ui.launcher;
011:
012:        import org.eclipse.core.runtime.CoreException;
013:        import org.eclipse.debug.core.ILaunchConfiguration;
014:        import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
015:        import org.eclipse.pde.internal.ui.PDEUIMessages;
016:        import org.eclipse.pde.ui.launcher.AbstractLauncherTab;
017:        import org.eclipse.pde.ui.launcher.IPDELauncherConstants;
018:        import org.eclipse.swt.SWT;
019:        import org.eclipse.swt.events.SelectionAdapter;
020:        import org.eclipse.swt.events.SelectionEvent;
021:        import org.eclipse.swt.layout.GridData;
022:        import org.eclipse.swt.layout.GridLayout;
023:        import org.eclipse.swt.widgets.Button;
024:        import org.eclipse.swt.widgets.Composite;
025:        import org.eclipse.swt.widgets.Group;
026:
027:        public class ConfigurationAreaBlock extends BaseBlock {
028:
029:            private Button fUseDefaultLocationButton;
030:            private Button fClearConfig;
031:            private String fLastEnteredConfigArea;
032:            private String fConfigName;
033:            private static String DEFAULT_DIR = "${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/"; //$NON-NLS-1$
034:
035:            public ConfigurationAreaBlock(AbstractLauncherTab tab) {
036:                super (tab);
037:            }
038:
039:            public void createControl(Composite parent) {
040:                Group group = new Group(parent, SWT.NONE);
041:                group.setText(PDEUIMessages.ConfigurationTab_configAreaGroup);
042:                group.setLayout(new GridLayout(2, false));
043:                group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
044:
045:                fUseDefaultLocationButton = new Button(group, SWT.CHECK);
046:                GridData gd = new GridData();
047:                gd.horizontalSpan = 2;
048:                fUseDefaultLocationButton.setLayoutData(gd);
049:                fUseDefaultLocationButton
050:                        .setText(PDEUIMessages.ConfigurationTab_useDefaultLoc);
051:                fUseDefaultLocationButton
052:                        .addSelectionListener(new SelectionAdapter() {
053:                            public void widgetSelected(SelectionEvent e) {
054:                                boolean useDefaultArea = fUseDefaultLocationButton
055:                                        .getSelection();
056:                                if (useDefaultArea)
057:                                    fLocationText.setText(DEFAULT_DIR
058:                                            + fConfigName);
059:                                else
060:                                    fLocationText
061:                                            .setText(fLastEnteredConfigArea);
062:                                enableBrowseSection(!useDefaultArea);
063:                            }
064:                        });
065:
066:                createText(group, PDEUIMessages.ConfigurationTab_configLog, 20);
067:
068:                Composite buttons = new Composite(group, SWT.NONE);
069:                GridLayout layout = new GridLayout(4, false);
070:                layout.marginHeight = layout.marginWidth = 0;
071:                buttons.setLayout(layout);
072:                gd = new GridData(GridData.FILL_HORIZONTAL);
073:                gd.horizontalSpan = 2;
074:                buttons.setLayoutData(gd);
075:
076:                fClearConfig = new Button(buttons, SWT.CHECK);
077:                fClearConfig.setText(PDEUIMessages.ConfigurationTab_clearArea);
078:                fClearConfig.setLayoutData(new GridData(
079:                        GridData.FILL_HORIZONTAL));
080:                fClearConfig.addSelectionListener(fListener);
081:
082:                createButtons(buttons, new String[] {
083:                        PDEUIMessages.BaseBlock_workspace,
084:                        PDEUIMessages.BaseBlock_filesystem,
085:                        PDEUIMessages.BaseBlock_variables });
086:            }
087:
088:            public void initializeFrom(ILaunchConfiguration configuration)
089:                    throws CoreException {
090:                fConfigName = configuration.getName();
091:                boolean useDefaultArea = configuration.getAttribute(
092:                        IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true);
093:                fUseDefaultLocationButton.setSelection(useDefaultArea);
094:                enableBrowseSection(!useDefaultArea);
095:
096:                fClearConfig.setSelection(configuration.getAttribute(
097:                        IPDELauncherConstants.CONFIG_CLEAR_AREA, false));
098:                fLastEnteredConfigArea = configuration.getAttribute(
099:                        IPDELauncherConstants.CONFIG_LOCATION, ""); //$NON-NLS-1$
100:
101:                if (useDefaultArea)
102:                    fLocationText.setText(DEFAULT_DIR + fConfigName);
103:                else
104:                    fLocationText.setText(fLastEnteredConfigArea);
105:            }
106:
107:            public void performApply(
108:                    ILaunchConfigurationWorkingCopy configuration) {
109:                configuration.setAttribute(
110:                        IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA,
111:                        fUseDefaultLocationButton.getSelection());
112:                fLastEnteredConfigArea = getLocation();
113:                configuration.setAttribute(
114:                        IPDELauncherConstants.CONFIG_LOCATION,
115:                        fLastEnteredConfigArea);
116:                configuration.setAttribute(
117:                        IPDELauncherConstants.CONFIG_CLEAR_AREA, fClearConfig
118:                                .getSelection());
119:            }
120:
121:            public void setDefaults(
122:                    ILaunchConfigurationWorkingCopy configuration,
123:                    boolean isJUnit) {
124:                configuration
125:                        .setAttribute(
126:                                IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA,
127:                                !isJUnit);
128:                configuration.setAttribute(
129:                        IPDELauncherConstants.CONFIG_CLEAR_AREA, isJUnit);
130:                String location = DEFAULT_DIR
131:                        + (isJUnit ? "pde-junit" : configuration.getName()); //$NON-NLS-1$
132:                configuration.setAttribute(
133:                        IPDELauncherConstants.CONFIG_LOCATION, location);
134:            }
135:
136:            protected String getName() {
137:                return PDEUIMessages.ConfigurationAreaBlock_name;
138:            }
139:
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.