Author: fbricon
Date: 2011-07-21 14:46:03 -0400 (Thu, 21 Jul 2011)
New Revision: 33108
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
Log:
JBIDE-8969 : added subprogress monitors for each project being updated. Also added some
text about specific project profiles not being affected by the profile selection.
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java 2011-07-21
16:56:07 UTC (rev 33107)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java 2011-07-21
18:46:03 UTC (rev 33108)
@@ -28,7 +28,9 @@
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -92,14 +94,17 @@
public IStatus runInWorkspace(IProgressMonitor monitor) {
try {
-
+ SubMonitor progress = SubMonitor.convert(monitor,
Messages.ProfileManager_Updating_maven_profiles, 100);
+ SubMonitor subProgress = SubMonitor.convert(progress.newChild(5),
allProfiles.size() * 100);
for (Map.Entry<IMavenProjectFacade, List<ProfileStatus>> entry :
allProfiles.entrySet()){
-
+ if(progress.isCanceled()) {
+ throw new OperationCanceledException();
+ }
IMavenProjectFacade facade = entry.getKey();
List<String> activeProfiles = getActiveProfiles(sharedProfiles,
entry.getValue());
profileManager.updateActiveProfiles(facade, activeProfiles,
- dialog.isOffline(), dialog.isForceUpdate(), monitor);
+ dialog.isOffline(), dialog.isForceUpdate(), subProgress.newChild(100));
}
} catch (CoreException ex) {
Activator.log(ex);
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-21
16:56:07 UTC (rev 33107)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-21
18:46:03 UTC (rev 33108)
@@ -19,7 +19,6 @@
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
@@ -106,6 +105,7 @@
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setEnabled(true);
+
GridLayout layout = new GridLayout(2, false);
layout.marginLeft = 12;
container.setLayout(layout);
@@ -137,11 +137,16 @@
}
boolean hasProfiles = !sharedProfiles.isEmpty();
+ //Label warningLabel = new Label(container, SWT.CENTER);
+ //warningLabel.setVisible(false);
Label lblAvailable = new Label(container, SWT.NONE);
String textLabel;
+
if (hasProfiles) {
if (facade == null) {
textLabel = Messages.SelectProfilesDialog_Common_profiles;
+ //warningLabel.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING));
+ //warningLabel.setVisible(true);
} else {
textLabel = Messages.SelectProfilesDialog_Available_profiles;
}
@@ -154,7 +159,7 @@
}
}
lblAvailable.setText(textLabel);
- lblAvailable.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true,
+ lblAvailable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
false, 2, 1));
if (hasProfiles) {
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-21
16:56:07 UTC (rev 33107)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-21
18:46:03 UTC (rev 33108)
@@ -42,7 +42,7 @@
SelectProfilesDialog_Active_Profiles_for_Project=Active profiles for {0} :
SelectProfilesDialog_autoactivated=\ (auto activated)
SelectProfilesDialog_Available_profiles=Available profiles
-SelectProfilesDialog_Common_profiles=Common profiles for selected projects
+SelectProfilesDialog_Common_profiles=Common profiles for selected projects. Profiles
specific to each project will not be affected.
SelectProfilesDialog_Deactivate_menu=Deactivate {0}
SelectProfilesDialog_deactivated=\ (deactivated)
SelectProfilesDialog_DeselectAll=Deselect all
Show replies by date