diff options
author | Frank Becker | 2016-10-01 09:23:48 +0000 |
---|---|---|
committer | Frank Becker | 2016-10-03 17:09:36 +0000 |
commit | e73deec9f6c8974fcb6c787067bc7be9b8fd1b30 (patch) | |
tree | 9a724000ee4744ee9de4ea0db3673cbef72c68ed /org.eclipse.mylyn.tasks.ui | |
parent | e66f67cbe1e975a1a023515b3e1babc6f0174bff (diff) | |
download | org.eclipse.mylyn.tasks-e73deec9f6c8974fcb6c787067bc7be9b8fd1b30.tar.gz org.eclipse.mylyn.tasks-e73deec9f6c8974fcb6c787067bc7be9b8fd1b30.tar.xz org.eclipse.mylyn.tasks-e73deec9f6c8974fcb6c787067bc7be9b8fd1b30.zip |
503002: NullPointerException in TaskSelectionDialog.<init>
Change-Id: I9b8b20bac8b847aef54f13a1f59eb909b07e7356
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=503002
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java index 89feca893..44b1ccead 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java @@ -84,6 +84,8 @@ import org.eclipse.ui.forms.events.HyperlinkAdapter; import org.eclipse.ui.forms.events.HyperlinkEvent; import org.eclipse.ui.forms.widgets.ImageHyperlink; +import com.google.common.base.Strings; + /** * @author Willian Mitsuda * @author Mik Kersten @@ -283,7 +285,8 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog { elements = new HashSet<AbstractTaskContainer>(); if (selectedWorkingSet != null) { for (IAdaptable adaptable : selectedWorkingSet.getElements()) { - AbstractTaskContainer container = (AbstractTaskContainer) adaptable.getAdapter(AbstractTaskContainer.class); + AbstractTaskContainer container = (AbstractTaskContainer) adaptable + .getAdapter(AbstractTaskContainer.class); if (container != null) { elements.add(container); } @@ -444,9 +447,6 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog { setSelectionHistory(new TaskSelectionHistory()); setListLabelProvider(labelProvider); -// setListLabelProvider(new DecoratingLabelProvider(labelProvider, PlatformUI.getWorkbench() -// .getDecoratorManager() -// .getLabelDecorator())); setDetailsLabelProvider(new TaskDetailLabelProvider()); setSeparatorLabel(TaskListView.LABEL_VIEW + Messages.TaskSelectionDialog__matches); @@ -456,6 +456,7 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog { if (selection instanceof ITextSelection) { // Get only get first line String text = ((ITextSelection) selection).getText(); + text = Strings.nullToEmpty(text); int n = text.indexOf('\n'); if (n > -1) { text = text.substring(0, n); @@ -482,7 +483,7 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog { protected Control createButtonBar(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); GridLayout layout = new GridLayout(); - layout.numColumns = 0; // create + layout.numColumns = 0; // create layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); @@ -515,14 +516,14 @@ public class TaskSelectionDialog extends FilteredItemsSelectionDialog { Label filler = new Label(composite, SWT.NONE); filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); layout.numColumns++; - super.createButtonsForButtonBar(composite); // cancel button + super.createButtonsForButtonBar(composite); // cancel button return composite; } /** * Allows to add new buttons at the bottom of this dialog next to New Task button - * + * * @param parent * the parent composite to contain the button bar */ |