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

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java (-40 / +37 lines)
Lines 66-71 Link Here
66
import org.eclipse.swt.events.ModifyListener;
66
import org.eclipse.swt.events.ModifyListener;
67
import org.eclipse.swt.events.SelectionAdapter;
67
import org.eclipse.swt.events.SelectionAdapter;
68
import org.eclipse.swt.events.SelectionEvent;
68
import org.eclipse.swt.events.SelectionEvent;
69
import org.eclipse.swt.graphics.Point;
69
import org.eclipse.swt.graphics.Rectangle;
70
import org.eclipse.swt.graphics.Rectangle;
70
import org.eclipse.swt.layout.GridData;
71
import org.eclipse.swt.layout.GridData;
71
import org.eclipse.swt.layout.GridLayout;
72
import org.eclipse.swt.layout.GridLayout;
Lines 342-348 Link Here
342
		setControl(control);
343
		setControl(control);
343
		PlatformUI.getWorkbench().getHelpSystem().setHelp(control, BugzillaUiPlugin.SEARCH_PAGE_CONTEXT);
344
		PlatformUI.getWorkbench().getHelpSystem().setHelp(control, BugzillaUiPlugin.SEARCH_PAGE_CONTEXT);
344
		restoreBounds();
345
		restoreBounds();
345
		getControl().getShell().pack();
346
	}
346
	}
347
347
348
	private void createButtons(Composite control) {
348
	private void createButtons(Composite control) {
Lines 1048-1092 Link Here
1048
	public void setVisible(boolean visible) {
1048
	public void setVisible(boolean visible) {
1049
		if (visible && summaryPattern != null) {
1049
		if (visible && summaryPattern != null) {
1050
			if (firstTime) {
1050
			if (firstTime) {
1051
				// Set<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getRepositories(BugzillaCorePlugin.REPOSITORY_KIND);
1052
				// String[] repositoryUrls = new String[repositories.size()];
1053
				// int i = 0;
1054
				// int indexToSelect = 0;
1055
				// for (Iterator<TaskRepository> iter = repositories.iterator(); iter.hasNext();) {
1056
				// TaskRepository currRepsitory = iter.next();
1057
				// // if (i == 0 && repository == null) {
1058
				// // repository = currRepsitory;
1059
				// // indexToSelect = 0;
1060
				// // }
1061
				// if (repository != null && repository.equals(currRepsitory)) {
1062
				// indexToSelect = i;
1063
				// }
1064
				// repositoryUrls[i] = currRepsitory.getUrl();
1065
				// i++;
1066
				// }
1067
1068
				// IDialogSettings settings = getDialogSettings();
1069
				// if (repositoryCombo != null) {
1070
				// repositoryCombo.setItems(repositoryUrls);
1071
				// if (repositoryUrls.length == 0) {
1072
				// MessageDialog.openInformation(Display.getCurrent().getActiveShell(), IBugzillaConstants.TITLE_MESSAGE_DIALOG,
1073
				// TaskRepositoryManager.MESSAGE_NO_REPOSITORY);
1074
				// } else {
1075
				// String selectRepo = settings.get(STORE_REPO_ID);
1076
				// if (selectRepo != null && repositoryCombo.indexOf(selectRepo) > -1) {
1077
				// repositoryCombo.setText(selectRepo);
1078
				// repository = TasksUiPlugin.getRepositoryManager().getRepository(
1079
				// BugzillaCorePlugin.REPOSITORY_KIND, repositoryCombo.getText());
1080
				// if (repository == null) {
1081
				// repository = TasksUiPlugin.getRepositoryManager().getDefaultRepository( BugzillaCorePlugin.REPOSITORY_KIND);
1082
				// }
1083
				// } else {
1084
				// repositoryCombo.select(indexToSelect);
1085
				// }
1086
				// updateAttributesFromRepository(repositoryCombo.getText(), null, false);
1087
				// }
1088
				// }
1089
1090
				firstTime = false;
1051
				firstTime = false;
1091
				// Set item and text here to prevent page from resizing
1052
				// Set item and text here to prevent page from resizing
1092
				for (String searchPattern : getPreviousPatterns(previousSummaryPatterns)) {
1053
				for (String searchPattern : getPreviousPatterns(previousSummaryPatterns)) {
Lines 1153-1159 Link Here
1153
					restoreWidgetValues();
1114
					restoreWidgetValues();
1154
				}
1115
				}
1155
			}
1116
			}
1117
			if ((commentPattern.getText() != null && !commentPattern.getText().equals("")) || // //$NON-NLS-1$
1118
					(emailPattern2.getText() != null && !emailPattern2.getText().equals("")) || // //$NON-NLS-1$
1119
					(keywords.getText() != null && !keywords.getText().equals("")) || // //$NON-NLS-1$
1120
					priority.getSelection().length > 0 || resolution.getSelection().length > 0
1121
					|| version.getSelection().length > 0 || target.getSelection().length > 0
1122
					|| hardware.getSelection().length > 0 || os.getSelection().length > 0) {
1123
				moreOptionsExpandComposite.setExpanded(true);
1124
			}
1156
			setPageComplete(isPageComplete());
1125
			setPageComplete(isPageComplete());
1126
			Point oldSize = getControl().getSize();
1127
			Point newSize = getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
1128
			resizeDialogIfNeeded(oldSize, newSize);
1129
1157
			if (getWizard() == null) {
1130
			if (getWizard() == null) {
1158
				// TODO: wierd check
1131
				// TODO: wierd check
1159
				summaryPattern.setFocus();
1132
				summaryPattern.setFocus();
Lines 2061-2064 Link Here
2061
		super.dispose();
2034
		super.dispose();
2062
	}
2035
	}
2063
2036
2037
	private void resizeDialogIfNeeded(Point oldSize, Point newSize) {
2038
		if (oldSize == null || newSize == null) {
2039
			return;
2040
		}
2041
		Shell shell = getShell();
2042
		Point shellSize = shell.getSize();
2043
		if (mustResize(oldSize, newSize)) {
2044
			if (newSize.x > oldSize.x) {
2045
				shellSize.x += (newSize.x - oldSize.x);
2046
			}
2047
			if (newSize.y > oldSize.y) {
2048
				shellSize.y += (newSize.y - oldSize.y);
2049
			} else {
2050
				shellSize.y -= (oldSize.y - newSize.y);
2051
			}
2052
			shell.setSize(shellSize);
2053
			shell.layout(true);
2054
		}
2055
	}
2056
2057
	private boolean mustResize(Point currentSize, Point newSize) {
2058
		return currentSize.x < newSize.x || currentSize.y != newSize.y;
2059
	}
2060
2064
}
2061
}

Return to bug 305687