Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2010-09-28 16:24:49 -0400
committerpfullbright2010-09-28 16:24:49 -0400
commit616188beafa4ac7996dd85fed14edd3c81b6eeee (patch)
treeb396ce3cb07770ae7f97208a082e981abafd956f
parent7b96e4dd786aee79c43a5f0a1da84f78f48bd9b2 (diff)
downloadwebtools.dali-616188beafa4ac7996dd85fed14edd3c81b6eeee.tar.gz
webtools.dali-616188beafa4ac7996dd85fed14edd3c81b6eeee.tar.xz
webtools.dali-616188beafa4ac7996dd85fed14edd3c81b6eeee.zip
temp bug 324111 workaround
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.java179
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperationConfig.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.properties10
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.properties10
7 files changed, 621 insertions, 0 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.java
new file mode 100644
index 0000000000..37082b3f79
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.libprov;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
+import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderFramework;
+import org.eclipse.jst.common.project.facet.core.libprov.osgi.OsgiBundlesContainer;
+import org.eclipse.jst.common.project.facet.core.libprov.osgi.OsgiBundlesLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
+import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+
+
+public class TempWtpOsgiBundlesLibraryProviderInstallOperationConfig
+ extends OsgiBundlesLibraryProviderInstallOperationConfig {
+
+ private static final IProjectFacet WEB_FACET
+ = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
+
+ private static final String CLASS_NAME
+ = TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.class.getName();
+
+ public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED
+ = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
+
+ private boolean includeWithApplicationEnabled;
+
+ public static final String PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED
+ = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_SETTING_ENABLED"; //$NON-NLS-1$
+
+ private boolean includeWithApplicationSettingEnabled;
+
+ public boolean isIncludeWithApplicationEnabled()
+ {
+ return this.includeWithApplicationEnabled;
+ }
+
+ public void setIncludeWithApplicationEnabled( final boolean value )
+ {
+ final boolean oldValue = this.includeWithApplicationEnabled;
+ this.includeWithApplicationEnabled = value;
+ notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplicationEnabled );
+ }
+
+ public boolean isIncludeWithApplicationSettingEnabled()
+ {
+ return this.includeWithApplicationSettingEnabled;
+ }
+
+ public void setIncludeWithApplicationSettingEnabled( final boolean value )
+ {
+ final boolean oldValue = this.includeWithApplicationSettingEnabled;
+ this.includeWithApplicationSettingEnabled = value;
+ notifyListeners( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED, oldValue, this.includeWithApplicationSettingEnabled );
+ }
+
+ @Override
+ public synchronized void init( final IFacetedProjectBase fproj,
+ final IProjectFacetVersion fv,
+ final ILibraryProvider provider )
+ {
+ super.init( fproj, fv, provider );
+
+ this.includeWithApplicationEnabled = isModuleFaceted( fproj );
+
+ final IProject project = fproj.getProject();
+
+ if( project != null )
+ {
+ final IProjectFacet f = fv.getProjectFacet();
+
+ final ILibraryProvider currentProvider
+ = LibraryProviderFramework.getCurrentProvider( project, f );
+
+ if( currentProvider == provider )
+ {
+ this.includeWithApplicationEnabled = getIncludeWithApplicationSetting( project, f);
+ }
+ }
+
+ this.includeWithApplicationSettingEnabled
+ = ( this.includeWithApplicationEnabled ) ? true : isModuleFaceted( fproj );
+
+ IFacetedProjectListener listener = new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ final boolean moduleFaceted = isModuleFaceted( event.getWorkingCopy() );
+ setIncludeWithApplicationEnabled( moduleFaceted );
+ setIncludeWithApplicationSettingEnabled( moduleFaceted );
+ }
+ };
+
+ fproj.addListener( listener, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED );
+ }
+
+ protected boolean isModuleFaceted( final IFacetedProjectBase fproj ) {
+ for( IProjectFacetVersion facetVersion : fproj.getProjectFacets() )
+ {
+ if( ProjectFacetsManager.getGroup( "modules" ).getMembers().contains( facetVersion ) ) //$NON-NLS-1$
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static boolean getIncludeWithApplicationSetting( final IProject proj, final IProjectFacet f )
+ {
+ final IPath path = OsgiBundlesContainer.CONTAINER_PATH.append( f.getId() );
+ final IJavaProject jproj = JavaCore.create( proj );
+
+ try
+ {
+ for( IClasspathEntry cpe : jproj.getRawClasspath() )
+ {
+ if( path.equals( cpe.getPath() ) )
+ {
+ for( IClasspathAttribute attr : cpe.getExtraAttributes() )
+ {
+ if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY ) )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ catch( CoreException e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ return false;
+ }
+
+ @Override
+ public IClasspathAttribute[] getClasspathAttributes()
+ {
+ final IFacetedProjectBase fproj = getFacetedProject();
+ final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
+
+ if( isIncludeWithApplicationEnabled() )
+ {
+ final IClasspathAttribute attr
+ = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
+ ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
+ return new IClasspathAttribute[] { attr };
+ }
+ else if ( isIncludeWithApplicationSettingEnabled() )
+ {
+ final IClasspathAttribute attr
+ = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
+ return new IClasspathAttribute[] { attr };
+ }
+
+ return new IClasspathAttribute[ 0 ];
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperation.java
new file mode 100644
index 0000000000..25d6676876
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperation.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.libprov;
+
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperation;
+import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
+
+
+public class TempWtpUserLibraryProviderInstallOperation
+ extends UserLibraryProviderInstallOperation {
+
+ @Override
+ protected IClasspathEntry createClasspathEntry( final UserLibraryProviderInstallOperationConfig config,
+ final String libraryName )
+ {
+ final TempWtpUserLibraryProviderInstallOperationConfig cfg
+ = (TempWtpUserLibraryProviderInstallOperationConfig) config;
+
+ IClasspathEntry cpe = super.createClasspathEntry( cfg, libraryName );
+ cpe = JavaCore.newContainerEntry( cpe.getPath(), null, cfg.getClasspathAttributes(), false );
+
+ return cpe;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperationConfig.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperationConfig.java
new file mode 100644
index 0000000000..868444895b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/libprov/TempWtpUserLibraryProviderInstallOperationConfig.java
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.libprov;
+
+import java.util.List;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathAttribute;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jst.common.project.facet.core.internal.ClasspathUtil;
+import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
+import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderFramework;
+import org.eclipse.jst.common.project.facet.core.libprov.user.UserLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.j2ee.classpathdep.ClasspathDependencyUtil;
+import org.eclipse.jst.j2ee.classpathdep.IClasspathDependencyConstants;
+import org.eclipse.jst.j2ee.internal.common.classpath.WtpUserLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
+import org.eclipse.wst.common.project.facet.core.IFacetedProjectBase;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
+import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
+
+
+public class TempWtpUserLibraryProviderInstallOperationConfig
+ extends UserLibraryProviderInstallOperationConfig {
+
+ private static final IProjectFacet WEB_FACET
+ = ProjectFacetsManager.getProjectFacet( IJ2EEFacetConstants.DYNAMIC_WEB );
+
+ private static final String CLASS_NAME
+ = TempWtpUserLibraryProviderInstallOperationConfig.class.getName();
+
+ public static final String PROP_INCLUDE_WITH_APPLICATION_ENABLED
+ = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_ENABLED"; //$NON-NLS-1$
+
+ private boolean includeWithApplicationEnabled;
+
+ public static final String PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED
+ = CLASS_NAME + ".INCLUDE_WITH_APPLICATION_SETTING_ENABLED"; //$NON-NLS-1$
+
+ private boolean includeWithApplicationSettingEnabled;
+
+ public boolean isIncludeWithApplicationEnabled()
+ {
+ return this.includeWithApplicationEnabled;
+ }
+
+ public void setIncludeWithApplicationEnabled( final boolean value )
+ {
+ final boolean oldValue = this.includeWithApplicationEnabled;
+ this.includeWithApplicationEnabled = value;
+ notifyListeners( PROP_INCLUDE_WITH_APPLICATION_ENABLED, oldValue, this.includeWithApplicationEnabled );
+ }
+
+ public boolean isIncludeWithApplicationSettingEnabled()
+ {
+ return this.includeWithApplicationSettingEnabled;
+ }
+
+ public void setIncludeWithApplicationSettingEnabled( final boolean value )
+ {
+ final boolean oldValue = this.includeWithApplicationSettingEnabled;
+ this.includeWithApplicationSettingEnabled = value;
+ notifyListeners( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED, oldValue, this.includeWithApplicationSettingEnabled );
+ }
+
+ @Override
+ public synchronized void init( final IFacetedProjectBase fproj,
+ final IProjectFacetVersion fv,
+ final ILibraryProvider provider )
+ {
+ super.init( fproj, fv, provider );
+
+ this.includeWithApplicationEnabled = isModuleFaceted( fproj );
+
+ final IProject project = fproj.getProject();
+
+ if( project != null )
+ {
+ final IProjectFacet f = fv.getProjectFacet();
+
+ final ILibraryProvider currentProvider
+ = LibraryProviderFramework.getCurrentProvider( project, f );
+
+ if( currentProvider == provider )
+ {
+ this.includeWithApplicationEnabled = getIncludeWithApplicationSetting( project, f);
+ }
+ }
+
+ this.includeWithApplicationSettingEnabled
+ = ( this.includeWithApplicationEnabled ) ? true : isModuleFaceted( fproj );
+
+ IFacetedProjectListener listener = new IFacetedProjectListener()
+ {
+ public void handleEvent( final IFacetedProjectEvent event )
+ {
+ final boolean moduleFaceted = isModuleFaceted( event.getWorkingCopy() );
+ setIncludeWithApplicationEnabled( moduleFaceted );
+ setIncludeWithApplicationSettingEnabled( moduleFaceted );
+ }
+ };
+
+ fproj.addListener( listener, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED );
+ }
+
+ protected boolean isModuleFaceted( final IFacetedProjectBase fproj ) {
+ for( IProjectFacetVersion facetVersion : fproj.getProjectFacets() )
+ {
+ if( ProjectFacetsManager.getGroup( "modules" ).getMembers().contains( facetVersion ) ) //$NON-NLS-1$
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private static boolean getIncludeWithApplicationSetting( final IProject proj, final IProjectFacet f )
+ {
+ final List<IClasspathEntry> entries;
+
+ try
+ {
+ entries = ClasspathUtil.getClasspathEntries( proj, f );
+ }
+ catch( CoreException e )
+ {
+ throw new RuntimeException( e );
+ }
+
+ for( IClasspathEntry cpe : entries )
+ {
+ if( cpe.getEntryKind() == IClasspathEntry.CPE_CONTAINER )
+ {
+ final IPath path = cpe.getPath();
+
+ if( path.segmentCount() >= 2 && path.segment( 0 ).equals( JavaCore.USER_LIBRARY_CONTAINER_ID ) )
+ {
+ for( IClasspathAttribute attr : cpe.getExtraAttributes() )
+ {
+ if( attr.getName().equals( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY ) )
+ {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public IClasspathAttribute[] getClasspathAttributes()
+ {
+ final IFacetedProjectBase fproj = getFacetedProject();
+ final boolean isWebProject = fproj.hasProjectFacet( WEB_FACET );
+
+ if( isIncludeWithApplicationEnabled() )
+ {
+ final IClasspathAttribute attr
+ = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_DEPENDENCY,
+ ClasspathDependencyUtil.getDefaultRuntimePath( isWebProject ).toString() );
+ return new IClasspathAttribute[] { attr };
+ }
+ else if ( isIncludeWithApplicationSettingEnabled() )
+ {
+ final IClasspathAttribute attr
+ = JavaCore.newClasspathAttribute( IClasspathDependencyConstants.CLASSPATH_COMPONENT_NON_DEPENDENCY, "" ); //$NON-NLS-1$
+ return new IClasspathAttribute[] { attr };
+ }
+
+ return new IClasspathAttribute[ 0 ];
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.java
new file mode 100644
index 0000000000..f67f4bcf70
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.libprov;
+
+import static org.eclipse.jpt.core.internal.libprov.TempWtpOsgiBundlesLibraryProviderInstallOperationConfig.*;
+import org.eclipse.jpt.core.internal.libprov.TempWtpOsgiBundlesLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
+import org.eclipse.jst.common.project.facet.ui.libprov.osgi.OsgiBundlesLibraryProviderInstallPanel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+
+public class TempWtpOsgiBundlesLibraryProviderInstallPanel
+ extends OsgiBundlesLibraryProviderInstallPanel
+
+{
+ @Override
+ protected Control createFooter( final Composite composite )
+ {
+ final TempWtpOsgiBundlesLibraryProviderInstallOperationConfig cfg
+ = (TempWtpOsgiBundlesLibraryProviderInstallOperationConfig) getOperationConfig();
+
+ final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
+ copyOnPublishCheckBox.setText( Resources.copyLibraries );
+ copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
+ copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
+
+ copyOnPublishCheckBox.addSelectionListener
+ (
+ new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected( final SelectionEvent event )
+ {
+ cfg.setIncludeWithApplicationEnabled( copyOnPublishCheckBox.getSelection() );
+ }
+ }
+ );
+
+ final IPropertyChangeListener listener = new IPropertyChangeListener()
+ {
+ public void propertyChanged( final String property,
+ final Object oldValue,
+ final Object newValue )
+ {
+ if( PROP_INCLUDE_WITH_APPLICATION_ENABLED.equals( property ))
+ {
+ copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
+ }
+ else if( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED.equals( property ) )
+ {
+ copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
+ }
+ }
+ };
+
+ cfg.addListener( listener, PROP_INCLUDE_WITH_APPLICATION_ENABLED, PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED );
+
+ copyOnPublishCheckBox.addDisposeListener
+ (
+ new DisposeListener()
+ {
+ public void widgetDisposed( final DisposeEvent event )
+ {
+ cfg.removeListener( listener );
+ }
+ }
+ );
+
+ return copyOnPublishCheckBox;
+ }
+
+ private static final class Resources
+
+ extends NLS
+
+ {
+ public static String copyLibraries;
+
+ static
+ {
+ initializeMessages( TempWtpOsgiBundlesLibraryProviderInstallPanel.class.getName(),
+ Resources.class );
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.properties b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.properties
new file mode 100644
index 0000000000..b1b8fed5c4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpOsgiBundlesLibraryProviderInstallPanel.properties
@@ -0,0 +1,10 @@
+###############################################################################
+# Copyright (c) 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Oracle - initial API and implementation
+###############################################################################
+copyLibraries = &Include libraries with this application
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.java
new file mode 100644
index 0000000000..fe2aa374d6
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.ui.internal.libprov;
+
+import static org.eclipse.jpt.core.internal.libprov.TempWtpUserLibraryProviderInstallOperationConfig.*;
+import org.eclipse.jpt.core.internal.libprov.TempWtpUserLibraryProviderInstallOperationConfig;
+import org.eclipse.jst.common.project.facet.core.libprov.IPropertyChangeListener;
+import org.eclipse.jst.common.project.facet.ui.libprov.user.UserLibraryProviderInstallPanel;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * @author <a href="mailto:konstantin.komissarchik@oracle.com">Konstantin Komissarchik</a>
+ */
+
+public class TempWtpUserLibraryProviderInstallPanel
+
+ extends UserLibraryProviderInstallPanel
+
+{
+ @Override
+ protected Control createControlNextToManageHyperlink( final Composite composite )
+ {
+ final TempWtpUserLibraryProviderInstallOperationConfig cfg
+ = (TempWtpUserLibraryProviderInstallOperationConfig) getOperationConfig();
+
+ final Button copyOnPublishCheckBox = new Button( composite, SWT.CHECK );
+ copyOnPublishCheckBox.setText( Resources.copyLibraries );
+ copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
+ copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
+
+ copyOnPublishCheckBox.addSelectionListener
+ (
+ new SelectionAdapter()
+ {
+ @Override
+ public void widgetSelected( final SelectionEvent event )
+ {
+ cfg.setIncludeWithApplicationEnabled( copyOnPublishCheckBox.getSelection() );
+ }
+ }
+ );
+
+ final IPropertyChangeListener listener = new IPropertyChangeListener()
+ {
+ public void propertyChanged( final String property,
+ final Object oldValue,
+ final Object newValue )
+ {
+ if( PROP_INCLUDE_WITH_APPLICATION_ENABLED.equals( property ))
+ {
+ copyOnPublishCheckBox.setSelection( cfg.isIncludeWithApplicationEnabled() );
+ }
+ else if( PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED.equals( property ) )
+ {
+ copyOnPublishCheckBox.setEnabled( cfg.isIncludeWithApplicationSettingEnabled() );
+ }
+ }
+ };
+
+ cfg.addListener( listener, PROP_INCLUDE_WITH_APPLICATION_ENABLED, PROP_INCLUDE_WITH_APPLICATION_SETTING_ENABLED );
+
+ copyOnPublishCheckBox.addDisposeListener
+ (
+ new DisposeListener()
+ {
+ public void widgetDisposed( final DisposeEvent event )
+ {
+ cfg.removeListener( listener );
+ }
+ }
+ );
+
+ return copyOnPublishCheckBox;
+ }
+
+ private static final class Resources
+
+ extends NLS
+
+ {
+ public static String copyLibraries;
+
+ static
+ {
+ initializeMessages( TempWtpUserLibraryProviderInstallPanel.class.getName(),
+ Resources.class );
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.properties b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.properties
new file mode 100644
index 0000000000..b1b8fed5c4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/libprov/TempWtpUserLibraryProviderInstallPanel.properties
@@ -0,0 +1,10 @@
+###############################################################################
+# Copyright (c) 2010 Oracle. All rights reserved.
+# This program and the accompanying materials are made available under the
+# terms of the Eclipse Public License v1.0, which accompanies this distribution
+# and is available at http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# Oracle - initial API and implementation
+###############################################################################
+copyLibraries = &Include libraries with this application

Back to the top