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 324111 | Differences between
and this patch

Collapse All | Expand All

(-)common/org/eclipse/jst/j2ee/internal/common/classpath/WtpOsgiBundlesLibraryProviderInstallOperationConfig.java (-35 / +86 lines)
Lines 29-34 Link Here
29
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
29
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
30
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
30
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
31
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
31
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
32
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
33
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
32
34
33
/**
35
/**
34
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
36
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
Lines 39-65 Link Here
39
    extends OsgiBundlesLibraryProviderInstallOperationConfig
41
    extends OsgiBundlesLibraryProviderInstallOperationConfig
40
    
42
    
41
{
43
{
44
    private static final IProjectFacet WEB_FACET 
45
        = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
46
    
42
    private static final String CLASS_NAME 
47
    private static final String CLASS_NAME 
43
        = WtpOsgiBundlesLibraryProviderInstallOperationConfig.class.getName();
48
        = WtpOsgiBundlesLibraryProviderInstallOperationConfig.class.getName();
44
    
49
    
45
    public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED 
50
    public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED 
46
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
51
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
47
52
48
    private static final IProjectFacet WEB_FACET 
53
    private boolean includeWithApplicationEnabled;
49
        = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
54
    
55
    public static final String PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED 
56
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_SETTING_ENABLED"; //$NON-NLS-1$
50
57
51
    private boolean includeWithApplication = true;
58
    private boolean includeWithApplicationSettingEnabled;
52
    
59
    
53
    public boolean isIncludeWithApplicationEnabled()
60
    public boolean isIncludeWithApplicationEnabled()
54
    {
61
    {
55
        return this.includeWithApplication;
62
        return this.includeWithApplicationEnabled;
56
    }
63
    }
57
    
64
    
58
    public void setIncludeWithApplicationEnabled( final boolean includeWithApplication )
65
    public void setIncludeWithApplicationEnabled( final boolean value )
59
    {
66
    {
60
        final boolean oldValue = this.includeWithApplication;
67
        final boolean oldValue = this.includeWithApplicationEnabled;
61
        this.includeWithApplication = includeWithApplication;
68
        this.includeWithApplicationEnabled = value;
62
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplication );
69
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplicationEnabled );
70
    }
71
72
    public boolean isIncludeWithApplicationSettingEnabled()
73
    {
74
        return this.includeWithApplicationSettingEnabled;
75
    }
76
    
77
    public void setIncludeWithApplicationSettingEnabled( final boolean value )
78
    {
79
        final boolean oldValue = this.includeWithApplicationSettingEnabled;
80
        this.includeWithApplicationSettingEnabled = value;
81
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED, oldValue, this.includeWithApplicationSettingEnabled );
63
    }
82
    }
64
83
65
    @Override
84
    @Override
Lines 69-75 Link Here
69
    {
88
    {
70
        super.init( fproj, fv, provider );
89
        super.init( fproj, fv, provider );
71
        
90
        
72
        this.includeWithApplication = true;
91
        this.includeWithApplicationEnabled = isModuleFaceted( fproj );
73
        
92
        
74
        final IProject project = fproj.getProject();
93
        final IProject project = fproj.getProject();
75
        
94
        
Lines 82-114 Link Here
82
            
101
            
83
            if( currentProvider == provider )
102
            if( currentProvider == provider )
84
            {
103
            {
85
                final IPath path = OsgiBundlesContainer.CONTAINER_PATH.append( f.getId() );
104
            	this.includeWithApplicationEnabled = getIncludeWithApplicationSetting( project, f);
86
                final IJavaProject jproj = JavaCore.create( project );
105
            }
106
        }
107
        
108
        this.includeWithApplicationSettingEnabled 
109
        	= ( this.includeWithApplicationEnabled ) ? true : isModuleFaceted( fproj );
110
		
111
		IFacetedProjectListener listener = new IFacetedProjectListener() 
112
		{
113
			public void handleEvent( final IFacetedProjectEvent event ) 
114
			{
115
				final boolean moduleFaceted = isModuleFaceted( event.getWorkingCopy() );
116
				setIncludeWithApplicationEnabled( moduleFaceted );
117
				setIncludeWithApplicationSettingEnabled( moduleFaceted );
118
			}
119
		};
120
		
121
		fproj.addListener( listener, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED );
122
    }
123
    
124
    protected boolean isModuleFaceted( final IFacetedProjectBase fproj ) {
125
        for( IProjectFacetVersion facetVersion : fproj.getProjectFacets() ) 
126
        {
127
            if( ProjectFacetsManager.getGroup( "modules" ).getMembers().contains( facetVersion ) ) //$NON-NLS-1$
128
            {
129
                return true;
130
            }
131
        }
132
        return false;
133
    }
134
    
135
    private static boolean getIncludeWithApplicationSetting( final IProject proj, final IProjectFacet f )
136
    {
137
        final IPath path = OsgiBundlesContainer.CONTAINER_PATH.append( f.getId() );
138
        final IJavaProject jproj = JavaCore.create( proj );
87
                
139
                
88
                try
140
        try
141
        {
142
            for( IClasspathEntry cpe : jproj.getRawClasspath() )
143
            {
144
                if( path.equals( cpe.getPath() ) )
89
                {
145
                {
90
                    for( IClasspathEntry cpe : jproj.getRawClasspath() )
146
                    for( IClasspathAttribute attr : cpe.getExtraAttributes() )
91
                    {
147
                    {
92
                        if( path.equals( cpe.getPath() ) )
148
                        if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY ) )
93
                        {
149
                        {
94
                            this.includeWithApplication = true;
150
                            return true;
95
                            
96
                            for( IClasspathAttribute attr : cpe.getExtraAttributes() )
97
                            {
98
                                if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY ) )
99
                                {
100
                                    this.includeWithApplication = false;
101
                                }
102
                            }
103
                        }
151
                        }
104
                    }
152
                    }
105
                }
153
                }
106
                catch( CoreException e )
107
                {
108
                    throw new RuntimeException( e );
109
                }
110
            }
154
            }
111
        }
155
        }
156
        catch( CoreException e )
157
        {
158
            throw new RuntimeException( e );
159
        }
160
        
161
        return false;
112
    }
162
    }
113
    
163
    
114
    @Override
164
    @Override
Lines 117-135 Link Here
117
        final IFacetedProjectBase fproj = getFacetedProject();
167
        final IFacetedProjectBase fproj = getFacetedProject();
118
        final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
168
        final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
119
        
169
        
120
        final IClasspathAttribute attr;
121
        
122
        if( isIncludeWithApplicationEnabled() )
170
        if( isIncludeWithApplicationEnabled() )
123
        {
171
        {
124
            attr = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
172
            final IClasspathAttribute attr 
125
                                                   ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
173
            	= JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
174
                                                  ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
175
            return new IClasspathAttribute[] { attr };
126
        }
176
        }
127
        else
177
        else if ( isIncludeWithApplicationSettingEnabled() )
128
        {
178
        {
129
            attr = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
179
            final IClasspathAttribute attr 
180
            	= JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
181
            return new IClasspathAttribute[] { attr };
130
        }
182
        }
131
        
183
        
132
        return new IClasspathAttribute[]{ attr };
184
        return new IClasspathAttribute[ 0 ];
133
    }
185
    }
134
    
135
}
186
}
(-)common/org/eclipse/jst/j2ee/internal/common/classpath/WtpUserLibraryProviderInstallOperation.java (-28 / +2 lines)
Lines 11-27 Link Here
11
11
12
package org.eclipse.jst.j2ee.internal.common.classpath;
12
package org.eclipse.jst.j2ee.internal.common.classpath;
13
13
14
import org.eclipse.jdt.core.IClasspathAttribute;
15
import org.eclipse.jdt.core.IClasspathEntry;
14
import org.eclipse.jdt.core.IClasspathEntry;
16
import org.eclipse.jdt.core.JavaCore;
15
import org.eclipse.jdt.core.JavaCore;
17
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperation;
16
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperation;
18
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
17
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
19
import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
20
import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
21
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
22
import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
23
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
24
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
25
18
26
/**
19
/**
27
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
20
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
Lines 32-40 Link Here
32
    extends UserLibraryProviderInstallOperation
25
    extends UserLibraryProviderInstallOperation
33
    
26
    
34
{
27
{
35
    private static final IProjectFacet WEB_FACET 
36
        = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
37
    
38
    @Override
28
    @Override
39
    protected IClasspathEntry createClasspathEntry( final UserLibraryProviderInstallOperationConfig config,
29
    protected IClasspathEntry createClasspathEntry( final UserLibraryProviderInstallOperationConfig config,
40
                                                    final String libraryName )
30
                                                    final String libraryName )
Lines 42-66 Link Here
42
        final WtpUserLibraryProviderInstallOperationConfig cfg
32
        final WtpUserLibraryProviderInstallOperationConfig cfg
43
            = (WtpUserLibraryProviderInstallOperationConfig) config;
33
            = (WtpUserLibraryProviderInstallOperationConfig) config;
44
        
34
        
45
        final IFacetedProjectBase fproj = cfg.getFacetedProject();
35
        IClasspathEntry cpe = super.createClasspathEntry( cfg, libraryName );
46
        final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
36
        cpe = JavaCore.newContainerEntry( cpe.getPath(), null, cfg.getClasspathAttributes(), false );
47
        
48
        final IClasspathAttribute attr;
49
        
50
        if( cfg.isIncludeWithApplicationEnabled() )
51
        {
52
            attr = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
53
                                                   ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
54
        }
55
        else
56
        {
57
            attr = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
58
        }
59
        
60
        IClasspathEntry cpe = super.createClasspathEntry( config, libraryName );
61
        cpe = JavaCore.newContainerEntry( cpe.getPath(), null, new IClasspathAttribute[]{ attr }, false );
62
        
37
        
63
        return cpe;
38
        return cpe;
64
    }
39
    }
65
    
66
}
40
}
(-)common/org/eclipse/jst/j2ee/internal/common/classpath/WtpUserLibraryProviderInstallOperationConfig.java (-25 / +95 lines)
Lines 12-18 Link Here
12
package org.eclipse.jst.j2ee.internal.common.classpath;
12
package org.eclipse.jst.j2ee.internal.common.classpath;
13
13
14
import java.util.List;
14
import java.util.List;
15
16
import org.eclipse.core.resources.IProject;
15
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.runtime.CoreException;
16
import org.eclipse.core.runtime.CoreException;
18
import org.eclipse.core.runtime.IPath;
17
import org.eclipse.core.runtime.IPath;
Lines 23-32 Link Here
23
import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
22
import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
24
import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderFramework;
23
import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderFramework;
25
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
24
import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
25
import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
26
import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
26
import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
27
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
27
import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
28
import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
28
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
29
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
29
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
30
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
31
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
32
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
33
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
30
34
31
/**
35
/**
32
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
36
 * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
Lines 37-60 Link Here
37
    extends UserLibraryProviderInstallOperationConfig
41
    extends UserLibraryProviderInstallOperationConfig
38
    
42
    
39
{
43
{
44
    private static final IProjectFacet WEB_FACET 
45
        = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
46
40
    private static final String CLASS_NAME 
47
    private static final String CLASS_NAME 
41
        = WtpUserLibraryProviderInstallOperationConfig.class.getName();
48
        = WtpUserLibraryProviderInstallOperationConfig.class.getName();
42
    
49
    
43
    public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED 
50
    public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED 
44
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
51
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
45
52
46
    private boolean includeWithApplication = true;
53
    private boolean includeWithApplicationEnabled;
54
    
55
    public static final String PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED 
56
        = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_SETTING_ENABLED"; //$NON-NLS-1$
57
58
    private boolean includeWithApplicationSettingEnabled;
47
    
59
    
48
    public boolean isIncludeWithApplicationEnabled()
60
    public boolean isIncludeWithApplicationEnabled()
49
    {
61
    {
50
        return this.includeWithApplication;
62
        return this.includeWithApplicationEnabled;
63
    }
64
    
65
    public void setIncludeWithApplicationEnabled( final boolean value )
66
    {
67
        final boolean oldValue = this.includeWithApplicationEnabled;
68
        this.includeWithApplicationEnabled = value;
69
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplicationEnabled );
70
    }
71
72
    public boolean isIncludeWithApplicationSettingEnabled()
73
    {
74
        return this.includeWithApplicationSettingEnabled;
51
    }
75
    }
52
    
76
    
53
    public void setIncludeWithApplicationEnabled( final boolean includeWithApplication )
77
    public void setIncludeWithApplicationSettingEnabled( final boolean value )
54
    {
78
    {
55
        final boolean oldValue = this.includeWithApplication;
79
        final boolean oldValue = this.includeWithApplicationSettingEnabled;
56
        this.includeWithApplication = includeWithApplication;
80
        this.includeWithApplicationSettingEnabled = value;
57
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplication );
81
        notifyListeners( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED, oldValue, this.includeWithApplicationSettingEnabled );
58
    }
82
    }
59
83
60
    @Override
84
    @Override
Lines 64-70 Link Here
64
    {
88
    {
65
        super.init( fproj, fv, provider );
89
        super.init( fproj, fv, provider );
66
        
90
        
67
        this.includeWithApplication = true;
91
        this.includeWithApplicationEnabled = isModuleFaceted( fproj );
68
        
92
        
69
        final IProject project = fproj.getProject();
93
        final IProject project = fproj.getProject();
70
        
94
        
Lines 77-100 Link Here
77
            
101
            
78
            if( currentProvider == provider )
102
            if( currentProvider == provider )
79
            {
103
            {
80
                final List<IClasspathEntry> entries;
104
            	this.includeWithApplicationEnabled = getIncludeWithApplicationSetting( project, f);
81
                
105
            }
82
                try
106
        }
83
                {
107
        
84
                    entries = ClasspathUtil.getClasspathEntries( project, f );
108
        this.includeWithApplicationSettingEnabled 
85
                }
109
        	= ( this.includeWithApplicationEnabled ) ? true : isModuleFaceted( fproj );
86
                catch( CoreException e )
110
		
87
                {
111
		IFacetedProjectListener listener = new IFacetedProjectListener() 
88
                    throw new RuntimeException( e );
112
		{
89
                }
113
			public void handleEvent( final IFacetedProjectEvent event ) 
90
                
114
			{
91
                this.includeWithApplication = getIncludeWithApplicationSetting( entries );
115
				final boolean moduleFaceted = isModuleFaceted( event.getWorkingCopy() );
116
				setIncludeWithApplicationEnabled( moduleFaceted );
117
				setIncludeWithApplicationSettingEnabled( moduleFaceted );
118
			}
119
		};
120
		
121
		fproj.addListener( listener, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED );
122
    }
123
    
124
    protected boolean isModuleFaceted( final IFacetedProjectBase fproj ) {
125
        for( IProjectFacetVersion facetVersion : fproj.getProjectFacets() ) 
126
        {
127
            if( ProjectFacetsManager.getGroup( "modules" ).getMembers().contains( facetVersion ) ) //$NON-NLS-1$
128
            {
129
                return true;
92
            }
130
            }
93
        }
131
        }
132
        return false;
94
    }
133
    }
95
    
134
    
96
    private static boolean getIncludeWithApplicationSetting( final List<IClasspathEntry> entries )
135
    private static boolean getIncludeWithApplicationSetting( final IProject proj, final IProjectFacet f )
97
    {
136
    {
137
        final List<IClasspathEntry> entries;
138
        
139
        try
140
        {
141
        	entries = ClasspathUtil.getClasspathEntries( proj, f );
142
        }
143
        catch( CoreException e )
144
        {
145
        	throw new RuntimeException( e );
146
        }
147
        
98
        for( IClasspathEntry cpe : entries )
148
        for( IClasspathEntry cpe : entries )
99
        {
149
        {
100
            if( cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER )
150
            if( cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER )
Lines 105-121 Link Here
105
                {
155
                {
106
                    for( IClasspathAttribute attr : cpe.getExtraAttributes() )
156
                    for( IClasspathAttribute attr : cpe.getExtraAttributes() )
107
                    {
157
                    {
108
                        if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY ) )
158
                        if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY ) )
109
                        {
159
                        {
110
                            return false;
160
                            return true;
111
                        }
161
                        }
112
                    }
162
                    }
113
                }
163
                }
114
            }
164
            }
115
        }
165
        }
116
        
166
        
117
        return true;
167
        return false;
118
    }
168
    }
119
    
169
    
120
    
170
    public IClasspathAttribute[] getClasspathAttributes()
171
    {
172
        final IFacetedProjectBase fproj = getFacetedProject();
173
        final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
174
        
175
        if( isIncludeWithApplicationEnabled() )
176
        {
177
            final IClasspathAttribute attr 
178
            	= JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
179
                                                  ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
180
            return new IClasspathAttribute[] { attr };
181
        }
182
        else if ( isIncludeWithApplicationSettingEnabled() )
183
        {
184
            final IClasspathAttribute attr 
185
            	= JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
186
            return new IClasspathAttribute[] { attr };
187
        }
188
        
189
        return new IClasspathAttribute[ 0 ];
190
    }
121
}
191
}
(-)j2ee_ui/org/eclipse/jst/j2ee/internal/ui/WtpOsgiBundlesLibraryProviderInstallPanel.java (-2 / +11 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.jst.j2ee.internal.ui;
12
package org.eclipse.jst.j2ee.internal.ui;
13
13
14
import static org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig.*;
14
import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
15
import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
15
import org.eclipse.jst.common.project.facet.ui.libprov.osgi.OsgiBundlesLibraryProviderInstallPanel;
16
import org.eclipse.jst.common.project.facet.ui.libprov.osgi.OsgiBundlesLibraryProviderInstallPanel;
16
import org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperationConfig;
17
import org.eclipse.jst.j2ee.internal.common.classpath.WtpOsgiBundlesLibraryProviderInstallOperationConfig;
Lines 42-47 Link Here
42
        final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
43
        final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
43
        copyOnPublishCheckBox.setText( Resources.copyLibraries );
44
        copyOnPublishCheckBox.setText( Resources.copyLibraries );
44
        copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
45
        copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
46
        copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
45
        
47
        
46
        copyOnPublishCheckBox.addSelectionListener
48
        copyOnPublishCheckBox.addSelectionListener
47
        (
49
        (
Lines 61-71 Link Here
61
                                         final Object oldValue,
63
                                         final Object oldValue,
62
                                         final Object newValue )
64
                                         final Object newValue )
63
            {
65
            {
64
                copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
66
                if( PROP_INCLUDE_WITH_APPLICATION_ENABLED.equals( property )) 
67
                {
68
                    copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
69
                }
70
                else if( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED.equals( property ) ) 
71
                {
72
                    copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
73
                }
65
            }
74
            }
66
        };
75
        };
67
        
76
        
68
        cfg.addListener( listener, WtpOsgiBundlesLibraryProviderInstallOperationConfig.PROP_INCLUDE_WITH_APPLICATION_ENABLED );
77
        cfg.addListener( listener, PROP_INCLUDE_WITH_APPLICATION_ENABLED, PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED );
69
        
78
        
70
        copyOnPublishCheckBox.addDisposeListener
79
        copyOnPublishCheckBox.addDisposeListener
71
        (
80
        (
(-)j2ee_ui/org/eclipse/jst/j2ee/internal/ui/WtpUserLibraryProviderInstallPanel.java (-2 / +11 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.jst.j2ee.internal.ui;
12
package org.eclipse.jst.j2ee.internal.ui;
13
13
14
import static org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig.*;
14
import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
15
import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
15
import org.eclipse.jst.common.project.facet.ui.libprov.user.UserLibraryProviderInstallPanel;
16
import org.eclipse.jst.common.project.facet.ui.libprov.user.UserLibraryProviderInstallPanel;
16
import org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig;
17
import org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig;
Lines 42-47 Link Here
42
        final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
43
        final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
43
        copyOnPublishCheckBox.setText( Resources.copyLibraries );
44
        copyOnPublishCheckBox.setText( Resources.copyLibraries );
44
        copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
45
        copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
46
        copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
45
        
47
        
46
        copyOnPublishCheckBox.addSelectionListener
48
        copyOnPublishCheckBox.addSelectionListener
47
        (
49
        (
Lines 61-71 Link Here
61
                                         final Object oldValue,
63
                                         final Object oldValue,
62
                                         final Object newValue )
64
                                         final Object newValue )
63
            {
65
            {
64
                copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
66
                if( PROP_INCLUDE_WITH_APPLICATION_ENABLED.equals( property )) 
67
                {
68
                    copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
69
                }
70
                else if( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED.equals( property ) ) 
71
                {
72
                    copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
73
                }
65
            }
74
            }
66
        };
75
        };
67
        
76
        
68
        cfg.addListener( listener, WtpUserLibraryProviderInstallOperationConfig.PROP_INCLUDE_WITH_APPLICATION_ENABLED );
77
        cfg.addListener( listener, PROP_INCLUDE_WITH_APPLICATION_ENABLED, PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED );
69
        
78
        
70
        copyOnPublishCheckBox.addDisposeListener
79
        copyOnPublishCheckBox.addDisposeListener
71
        (
80
        (

Return to bug 324111