Author: fbricon
Date: 2011-07-20 15:38:53 -0400 (Wed, 20 Jul 2011)
New Revision: 33080
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java
trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java
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 a text box displaying the selected profiles. Fixed a few logic issues
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java 2011-07-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.core/src/org/jboss/tools/maven/core/profiles/IProfileManager.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -2,7 +2,6 @@
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.apache.maven.model.Profile;
import org.eclipse.core.runtime.CoreException;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-07-20 19:36:21
UTC (rev 33079)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2011-07-20 19:38:53
UTC (rev 33080)
@@ -13,7 +13,8 @@
org.eclipse.core.resources,
org.jboss.tools.maven.core,
org.eclipse.m2e.core.ui;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -58,16 +58,22 @@
public static String SelectProfilesDialog_autoactivated;
public static String SelectProfilesDialog_Activate_menu;
+ public static String SelectProfilesDialog_Active_Profiles_for_Project;
public static String SelectProfilesDialog_Available_profiles;
+ public static String SelectProfilesDialog_Common_profiles;
public static String SelectProfilesDialog_deactivated;
public static String SelectProfilesDialog_Deactivate_menu;
public static String SelectProfilesDialog_DeselectAll;
public static String SelectProfilesDialog_Force_update;
public static String SelectProfilesDialog_Maven_profile_selection;
+ public static String SelectProfilesDialog_Move_Down;
+ public static String SelectProfilesDialog_Move_Up;
+ public static String SelectProfilesDialog_No_Common_Profiles;
public static String SelectProfilesDialog_Offline;
public static String SelectProfilesDialog_Profile_id_header;
public static String SelectProfilesDialog_Profile_source_header;
public static String SelectProfilesDialog_Project_has_no_available_profiles;
+ public static String SelectProfilesDialog_Select_active_profiles_for_selected_projects;
public static String SelectProfilesDialog_Select_Maven_profiles;
public static String SelectProfilesDialog_Select_the_active_Maven_profiles;
public static String SelectProfilesDialog_SelectAll;
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java 2011-07-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ActiveProfilesContentProvider.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -5,7 +5,6 @@
import org.apache.maven.model.Profile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.core.MavenPlugin;
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java 2011-07-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelection.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -48,4 +48,12 @@
public void setSource(String source) {
this.source = source;
}
+
+ public String toMavenString() {
+ String s = id;
+ if (ProfileState.Disabled == activationState) {
+ s = "!"+id;
+ }
+ return s;
+ }
}
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-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileSelectionHandler.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -58,7 +58,7 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
final Set<IMavenProjectFacade> facades = getSelectedMavenProjects(event);
- if (!facades.isEmpty() ) {
+ if (facades != null && !facades.isEmpty() ) {
System.out.print("Select projects "+facades);
@@ -74,6 +74,7 @@
final SelectProfilesDialog dialog = new SelectProfilesDialog(window.getShell(),
facades,
sharedProfiles);
+ //dialog.setBlockOnOpen(false); doesn't work
if(dialog.open() == Window.OK) {
WorkspaceJob job = new WorkspaceJob(Messages.ProfileManager_Updating_maven_profiles)
{
@@ -252,7 +253,7 @@
}
Set<IMavenProjectFacade> facades = new HashSet<IMavenProjectFacade>();
for (IProject p : projects) {
- if (p != null && p.hasNature(IMavenConstants.NATURE_ID)) {
+ if (p != null && p.isAccessible() &&
p.hasNature(IMavenConstants.NATURE_ID)) {
IMavenProjectFacade facade =MavenPlugin.getMavenProjectRegistry().getProject(p);
if (facade.getMavenProject() == null) {
System.err.println(facade.getProject() + " facade has no
MavenProject!!!");
Added:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java
(rev 0)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/ProfileUtil.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -0,0 +1,27 @@
+package org.jboss.tools.maven.ui.internal.profiles;
+
+import java.util.Collection;
+
+public class ProfileUtil {
+
+ private ProfileUtil(){}
+
+ private static final String COMMA = ", ";
+
+ public static String toString(Collection<ProfileSelection> profiles) {
+ StringBuilder sb = new StringBuilder();
+ if(profiles != null && !profiles.isEmpty()) {
+ boolean addComma = false;
+ for (ProfileSelection ps : profiles) {
+ if (Boolean.TRUE.equals(ps.getSelected())) {
+ if (addComma) {
+ sb.append(COMMA);
+ }
+ sb.append(ps.toMavenString());
+ addComma = true;
+ }
+ }
+ }
+ return sb.toString();
+ }
+}
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-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-20
19:38:53 UTC (rev 33080)
@@ -10,7 +10,6 @@
************************************************************************************/
package org.jboss.tools.maven.ui.internal.profiles;
-import java.util.Collection;
import java.util.List;
import java.util.Set;
@@ -20,16 +19,16 @@
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;
import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableColorProvider;
import org.eclipse.jface.viewers.ITableFontProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.osgi.util.NLS;
@@ -63,7 +62,9 @@
private CheckboxTableViewer profileTableViewer;
private Button offlineModeBtn;
private Button forceUpdateBtn;
-
+ private ITextViewer profilesTextViewer;
+ private Label profilesText;
+
private boolean offlineMode ;
private boolean forceUpdate;
@@ -71,9 +72,18 @@
Set<IMavenProjectFacade> facades;
IMavenProjectFacade facade;
+
+
+
+
+ final Action activationAction = new ChangeProfileStateAction(ProfileState.Active);
+
+ final Action deActivationAction = new ChangeProfileStateAction(ProfileState.Disabled);
+
public SelectProfilesDialog(Shell parentShell, Set<IMavenProjectFacade> facades,
List<ProfileSelection> sharedProfiles) {
super(parentShell);
+ setShellStyle(super.getShellStyle() | SWT.RESIZE | SWT.MODELESS);
offlineMode = MavenPlugin.getMavenConfiguration().isOffline();
this.facades = facades;
if(facades.size() == 1){
@@ -88,18 +98,13 @@
shell.setText(Messages.SelectProfilesDialog_Select_Maven_profiles);
}
- /**
- * Make the dialog resizeable
- */
- protected int getShellStyle() {
- return super.getShellStyle() | SWT.RESIZE;
- }
+
@Override
protected Control createDialogArea(Composite parent) {
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);
@@ -108,7 +113,7 @@
setTitle(Messages.SelectProfilesDialog_Maven_profile_selection);
String text;
if (facade == null) {
- text = "Select the active profiles for selected projects";
+ text = Messages.SelectProfilesDialog_Select_active_profiles_for_selected_projects;
} else {
text = NLS.bind(
Messages.SelectProfilesDialog_Select_the_active_Maven_profiles,
@@ -116,18 +121,30 @@
}
setMessage(text);
+ if (facade != null) {
+
+ Label profilesLabel = new Label(container, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2,
1));
+
profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project,
facade.getProject().getName()));
+
+ profilesText = new Label(container, SWT.BORDER);
+ profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
+ profilesText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
+ updateProfilesText();
+ }
+
boolean hasProfiles = !sharedProfiles.isEmpty();
Label lblAvailable = new Label(container, SWT.NONE);
String textLabel;
if (hasProfiles) {
if (facade == null) {
- textLabel = "Common profiles for selected projects";
+ textLabel = Messages.SelectProfilesDialog_Common_profiles;
} else {
textLabel = Messages.SelectProfilesDialog_Available_profiles;
}
} else {
if (facade == null) {
- textLabel = "There are no common profiles for the selected projects";
+ textLabel = Messages.SelectProfilesDialog_No_Common_Profiles;
} else {
textLabel =
NLS.bind(Messages.SelectProfilesDialog_Project_has_no_available_profiles,
facade.getProject().getName());
@@ -140,11 +157,12 @@
if (hasProfiles) {
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 4);
- gd.heightHint = 150;
+ gd.heightHint = 200;
gd.widthHint = 500;
profileTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
Table table = profileTableViewer.getTable();
+ table.setFocus();
table.setLayoutData(gd);
table.setLinesVisible(true);
table.setHeaderVisible(true);
@@ -152,32 +170,14 @@
TableColumn profileColumn = new TableColumn(table, SWT.NONE);
profileColumn.setText(Messages.SelectProfilesDialog_Profile_id_header);
profileColumn.setWidth(350);
-
+
TableColumn sourceColumn = new TableColumn(table, SWT.NONE);
sourceColumn.setText(Messages.SelectProfilesDialog_Profile_source_header);
sourceColumn.setWidth(120);
+
- profileTableViewer
- .setContentProvider(new IStructuredContentProvider() {
+ profileTableViewer.setContentProvider(ArrayContentProvider.getInstance());
- public void inputChanged(Viewer viewer,
- Object oldInput, Object newInput) {
- // nothing to do
- }
-
- public void dispose() {
- // nothing to do
- }
-
- @SuppressWarnings("rawtypes")
- public Object[] getElements(Object input) {
- if (input instanceof Collection) {
- return ((Collection) input).toArray();
- }
- return null;
- }
- });
-
profileTableViewer.setLabelProvider(new ProfileLabelProvider(parent
.getFont()));
@@ -190,9 +190,13 @@
profileTableViewer.setGrayed(profile, false);
}
profile.setSelected(profileTableViewer.getChecked(profile));
- if (profile.getActivationState() == null) {
+ if (Boolean.FALSE.equals(profile.getSelected())
+ || profile.getActivationState() == null) {
profile.setActivationState(ProfileState.Active);
}
+
+ updateProfilesText();
+ profileTableViewer.refresh();
}
});
@@ -201,18 +205,23 @@
addSelectionButton(container, Messages.SelectProfilesDialog_SelectAll, true);
addSelectionButton(container, Messages.SelectProfilesDialog_DeselectAll, false);
-
+
offlineModeBtn = addCheckButton(container, Messages.SelectProfilesDialog_Offline,
offlineMode);
forceUpdateBtn = addCheckButton(container, Messages.SelectProfilesDialog_Force_update,
forceUpdate);
createMenu();
-
}
return area;
}
+ private void updateProfilesText() {
+ if (profilesText != null) {
+ profilesText.setText(ProfileUtil.toString(sharedProfiles));
+ }
+ }
+
private Button addCheckButton(Composite container, String label, boolean selected) {
Button checkBtn = new Button(container, SWT.CHECK);
checkBtn.setText(label);
@@ -224,7 +233,7 @@
private Button addSelectionButton(Composite container, String label, final boolean
ischecked) {
Button button = new Button(container, SWT.NONE);
- button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
+ button.setLayoutData(new GridData(SWT.FILL, SWT.UP,
false, false, 1, 1));
button.setText(label);
button.addSelectionListener(new SelectionListener() {
@@ -235,9 +244,10 @@
profile.setSelected(profileTableViewer.getChecked(profile));
if (profile.getActivationState() == null) {
- profile.setActivationState(ProfileState.Active);
+ profile.setActivationState(ProfileState.Active);
}
}
+ updateProfilesText();
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -259,8 +269,6 @@
@Override
protected void okPressed() {
if (profileTableViewer != null) {
- //Object[] obj = profileTableViewer.getCheckedElements();
- //for (int i = 0; i < obj.length; i++) {}
offlineMode = offlineModeBtn.getSelection();
forceUpdate = forceUpdateBtn.getSelection();
}
@@ -286,45 +294,13 @@
}
}
- final Action activationAction = new Action("") { //$NON-NLS-1$
- @Override
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) profileTableViewer
- .getSelection();
- if (!selection.isEmpty()) {
- final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- entry.setActivationState(ProfileState.Active);
- profileTableViewer.setChecked(entry, true);
- profileTableViewer.setGrayed(entry, false);
- profileTableViewer.refresh();
- }
- super.run();
- }
- };
- final Action deActivationAction = new Action("") { //$NON-NLS-1$
- @Override
- public void run() {
- IStructuredSelection selection = (IStructuredSelection) profileTableViewer
- .getSelection();
- if (!selection.isEmpty()) {
- final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- entry.setActivationState(ProfileState.Disabled);
- profileTableViewer.setChecked(entry, true);
- profileTableViewer.setGrayed(entry, false);
- profileTableViewer.refresh();
- }
- super.run();
- }
- };
-
-
public void menuAboutToShow(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) profileTableViewer
.getSelection();
if (!selection.isEmpty()) {
final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
- String text = "";
+ String text = ""; //$NON-NLS-1$
ProfileState state = entry.getActivationState();
if ( state == null || state.equals(ProfileState.Disabled)) {
text = Messages.SelectProfilesDialog_Activate_menu;
@@ -347,6 +323,146 @@
return forceUpdate;
}
+
+ /* TODO add content assist to the profiles input text
+ private ITextViewer createTextInput(Composite container) {
+ ITextViewer textViewer = new TextViewer(container, SWT.BORDER | SWT.FILL);
+ textViewer.setDocument(new Document());
+ final ContentAssistant contentAssistant = new ContentAssistant();
+ contentAssistant.enableAutoActivation(true);
+ contentAssistant.setAutoActivationDelay(100);
+ contentAssistant.enableAutoInsert(true);
+ contentAssistant.setContentAssistProcessor(new
ProfileContentAssistProcessor(sharedProfiles),
+ IDocument.DEFAULT_CONTENT_TYPE);
+
+ textViewer.getTextWidget().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyPressed(KeyEvent e) {
+ if ( (e.character == ' ') && ((e.stateMask & SWT.CTRL)
!= 0) ) {
+ contentAssistant.showPossibleCompletions();
+ }
+ }
+ });
+
+
+ contentAssistant.install(textViewer );
+ return textViewer;
+ }
+
+ private final class ProfileContentAssistProcessor implements
+ IContentAssistProcessor {
+
+ private List<String> profileIds;
+
+ public ProfileContentAssistProcessor(
+ List<ProfileSelection> possibleProfiles) {
+ assert possibleProfiles != null;
+ profileIds = new ArrayList<String>(possibleProfiles.size());
+ for (ProfileSelection ps : possibleProfiles) {
+ profileIds.add(ps.getId());
+ }
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return new char[]{','};
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int documentOffset) {
+ IDocument document = viewer.getDocument();
+ int currOffset = documentOffset -1;
+ ICompletionProposal[] proposals = null;
+ try {
+ String currentWord = getCurrentWord(document, currOffset);
+ System.err.println(currOffset + " - Current word "+currentWord);
//$NON-NLS-1$
+
+ int currentWordLength = currentWord.length();
+ List<ICompletionProposal> suggestions = new
ArrayList<ICompletionProposal>(profileIds.size());
+ for (String id : profileIds) {
+ if (!id.startsWith(currentWord)) {
+ continue;
+ }
+
+ ICompletionProposal proposal = new CompletionProposal(id,
+ documentOffset - currentWordLength,
+ currentWordLength,
+ id.length());
+
+ suggestions.add(proposal);
+ }
+ if (!suggestions.isEmpty()) {
+ proposals = new ICompletionProposal[suggestions.size()];
+ suggestions.toArray(proposals);
+ }
+ } catch (BadLocationException e) {
+ System.err.println(e);
+ }
+ return proposals;
+ }
+
+
+ private String getCurrentWord(IDocument document, int currOffset)
+ throws BadLocationException {
+ StringBuilder currWord = new StringBuilder();
+ char currChar;
+
+ while (currOffset > -1
+ && !Character.isWhitespace(currChar = document
+ .getChar(currOffset))
+ && ',' != currChar) {
+ currWord.insert(0, currChar);
+ currOffset--;
+ }
+ return currWord.toString();
+ }
+ }
+ */
+
+ private class ChangeProfileStateAction extends Action {
+
+ private final ProfileState state;
+
+ public ChangeProfileStateAction(ProfileState state) {
+ this.state = state;
+ }
+
+ @Override
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection) profileTableViewer
+ .getSelection();
+ if (!selection.isEmpty()) {
+ final ProfileSelection entry = (ProfileSelection) selection.getFirstElement();
+ entry.setActivationState(state);
+ profileTableViewer.setChecked(entry, true);
+ profileTableViewer.setGrayed(entry, false);
+ if (ProfileState.Disabled.equals(state)) {
+ entry.setSelected(true);
+ }
+ updateProfilesText();
+ profileTableViewer.refresh();
+ }
+ super.run();
+ }
+ }
+
private class ProfileLabelProvider extends LabelProvider implements
ITableLabelProvider, ITableFontProvider, ITableColorProvider {
@@ -397,7 +513,7 @@
text.append(entry.getId());
ProfileState state = entry.getActivationState();
- if (state == ProfileState.Disabled) {
+ if (Boolean.TRUE.equals(entry.getSelected()) && state ==
ProfileState.Disabled) {
text.append(Messages.SelectProfilesDialog_deactivated);
} else if (Boolean.TRUE.equals(entry.getAutoActive())) {
text.append(Messages.SelectProfilesDialog_autoactivated);
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-20
19:36:21 UTC (rev 33079)
+++
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-20
19:38:53 UTC (rev 33080)
@@ -36,17 +36,23 @@
ConfiguratorPreferencePage_When_importing_Maven_projects_configure_the_following=When
importing Maven projects configure the following:
ProfileManager_Updating_maven_profiles=Updating maven profiles
SelectProfilesDialog_Activate_menu=Activate {0}
+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_Deactivate_menu=Deactivate {0}
SelectProfilesDialog_deactivated=\ (deactivated)
SelectProfilesDialog_DeselectAll=Deselect all
SelectProfilesDialog_Force_update=Force update
SelectProfilesDialog_Maven_profile_selection=Maven Profile selection
+SelectProfilesDialog_Move_Down=Move Down
+SelectProfilesDialog_Move_Up=Move Up
+SelectProfilesDialog_No_Common_Profiles=There are no common profiles for the selected
projects.
SelectProfilesDialog_Offline=Offline
SelectProfilesDialog_Profile_id_header=Profile id
SelectProfilesDialog_Profile_source_header=Source
SelectProfilesDialog_Project_has_no_available_profiles=Project {0} has no available
profiles
+SelectProfilesDialog_Select_active_profiles_for_selected_projects=Select the active Maven
profiles for selected projects. Right-click to (de)activate a profile.
SelectProfilesDialog_Select_Maven_profiles=Select Maven profiles
SelectProfilesDialog_Select_the_active_Maven_profiles=Select the active Maven profiles
for project {0}. Right-click to (de)activate a profile.
SelectProfilesDialog_SelectAll=Select All