Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 125846 Details for
Bug 242445
[api] update layout of repository settings page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
updated patch
clipboard.txt (text/plain), 55.91 KB, created by
Steffen Pingel
on 2009-02-16 21:14:51 EST
(
hide
)
Description:
updated patch
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2009-02-16 21:14:51 EST
Size:
55.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/wizards/TaskRepositoryWizardDialog.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskRepositoryWizardDialog.java,v >retrieving revision 1.2 >diff -u -r1.2 TaskRepositoryWizardDialog.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/TaskRepositoryWizardDialog.java 2 Feb 2009 05:39:30 -0000 1.2 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/TaskRepositoryWizardDialog.java 17 Feb 2009 02:17:03 -0000 >@@ -72,7 +72,7 @@ > > validateServerButton = createButton(composite, VALIDATE_BUTTON_ID, > Messages.AbstractRepositorySettingsPage_Validate_Settings, false); >- validateServerButton.setImage(CommonImages.getImage(TasksUiImages.REPOSITORY_SYNCHRONIZE_SMALL)); >+ validateServerButton.setImage(CommonImages.getImage(TasksUiImages.REPOSITORY_VALIDATE)); > validateServerButton.setVisible(false); > setButtonLayoutData(validateServerButton); > Label filler = new Label(composite, SWT.NONE); >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java,v >retrieving revision 1.66 >diff -u -r1.66 AbstractRepositorySettingsPage.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 29 Jan 2009 23:32:44 -0000 1.66 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 17 Feb 2009 02:17:03 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2008 Tasktop Technologies and others. >+ * Copyright (c) 2004, 2008 Tasktop Technologies and others. > * 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 >@@ -8,6 +8,7 @@ > * Contributors: > * Tasktop Technologies - initial API and implementation > * Frank Becker - improvements >+ * Helen Bershadskaya - improvements for bug 242445 > *******************************************************************************/ > > package org.eclipse.mylyn.tasks.ui.wizards; >@@ -50,7 +51,6 @@ > import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; >-import org.eclipse.swt.layout.FillLayout; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Button; >@@ -60,12 +60,11 @@ > import org.eclipse.swt.widgets.Text; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.dialogs.PreferencesUtil; >-import org.eclipse.ui.forms.events.ExpansionAdapter; >-import org.eclipse.ui.forms.events.ExpansionEvent; > import org.eclipse.ui.forms.events.HyperlinkAdapter; > import org.eclipse.ui.forms.events.HyperlinkEvent; > import org.eclipse.ui.forms.events.IHyperlinkListener; > import org.eclipse.ui.forms.widgets.ExpandableComposite; >+import org.eclipse.ui.forms.widgets.FormToolkit; > import org.eclipse.ui.forms.widgets.Hyperlink; > > /** >@@ -77,6 +76,7 @@ > * @author Steffen Pingel > * @author Frank Becker > * @author David Green >+ * @author Helen Bershadskaya > * @since 2.0 > */ > public abstract class AbstractRepositorySettingsPage extends AbstractTaskRepositoryPage implements ITaskRepositoryPage { >@@ -162,12 +162,6 @@ > > private Composite proxyAuthComp; > >- private ExpandableComposite advancedExpComposite; >- >- private ExpandableComposite httpAuthExpComposite; >- >- private ExpandableComposite proxyExpComposite; >- > private Set<String> repositoryUrls; > > private String originalUrl; >@@ -230,12 +224,29 @@ > super.dispose(); > } > >- /** >- * @since 2.0 >- */ >+// /** >+// * @since 2.0 >+// */ >+// @Override >+// protected Control createContents(Composite parent) { >+// compositeContainer = new Composite(parent, SWT.NONE); >+// GridLayout layout = new GridLayout(3, false); >+// compositeContainer.setLayout(layout); >+// >+// createSettingControls(parent); >+// } >+ > @Override >- protected void createContents(Composite parent) { >- createSettingControls(parent); >+ public void createControl(Composite parent) { >+ toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay())); >+ >+ Composite compositeContainer = new Composite(parent, SWT.NONE); >+ GridLayout layout = new GridLayout(3, false); >+ compositeContainer.setLayout(layout); >+ >+ createSettingControls(compositeContainer); >+ >+ setControl(compositeContainer); > } > > /** >@@ -243,56 +254,12 @@ > */ > @Override > protected void createSettingControls(Composite parent) { >- if (repository != null) { >- originalUrl = repository.getRepositoryUrl(); >- AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY); >- if (oldCredentials != null) { >- oldUsername = oldCredentials.getUserName(); >- oldPassword = oldCredentials.getPassword(); >- } else { >- oldUsername = ""; //$NON-NLS-1$ >- oldPassword = ""; //$NON-NLS-1$ >- } >- >- AuthenticationCredentials oldHttpCredentials = repository.getCredentials(AuthenticationType.HTTP); >- if (oldHttpCredentials != null) { >- oldHttpAuthUserId = oldHttpCredentials.getUserName(); >- oldHttpAuthPassword = oldHttpCredentials.getPassword(); >- } else { >- oldHttpAuthPassword = null; >- oldHttpAuthUserId = null; >- } >- >- oldProxyHostname = repository.getProperty(TaskRepository.PROXY_HOSTNAME); >- oldProxyPort = repository.getProperty(TaskRepository.PROXY_PORT); >- if (oldProxyHostname == null) { >- oldProxyHostname = ""; //$NON-NLS-1$ >- } >- if (oldProxyPort == null) { >- oldProxyPort = ""; //$NON-NLS-1$ >- } >- >- AuthenticationCredentials oldProxyCredentials = repository.getCredentials(AuthenticationType.PROXY); >- if (oldProxyCredentials != null) { >- oldProxyUsername = oldProxyCredentials.getUserName(); >- oldProxyPassword = oldProxyCredentials.getPassword(); >- } else { >- oldProxyUsername = null; >- oldProxyPassword = null; >- } >- >- } else { >- oldUsername = ""; //$NON-NLS-1$ >- oldPassword = ""; //$NON-NLS-1$ >- oldHttpAuthPassword = null; >- oldHttpAuthUserId = null; >- } >+ compositeContainer = parent; > >- compositeContainer = new Composite(parent, SWT.NULL); >- FillLayout layout = new FillLayout(); >- compositeContainer.setLayout(layout); >+ initializeOldValues(); > >- new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); >+ Label serverLabel = new Label(compositeContainer, SWT.NONE); >+ serverLabel.setText(LABEL_SERVER); > serverUrlCombo = new Combo(compositeContainer, SWT.DROP_DOWN); > serverUrlCombo.addModifyListener(new ModifyListener() { > public void modifyText(ModifyEvent e) { >@@ -317,7 +284,8 @@ > } > }); > >- GridDataFactory.fillDefaults().hint(300, SWT.DEFAULT).grab(true, false).applyTo(serverUrlCombo); >+ GridDataFactory.fillDefaults().hint(300, SWT.DEFAULT).grab(true, false).span(2, SWT.DEFAULT).applyTo( >+ serverUrlCombo); > > repositoryLabelEditor = new StringFieldEditor("", LABEL_REPOSITORY_LABEL, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ > compositeContainer) { >@@ -335,22 +303,15 @@ > getWizard().getContainer().updateButtons(); > } > } >- }; >- // repositoryLabelEditor.setErrorMessage("error"); >- >- if (needsAnonymousLogin()) { >- anonymousButton = new Button(compositeContainer, SWT.CHECK); >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(anonymousButton); > >- anonymousButton.setText(Messages.AbstractRepositorySettingsPage_Anonymous_Access); >- anonymousButton.addSelectionListener(new SelectionAdapter() { >- @Override >- public void widgetSelected(SelectionEvent e) { >- setAnonymous(anonymousButton.getSelection()); >- isPageComplete(); >- } >- }); >- } >+ @Override >+ public int getNumberOfControls() { >+ return 2; >+ } >+ }; >+ disconnectedButton = new Button(compositeContainer, SWT.CHECK); >+ disconnectedButton.setText(Messages.AbstractRepositorySettingsPage_Disconnected); >+ disconnectedButton.setSelection(repository != null ? repository.isOffline() : false); > > repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ > compositeContainer) { >@@ -368,7 +329,27 @@ > getWizard().getContainer().updateButtons(); > } > } >+ >+ @Override >+ public int getNumberOfControls() { >+ // if will have anonymous checkbox on same line, make this control only span 2 columns >+ return needsAnonymousLogin() ? 2 : 3; >+ } > }; >+ if (needsAnonymousLogin()) { >+ // need to increase column number here, because above string editor will use them if declared beforehand >+ //((GridLayout) (compositeContainer.getLayout())).numColumns++; >+ anonymousButton = new Button(compositeContainer, SWT.CHECK); >+ >+ anonymousButton.setText(Messages.AbstractRepositorySettingsPage_Anonymous_Access); >+ anonymousButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ setAnonymous(anonymousButton.getSelection()); >+ isPageComplete(); >+ } >+ }); >+ } > > repositoryPasswordEditor = new RepositoryStringFieldEditor("", LABEL_PASSWORD, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ > compositeContainer) { >@@ -386,10 +367,16 @@ > getWizard().getContainer().updateButtons(); > } > } >+ >+ @Override >+ public int getNumberOfControls() { >+ return 2; >+ } > }; > >+ // need to increase column number here, because above string editor will use them if declared beforehand >+ //((GridLayout) (compositeContainer.getLayout())).numColumns++; > savePasswordButton = new Button(compositeContainer, SWT.CHECK); >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(savePasswordButton); > savePasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); > > if (repository != null) { >@@ -451,199 +438,18 @@ > // } > > if (needsAdvanced() || needsEncoding()) { >- >- advancedExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT >- | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >- advancedExpComposite.clientVerticalSpacing = 0; >- GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); >- gridData_2.horizontalIndent = -5; >- advancedExpComposite.setLayoutData(gridData_2); >- advancedExpComposite.setFont(compositeContainer.getFont()); >- advancedExpComposite.setBackground(compositeContainer.getBackground()); >- advancedExpComposite.setText(Messages.AbstractRepositorySettingsPage_Additional_Settings); >- advancedExpComposite.addExpansionListener(new ExpansionAdapter() { >- @Override >- public void expansionStateChanged(ExpansionEvent e) { >- getControl().getShell().pack(); >- } >- }); >- >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(advancedExpComposite); >- >- advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); >- GridLayout gridLayout2 = new GridLayout(); >- gridLayout2.numColumns = 2; >- gridLayout2.verticalSpacing = 5; >- advancedComp.setLayout(gridLayout2); >- advancedComp.setBackground(compositeContainer.getBackground()); >- advancedExpComposite.setClient(advancedComp); >- >- createAdditionalControls(advancedComp); >- >- if (needsEncoding()) { >- Label encodingLabel = new Label(advancedComp, SWT.HORIZONTAL); >- encodingLabel.setText(Messages.AbstractRepositorySettingsPage_Character_encoding); >- GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(encodingLabel); >- >- Composite encodingContainer = new Composite(advancedComp, SWT.NONE); >- GridLayout gridLayout = new GridLayout(2, false); >- gridLayout.marginWidth = 0; >- gridLayout.marginHeight = 0; >- encodingContainer.setLayout(gridLayout); >- >- defaultEncoding = new Button(encodingContainer, SWT.RADIO); >- defaultEncoding.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); >- defaultEncoding.setText(Messages.AbstractRepositorySettingsPage_Default__ >- + TaskRepository.DEFAULT_CHARACTER_ENCODING + ")"); //$NON-NLS-1$ >- defaultEncoding.setSelection(true); >- >- otherEncoding = new Button(encodingContainer, SWT.RADIO); >- otherEncoding.setText(Messages.AbstractRepositorySettingsPage_Other); >- otherEncodingCombo = new Combo(encodingContainer, SWT.READ_ONLY); >- try { >- for (String encoding : Charset.availableCharsets().keySet()) { >- if (!encoding.equals(TaskRepository.DEFAULT_CHARACTER_ENCODING)) { >- otherEncodingCombo.add(encoding); >- } >- } >- } catch (LinkageError e) { >- StatusHandler.log(new Status( >- IStatus.ERROR, >- TasksUiPlugin.ID_PLUGIN, >- Messages.AbstractRepositorySettingsPage_Problems_encountered_determining_available_charsets, >- e)); >- // bug 237972: 3rd party encodings can cause availableCharsets() to fail >- otherEncoding.setEnabled(false); >- otherEncodingCombo.setEnabled(false); >- } >- >- setDefaultEncoding(); >- >- otherEncoding.addSelectionListener(new SelectionAdapter() { >- >- @Override >- public void widgetSelected(SelectionEvent e) { >- if (otherEncoding.getSelection()) { >- defaultEncoding.setSelection(false); >- otherEncodingCombo.setEnabled(true); >- } else { >- defaultEncoding.setSelection(true); >- otherEncodingCombo.setEnabled(false); >- } >- } >- }); >- >- if (repository != null) { >- try { >- String repositoryEncoding = repository.getCharacterEncoding(); >- if (repositoryEncoding != null) {// && >- // !repositoryEncoding.equals(defaultEncoding)) >- // { >- if (otherEncodingCombo.getItemCount() > 0 >- && otherEncodingCombo.indexOf(repositoryEncoding) > -1) { >- otherEncodingCombo.setEnabled(true); >- otherEncoding.setSelection(true); >- defaultEncoding.setSelection(false); >- otherEncodingCombo.select(otherEncodingCombo.indexOf(repositoryEncoding)); >- } else { >- setDefaultEncoding(); >- } >- } >- } catch (Throwable t) { >- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >- "Could not set field value", t)); //$NON-NLS-1$ >- } >- } >- } >+ createAdvancedSection(); > } > > if (needsHttpAuth()) { >- httpAuthExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT >- | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >- httpAuthExpComposite.clientVerticalSpacing = 0; >- GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); >- gridData_2.horizontalIndent = -5; >- httpAuthExpComposite.setLayoutData(gridData_2); >- httpAuthExpComposite.setFont(compositeContainer.getFont()); >- httpAuthExpComposite.setBackground(compositeContainer.getBackground()); >- httpAuthExpComposite.setText(Messages.AbstractRepositorySettingsPage_Http_Authentication); >- httpAuthExpComposite.addExpansionListener(new ExpansionAdapter() { >- @Override >- public void expansionStateChanged(ExpansionEvent e) { >- getControl().getShell().pack(); >- } >- }); >- >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(httpAuthExpComposite); >- >- httpAuthComp = toolkit.createComposite(httpAuthExpComposite, SWT.NONE); >- GridLayout gridLayout2 = new GridLayout(); >- gridLayout2.numColumns = 2; >- gridLayout2.verticalSpacing = 0; >- httpAuthComp.setLayout(gridLayout2); >- httpAuthComp.setBackground(compositeContainer.getBackground()); >- httpAuthExpComposite.setClient(httpAuthComp); >- >- httpAuthButton = new Button(httpAuthComp, SWT.CHECK); >- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(httpAuthButton); >- >- httpAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enabled); >- >- httpAuthButton.addSelectionListener(new SelectionListener() { >- public void widgetSelected(SelectionEvent e) { >- setHttpAuth(httpAuthButton.getSelection()); >- } >- >- public void widgetDefaultSelected(SelectionEvent e) { >- // ignore >- } >- }); >- >- httpAuthUserNameEditor = new StringFieldEditor( >- "", Messages.AbstractRepositorySettingsPage_User_ID_, StringFieldEditor.UNLIMITED, httpAuthComp) { //$NON-NLS-1$ >- >- @Override >- protected boolean doCheckState() { >- return true; >- } >- >- @Override >- protected void valueChanged() { >- super.valueChanged(); >- if (getWizard() != null) { >- getWizard().getContainer().updateButtons(); >- } >- } >- }; >- httpAuthPasswordEditor = new RepositoryStringFieldEditor( >- "", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ >- httpAuthComp); >- ((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); >- >- saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveHttpPasswordButton); >- saveHttpPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Http_Password); >- >- httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); >- httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); >- saveHttpPasswordButton.setEnabled(httpAuthButton.getSelection()); >- >- if (repository != null) { >- saveHttpPasswordButton.setSelection(repository.getSavePassword(AuthenticationType.HTTP)); >- } else { >- saveHttpPasswordButton.setSelection(false); >- } >- setHttpAuth(oldHttpAuthPassword != null || oldHttpAuthUserId != null); >- httpAuthExpComposite.setExpanded(httpAuthButton.getSelection()); >+ createHttpAuthSection(); > } > > if (needsProxy()) { >- addProxySection(); >+ createProxySection(); > } > >- addStatusSection(); >- >- addContributionSection(); >+ createContributionControls(parent); > > Composite managementComposite = new Composite(compositeContainer, SWT.NULL); > GridLayout managementLayout = new GridLayout(4, false); >@@ -706,48 +512,259 @@ > > updateHyperlinks(); > >+ GridLayout layout = new GridLayout(3, false); >+ compositeContainer.setLayout(layout); >+ > Dialog.applyDialogFont(compositeContainer); > } > >- private void addProxySection() { >+ private void createAdvancedSection() { >+ ExpandableComposite section = createSection(compositeContainer, >+ Messages.AbstractRepositorySettingsPage_Additional_Settings); > >- proxyExpComposite = toolkit.createExpandableComposite(compositeContainer, ExpandableComposite.COMPACT >- | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >- proxyExpComposite.clientVerticalSpacing = 0; >- GridData gridData_2 = new GridData(SWT.FILL, SWT.FILL, true, false); >- gridData_2.horizontalIndent = -5; >- proxyExpComposite.setLayoutData(gridData_2); >- proxyExpComposite.setFont(compositeContainer.getFont()); >- proxyExpComposite.setBackground(compositeContainer.getBackground()); >- proxyExpComposite.setText(Messages.AbstractRepositorySettingsPage_Proxy_Server_Configuration); >- proxyExpComposite.addExpansionListener(new ExpansionAdapter() { >- @Override >- public void expansionStateChanged(ExpansionEvent e) { >- getControl().getShell().pack(); >+ advancedComp = toolkit.createComposite(section, SWT.NONE); >+ GridLayout gridLayout2 = new GridLayout(); >+ gridLayout2.numColumns = 2; >+ gridLayout2.verticalSpacing = 5; >+ gridLayout2.marginWidth = 0; >+ advancedComp.setLayout(gridLayout2); >+ advancedComp.setBackground(compositeContainer.getBackground()); >+ section.setClient(advancedComp); >+ >+ createAdditionalControls(advancedComp); >+ >+ if (needsEncoding()) { >+ Label encodingLabel = new Label(advancedComp, SWT.HORIZONTAL); >+ encodingLabel.setText(Messages.AbstractRepositorySettingsPage_Character_encoding); >+ GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.TOP).applyTo(encodingLabel); >+ >+ Composite encodingContainer = new Composite(advancedComp, SWT.NONE); >+ GridLayout gridLayout = new GridLayout(2, false); >+ gridLayout.marginWidth = 0; >+ gridLayout.marginHeight = 0; >+ encodingContainer.setLayout(gridLayout); >+ >+ defaultEncoding = new Button(encodingContainer, SWT.RADIO); >+ defaultEncoding.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1)); >+ defaultEncoding.setText(Messages.AbstractRepositorySettingsPage_Default__ >+ + TaskRepository.DEFAULT_CHARACTER_ENCODING + ")"); //$NON-NLS-1$ >+ defaultEncoding.setSelection(true); >+ >+ otherEncoding = new Button(encodingContainer, SWT.RADIO); >+ otherEncoding.setText(Messages.AbstractRepositorySettingsPage_Other); >+ otherEncodingCombo = new Combo(encodingContainer, SWT.READ_ONLY); >+ try { >+ for (String encoding : Charset.availableCharsets().keySet()) { >+ if (!encoding.equals(TaskRepository.DEFAULT_CHARACTER_ENCODING)) { >+ otherEncodingCombo.add(encoding); >+ } >+ } >+ } catch (LinkageError e) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >+ Messages.AbstractRepositorySettingsPage_Problems_encountered_determining_available_charsets, e)); >+ // bug 237972: 3rd party encodings can cause availableCharsets() to fail >+ otherEncoding.setEnabled(false); >+ otherEncodingCombo.setEnabled(false); >+ } >+ >+ setDefaultEncoding(); >+ >+ otherEncoding.addSelectionListener(new SelectionAdapter() { >+ >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ if (otherEncoding.getSelection()) { >+ defaultEncoding.setSelection(false); >+ otherEncodingCombo.setEnabled(true); >+ } else { >+ defaultEncoding.setSelection(true); >+ otherEncodingCombo.setEnabled(false); >+ } >+ } >+ }); >+ >+ if (repository != null) { >+ try { >+ String repositoryEncoding = repository.getCharacterEncoding(); >+ if (repositoryEncoding != null) {// && >+ // !repositoryEncoding.equals(defaultEncoding)) >+ // { >+ if (otherEncodingCombo.getItemCount() > 0 >+ && otherEncodingCombo.indexOf(repositoryEncoding) > -1) { >+ otherEncodingCombo.setEnabled(true); >+ otherEncoding.setSelection(true); >+ defaultEncoding.setSelection(false); >+ otherEncodingCombo.select(otherEncodingCombo.indexOf(repositoryEncoding)); >+ } else { >+ setDefaultEncoding(); >+ } >+ } >+ } catch (Throwable t) { >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not set field value", t)); //$NON-NLS-1$ >+ } >+ } >+ } >+ } >+ >+ private void createHttpAuthSection() { >+ ExpandableComposite section = createSection(compositeContainer, >+ Messages.AbstractRepositorySettingsPage_Http_Authentication); >+ >+ httpAuthComp = toolkit.createComposite(section, SWT.NONE); >+ httpAuthComp.setBackground(compositeContainer.getBackground()); >+ section.setClient(httpAuthComp); >+ >+ httpAuthButton = new Button(httpAuthComp, SWT.CHECK); >+ GridDataFactory.fillDefaults().indent(0, 5).align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo( >+ httpAuthButton); >+ >+ httpAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_http_authentication); >+ >+ httpAuthButton.addSelectionListener(new SelectionListener() { >+ public void widgetSelected(SelectionEvent e) { >+ setHttpAuth(httpAuthButton.getSelection()); >+ } >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ // ignore > } > }); > >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(proxyExpComposite); >+ httpAuthUserNameEditor = new StringFieldEditor( >+ "", Messages.AbstractRepositorySettingsPage_User_ID_, StringFieldEditor.UNLIMITED, httpAuthComp) { //$NON-NLS-1$ >+ >+ @Override >+ protected boolean doCheckState() { >+ return true; >+ } >+ >+ @Override >+ protected void valueChanged() { >+ super.valueChanged(); >+ if (getWizard() != null) { >+ getWizard().getContainer().updateButtons(); >+ } >+ } >+ >+ @Override >+ public int getNumberOfControls() { >+ return 3; >+ } >+ }; >+ >+ httpAuthPasswordEditor = new RepositoryStringFieldEditor( >+ "", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ >+ httpAuthComp) { >+ @Override >+ public int getNumberOfControls() { >+ return 2; >+ } >+ }; >+ ((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); >+ >+ saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); >+ saveHttpPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); >+ >+ httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); >+ httpAuthPasswordEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); >+ saveHttpPasswordButton.setEnabled(httpAuthButton.getSelection()); >+ >+ if (repository != null) { >+ saveHttpPasswordButton.setSelection(repository.getSavePassword(AuthenticationType.HTTP)); >+ } else { >+ saveHttpPasswordButton.setSelection(false); >+ } >+ setHttpAuth(oldHttpAuthPassword != null || oldHttpAuthUserId != null); >+ section.setExpanded(httpAuthButton.getSelection()); > >- proxyAuthComp = toolkit.createComposite(proxyExpComposite, SWT.NONE); > GridLayout gridLayout2 = new GridLayout(); >- gridLayout2.numColumns = 2; >+ gridLayout2.numColumns = 3; >+ gridLayout2.marginWidth = 0; >+ httpAuthComp.setLayout(gridLayout2); >+ } >+ >+ private void initializeOldValues() { >+ if (repository != null) { >+ originalUrl = repository.getRepositoryUrl(); >+ AuthenticationCredentials oldCredentials = repository.getCredentials(AuthenticationType.REPOSITORY); >+ if (oldCredentials != null) { >+ oldUsername = oldCredentials.getUserName(); >+ oldPassword = oldCredentials.getPassword(); >+ } else { >+ oldUsername = ""; //$NON-NLS-1$ >+ oldPassword = ""; //$NON-NLS-1$ >+ } >+ >+ AuthenticationCredentials oldHttpCredentials = repository.getCredentials(AuthenticationType.HTTP); >+ if (oldHttpCredentials != null) { >+ oldHttpAuthUserId = oldHttpCredentials.getUserName(); >+ oldHttpAuthPassword = oldHttpCredentials.getPassword(); >+ } else { >+ oldHttpAuthPassword = null; >+ oldHttpAuthUserId = null; >+ } >+ >+ oldProxyHostname = repository.getProperty(TaskRepository.PROXY_HOSTNAME); >+ oldProxyPort = repository.getProperty(TaskRepository.PROXY_PORT); >+ if (oldProxyHostname == null) { >+ oldProxyHostname = ""; //$NON-NLS-1$ >+ } >+ if (oldProxyPort == null) { >+ oldProxyPort = ""; //$NON-NLS-1$ >+ } >+ >+ AuthenticationCredentials oldProxyCredentials = repository.getCredentials(AuthenticationType.PROXY); >+ if (oldProxyCredentials != null) { >+ oldProxyUsername = oldProxyCredentials.getUserName(); >+ oldProxyPassword = oldProxyCredentials.getPassword(); >+ } else { >+ oldProxyUsername = null; >+ oldProxyPassword = null; >+ } >+ >+ } else { >+ oldUsername = ""; //$NON-NLS-1$ >+ oldPassword = ""; //$NON-NLS-1$ >+ oldHttpAuthPassword = null; >+ oldHttpAuthUserId = null; >+ } >+ } >+ >+ private void createProxySection() { >+ ExpandableComposite section = createSection(compositeContainer, >+ Messages.AbstractRepositorySettingsPage_Proxy_Server_Configuration); >+ >+ proxyAuthComp = toolkit.createComposite(section, SWT.NONE); >+ GridLayout gridLayout2 = new GridLayout(); > gridLayout2.verticalSpacing = 0; >+ gridLayout2.numColumns = 3; > proxyAuthComp.setLayout(gridLayout2); > proxyAuthComp.setBackground(compositeContainer.getBackground()); >- proxyExpComposite.setClient(proxyAuthComp); >+ section.setClient(proxyAuthComp); > >- Composite settingsComposite = new Composite(proxyAuthComp, SWT.NULL); >+ Composite systemSettingsComposite = new Composite(proxyAuthComp, SWT.NULL); > GridLayout gridLayout3 = new GridLayout(); >- gridLayout3.numColumns = 2; > gridLayout3.verticalSpacing = 0; >- settingsComposite.setLayout(gridLayout3); >+ gridLayout3.numColumns = 2; >+ gridLayout3.marginWidth = 0; >+ systemSettingsComposite.setLayout(gridLayout3); > >- systemProxyButton = new Button(settingsComposite, SWT.CHECK); >- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(settingsComposite); >+ systemProxyButton = new Button(systemSettingsComposite, SWT.CHECK); >+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo(systemSettingsComposite); > > systemProxyButton.setText(Messages.AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences); >- Hyperlink changeProxySettingsLink = toolkit.createHyperlink(settingsComposite, >+ >+ systemProxyButton.addSelectionListener(new SelectionListener() { >+ public void widgetSelected(SelectionEvent e) { >+ setUseDefaultProxy(systemProxyButton.getSelection()); >+ } >+ >+ public void widgetDefaultSelected(SelectionEvent e) { >+ // ignore >+ } >+ }); >+ >+ Hyperlink changeProxySettingsLink = toolkit.createHyperlink(systemSettingsComposite, > Messages.AbstractRepositorySettingsPage_Change_Settings, SWT.NULL); > changeProxySettingsLink.setBackground(compositeContainer.getBackground()); > changeProxySettingsLink.addHyperlinkListener(new IHyperlinkListener() { >@@ -767,16 +784,6 @@ > } > }); > >- systemProxyButton.addSelectionListener(new SelectionListener() { >- public void widgetSelected(SelectionEvent e) { >- setUseDefaultProxy(systemProxyButton.getSelection()); >- } >- >- public void widgetDefaultSelected(SelectionEvent e) { >- // ignore >- } >- }); >- > proxyHostnameEditor = new StringFieldEditor( > "", Messages.AbstractRepositorySettingsPage_Proxy_host_address_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ > proxyAuthComp) { >@@ -793,12 +800,23 @@ > getWizard().getContainer().updateButtons(); > } > } >+ >+ @Override >+ public int getNumberOfControls() { >+ return 3; >+ } > }; > proxyHostnameEditor.setStringValue(oldProxyHostname); > > proxyPortEditor = new RepositoryStringFieldEditor( > "", Messages.AbstractRepositorySettingsPage_Proxy_host_port_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ >- proxyAuthComp); >+ proxyAuthComp) { >+ >+ @Override >+ public int getNumberOfControls() { >+ return 3; >+ } >+ }; > > proxyPortEditor.setStringValue(oldProxyPort); > >@@ -808,8 +826,7 @@ > // ************* PROXY AUTHENTICATION ************** > > proxyAuthButton = new Button(proxyAuthComp, SWT.CHECK); >- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(proxyAuthButton); >- >+ GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(proxyAuthButton); > proxyAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_proxy_authentication); > proxyAuthButton.addSelectionListener(new SelectionListener() { > public void widgetSelected(SelectionEvent e) { >@@ -836,10 +853,21 @@ > getWizard().getContainer().updateButtons(); > } > } >+ >+ @Override >+ public int getNumberOfControls() { >+ return 3; >+ } > }; >+ > proxyPasswordEditor = new RepositoryStringFieldEditor( > "", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ >- proxyAuthComp); >+ proxyAuthComp) { >+ @Override >+ public int getNumberOfControls() { >+ return 2; >+ } >+ }; > ((RepositoryStringFieldEditor) proxyPasswordEditor).getTextControl().setEchoChar('*'); > > // proxyPasswordEditor.setEnabled(httpAuthButton.getSelection(), >@@ -848,9 +876,10 @@ > // httpAuthPasswordEditor).setEnabled(httpAuthButton.getSelection(), > // advancedComp); > >+ // need to increase column number here, because above string editor will use them if declared beforehand >+ ((GridLayout) (proxyAuthComp.getLayout())).numColumns++; > saveProxyPasswordButton = new Button(proxyAuthComp, SWT.CHECK); >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveProxyPasswordButton); >- saveProxyPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Proxy_Password); >+ saveProxyPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Password); > saveProxyPasswordButton.setEnabled(proxyAuthButton.getSelection()); > > if (repository != null) { >@@ -862,55 +891,22 @@ > setProxyAuth(oldProxyUsername != null || oldProxyPassword != null); > > setUseDefaultProxy(repository != null ? repository.isDefaultProxyEnabled() : true); >- proxyExpComposite.setExpanded(!systemProxyButton.getSelection()); >- } >- >- private void addContributionSection() { >- Composite composite = toolkit.createComposite(compositeContainer); >- GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite); >- >- GridLayout layout = new GridLayout(1, false); >- layout.marginWidth = 0; >- layout.marginTop = -5; >- composite.setLayout(layout); >- >- composite.setBackground(compositeContainer.getBackground()); >- >- createContributionControls(composite); >+ section.setExpanded(!systemProxyButton.getSelection()); > } > >- private void addStatusSection() { >- ExpandableComposite statusComposite = toolkit.createExpandableComposite(compositeContainer, >- ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >- statusComposite.clientVerticalSpacing = 0; >- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); >- gd.horizontalIndent = -5; >- statusComposite.setLayoutData(gd); >- statusComposite.setFont(compositeContainer.getFont()); >- statusComposite.setBackground(compositeContainer.getBackground()); >- statusComposite.setText(Messages.AbstractRepositorySettingsPage_Status); >- statusComposite.addExpansionListener(new ExpansionAdapter() { >- @Override >- public void expansionStateChanged(ExpansionEvent e) { >- getControl().getShell().pack(); >- } >- }); >- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(statusComposite); >- >- Composite composite = toolkit.createComposite(statusComposite, SWT.NONE); >- GridLayout layout = new GridLayout(); >- layout.numColumns = 2; >- layout.verticalSpacing = 0; >- composite.setLayout(layout); >- composite.setBackground(compositeContainer.getBackground()); >- statusComposite.setClient(composite); >- >- disconnectedButton = new Button(composite, SWT.CHECK); >- disconnectedButton.setText(Messages.AbstractRepositorySettingsPage_Disconnected); >- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(disconnectedButton); >- disconnectedButton.setSelection(repository != null ? repository.isOffline() : false); >- statusComposite.setExpanded(disconnectedButton.getSelection()); >- } >+// private void addContributionSection() { >+// Composite composite = toolkit.createComposite(compositeContainer); >+// GridDataFactory.fillDefaults().grab(true, false).span(3, SWT.DEFAULT).applyTo(composite); >+// >+// GridLayout layout = new GridLayout(1, false); >+// layout.marginWidth = 0; >+// layout.marginTop = -5; >+// composite.setLayout(layout); >+// >+// composite.setBackground(compositeContainer.getBackground()); >+// >+// createContributionControls(composite); >+// } > > protected void setEncoding(String encoding) { > if (encoding.equals(TaskRepository.DEFAULT_CHARACTER_ENCODING)) { >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java,v >retrieving revision 1.6 >diff -u -r1.6 AbstractTaskRepositoryPage.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java 13 Jan 2009 06:59:04 -0000 1.6 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractTaskRepositoryPage.java 17 Feb 2009 02:17:03 -0000 >@@ -7,7 +7,8 @@ > * > * Contributors: > * David Green - initial API and implementation >- * Tasktop Technologies - improvement >+ * Tasktop Technologies - improvements >+ * Helen Bershadskaya - improvements for bug 242445 > *******************************************************************************/ > > package org.eclipse.mylyn.tasks.ui.wizards; >@@ -28,16 +29,18 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.jface.dialogs.IMessageProvider; > import org.eclipse.jface.layout.GridDataFactory; >+import org.eclipse.jface.resource.JFaceResources; > import org.eclipse.jface.util.SafeRunnable; > import org.eclipse.jface.wizard.WizardPage; > import org.eclipse.mylyn.commons.core.StatusHandler; > import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; > import org.eclipse.mylyn.internal.tasks.ui.wizards.Messages; > import org.eclipse.mylyn.tasks.core.TaskRepository; >+import org.eclipse.osgi.util.NLS; > import org.eclipse.swt.SWT; >-import org.eclipse.swt.layout.FillLayout; >+import org.eclipse.swt.layout.GridLayout; > import org.eclipse.swt.widgets.Composite; >-import org.eclipse.swt.widgets.Layout; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.ui.forms.events.ExpansionAdapter; > import org.eclipse.ui.forms.events.ExpansionEvent; > import org.eclipse.ui.forms.widgets.ExpandableComposite; >@@ -57,15 +60,15 @@ > */ > public abstract class AbstractTaskRepositoryPage extends WizardPage implements ITaskRepositoryPage { > >- private static final String CLASS = "class"; >+ private static final String CLASS = "class"; //$NON-NLS-1$ > >- private static final String ID = "id"; >+ private static final String ID = "id"; //$NON-NLS-1$ > >- private static final String KIND = "connectorKind"; >+ private static final String KIND = "connectorKind"; //$NON-NLS-1$ > >- private static final String TASK_REPOSITORY_PAGE_CONTRIBUTION = "taskRepositoryPageContribution"; >+ private static final String TASK_REPOSITORY_PAGE_CONTRIBUTION = "taskRepositoryPageContribution"; //$NON-NLS-1$ > >- private static final String TASK_REPOSITORY_PAGE_CONTRIBUTION_EXTENSION = "org.eclipse.mylyn.tasks.ui.taskRepositoryPageContribution"; >+ private static final String TASK_REPOSITORY_PAGE_CONTRIBUTION_EXTENSION = "org.eclipse.mylyn.tasks.ui.taskRepositoryPageContribution"; //$NON-NLS-1$ > > private static final Comparator<AbstractTaskRepositoryPageContribution> CONTRIBUTION_COMPARATOR = new ContributionComparator(); > >@@ -75,8 +78,6 @@ > > FormToolkit toolkit; > >- private Composite compositeContainer; >- > private final AbstractTaskRepositoryPageContribution.Listener contributionListener = new AbstractTaskRepositoryPageContribution.Listener() { > public void validationRequired(AbstractTaskRepositoryPageContribution contribution) { > validatePageSettings(); >@@ -115,27 +116,28 @@ > super.dispose(); > } > >+ /** >+ * Creates the contents of the page. Subclasses may override this method to change where the contributions are >+ * added. >+ * >+ * @since 2.0 >+ */ > public void createControl(Composite parent) { > toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay())); > >- compositeContainer = new Composite(parent, SWT.NULL); >- Layout layout = new FillLayout(); >+ Composite compositeContainer = new Composite(parent, SWT.NONE); >+ GridLayout layout = new GridLayout(3, false); > compositeContainer.setLayout(layout); > >- createContents(compositeContainer); >+// Composite compositeContainer = new Composite(parent, SWT.NULL); >+// Layout layout = new FillLayout(); >+// compositeContainer.setLayout(layout); > >- setControl(compositeContainer); >- } >+ createSettingControls(compositeContainer); >+ createContributionControls(compositeContainer); > >- /** >- * Creates the contents of the page. Subclasses may override this method to change where the contributions are >- * added. >- * >- * @since 3.1 >- */ >- protected void createContents(Composite parent) { >- createSettingControls(parent); >- createContributionControls(parent); >+ setControl(compositeContainer); >+ //getControl().getShell().pack(); > } > > /** >@@ -196,8 +198,8 @@ > @Override > public void handleException(Throwable e) { > badContributions.add(contribution); >- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >- "Problems occured when initializing contribution \"" + contribution.getId() + "\"", e)); >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind( >+ "Problems occured when initializing contribution \"{0}\"", contribution.getId()), e)); //$NON-NLS-1$ > } > }); > } >@@ -206,36 +208,21 @@ > Collections.sort(contributions, CONTRIBUTION_COMPARATOR); > > for (final AbstractTaskRepositoryPageContribution contribution : contributions) { >- final ExpandableComposite section = toolkit.createExpandableComposite(parentControl, >- ExpandableComposite.COMPACT | ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR); >- section.clientVerticalSpacing = 0; >- section.setBackground(parentControl.getBackground()); >- section.setFont(parentControl.getFont()); >- section.addExpansionListener(new ExpansionAdapter() { >- @Override >- public void expansionStateChanged(ExpansionEvent e) { >- getControl().getShell().pack(); >- } >- }); >- section.setText(contribution.getTitle()); >+ final ExpandableComposite section = createSection(parentControl, contribution.getTitle()); > section.setToolTipText(contribution.getDescription()); > >- GridDataFactory.fillDefaults().grab(true, false).applyTo(section); >- > SafeRunnable.run(new SafeRunnable() { > public void run() throws Exception { >- Composite sectionContentsContainer = toolkit.createComposite(section); >- sectionContentsContainer.setBackground(parentControl.getBackground()); >- contribution.createControl(sectionContentsContainer); >- section.setClient(sectionContentsContainer); >+ Control control = contribution.createControl(section); >+ section.setClient(control); > } > > @Override > public void handleException(Throwable e) { > section.dispose(); >- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >- "Problems occured when creating control for contribution \"" + contribution.getId() >- + "\"", e)); >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind( >+ "Problems occured when creating control for contribution \"{0}\"", //$NON-NLS-1$ >+ contribution.getId()), e)); > } > }); > } >@@ -243,6 +230,26 @@ > } > > /** >+ * @since 3.1 >+ */ >+ protected ExpandableComposite createSection(Composite parentControl, String title) { >+ final ExpandableComposite section = toolkit.createExpandableComposite(parentControl, >+ ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT | ExpandableComposite.COMPACT); >+ section.clientVerticalSpacing = 0; >+ section.setBackground(parentControl.getBackground()); >+ section.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT)); >+ section.addExpansionListener(new ExpansionAdapter() { >+ @Override >+ public void expansionStateChanged(ExpansionEvent e) { >+ getControl().getShell().pack(); >+ } >+ }); >+ section.setText(title); >+ GridDataFactory.fillDefaults().indent(0, 5).grab(true, false).span(3, SWT.DEFAULT).applyTo(section); >+ return section; >+ } >+ >+ /** > * Validate the settings of this page, not including contributions. This method should not be called directly by > * page implementations. Always run on a UI thread. > * >@@ -292,8 +299,8 @@ > > @Override > public void handleException(Throwable e) { >- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, >- "Problems occured when validating contribution \"" + contribution.getId() + "\"", e)); >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, NLS.bind( >+ "Problems occured when validating contribution \"{0}\"", contribution.getId()), e)); //$NON-NLS-1$ > } > }); > } >@@ -364,8 +371,8 @@ > String id = element.getAttribute(ID); > try { > if (id == null || id.length() == 0) { >- throw new IllegalStateException(TASK_REPOSITORY_PAGE_CONTRIBUTION + "/@" + ID >- + " is required"); >+ throw new IllegalStateException(TASK_REPOSITORY_PAGE_CONTRIBUTION + "/@" + ID //$NON-NLS-1$ >+ + " is required"); //$NON-NLS-1$ > } > Object contributor = element.createExecutableExtension(CLASS); > AbstractTaskRepositoryPageContribution pageContributor = (AbstractTaskRepositoryPageContribution) contributor; >@@ -374,8 +381,8 @@ > contributors.add(pageContributor); > } > } catch (Exception e) { >- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load " >- + TASK_REPOSITORY_PAGE_CONTRIBUTION + " '" + id + "' from plug-in " >+ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not load " //$NON-NLS-1$ >+ + TASK_REPOSITORY_PAGE_CONTRIBUTION + " '" + id + "' from plug-in " //$NON-NLS-1$//$NON-NLS-2$ > + element.getContributor().getName(), e)); > } > } >Index: src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java,v >retrieving revision 1.10 >diff -u -r1.10 TasksUiImages.java >--- src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java 29 Jan 2009 20:52:17 -0000 1.10 >+++ src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java 17 Feb 2009 02:17:02 -0000 >@@ -101,6 +101,11 @@ > > public static final ImageDescriptor REPOSITORY_NEW = create("etool16", "repository-new.gif"); //$NON-NLS-1$ //$NON-NLS-2$ > >+ /** >+ * @since 3.1 >+ */ >+ public static final ImageDescriptor REPOSITORY_VALIDATE = create("obj16", "resource_obj.gif"); //$NON-NLS-1$ //$NON-NLS-2$ >+ > public static final ImageDescriptor REPOSITORIES_VIEW = create("eview16", "repositories.gif"); //$NON-NLS-1$ //$NON-NLS-2$ > > // Context and activation >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties,v >retrieving revision 1.9 >diff -u -r1.9 messages.properties >--- src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties 11 Feb 2009 00:14:00 -0000 1.9 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties 17 Feb 2009 02:17:01 -0000 >@@ -82,7 +82,7 @@ > AbstractRepositoryQueryPage_Please_specify_a_title_for_the_query=Please specify a title for the query. > AbstractRepositoryQueryPage_A_query_with_this_name_already_exists=A query with this name already exists, please choose another name. > AbstractRepositorySettingsPage_Additional_Settings=Additional Settings >-AbstractRepositorySettingsPage_Anonymous_Access=Anonymous Access >+AbstractRepositorySettingsPage_Anonymous_Access=Anonymous > AbstractRepositorySettingsPage_Authentication_credentials_are_valid=Authentication credentials are valid. > AbstractRepositorySettingsPage_Change_account_settings=Change account settings > AbstractRepositorySettingsPage_Change_Settings=Change Settings >@@ -90,8 +90,8 @@ > AbstractRepositorySettingsPage_Create_new_account=Create new account > AbstractRepositorySettingsPage_Default__=Default ( > AbstractRepositorySettingsPage_Disconnected=Disconnected >-AbstractRepositorySettingsPage_Enable_proxy_authentication=Enable proxy authentication >-AbstractRepositorySettingsPage_Enabled=Enabled >+AbstractRepositorySettingsPage_Enable_http_authentication=Enable Http Authentication >+AbstractRepositorySettingsPage_Enable_proxy_authentication=Enable Proxy Authentication > AbstractRepositorySettingsPage_Enter_a_valid_server_url=Enter a valid server url > AbstractRepositorySettingsPage_Http_Authentication=Http Authentication > AbstractRepositorySettingsPage_Internal_error_validating_repository=Internal error validating repository >@@ -106,11 +106,8 @@ > AbstractRepositorySettingsPage_Repository_is_valid=Repository is valid. > AbstractRepositorySettingsPage_Repository_url_is_invalid=Repository url is invalid. > AbstractRepositorySettingsPage_Repository_user_name_and_password_must_not_be_blank=Repository user name and password must not be blank >-AbstractRepositorySettingsPage_Save_Http_Password=Save Http Password > AbstractRepositorySettingsPage_Save_Password=Save Password >-AbstractRepositorySettingsPage_Save_Proxy_Password=Save Proxy Password > AbstractRepositorySettingsPage_Server_=Server\:\ >-AbstractRepositorySettingsPage_Status=Status > AbstractRepositorySettingsPage_Unable_to_authenticate_with_repository=Unable to authenticate with repository. Login credentials invalid. > AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences=Use global Network Connections preferences > AbstractRepositorySettingsPage_User_ID_=User ID\:\ >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java,v >retrieving revision 1.9 >diff -u -r1.9 Messages.java >--- src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java 11 Feb 2009 00:14:00 -0000 1.9 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/Messages.java 17 Feb 2009 02:17:01 -0000 >@@ -179,9 +179,9 @@ > > public static String AbstractRepositorySettingsPage_Disconnected; > >- public static String AbstractRepositorySettingsPage_Enable_proxy_authentication; >+ public static String AbstractRepositorySettingsPage_Enable_http_authentication; > >- public static String AbstractRepositorySettingsPage_Enabled; >+ public static String AbstractRepositorySettingsPage_Enable_proxy_authentication; > > public static String AbstractRepositorySettingsPage_Enter_a_valid_server_url; > >@@ -211,16 +211,10 @@ > > public static String AbstractRepositorySettingsPage_Repository_user_name_and_password_must_not_be_blank; > >- public static String AbstractRepositorySettingsPage_Save_Http_Password; >- > public static String AbstractRepositorySettingsPage_Save_Password; > >- public static String AbstractRepositorySettingsPage_Save_Proxy_Password; >- > public static String AbstractRepositorySettingsPage_Server_; > >- public static String AbstractRepositorySettingsPage_Status; >- > public static String AbstractRepositorySettingsPage_Unable_to_authenticate_with_repository; > > public static String AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences; >Index: src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java,v >retrieving revision 1.4 >diff -u -r1.4 TaskEditorExtensionSettingsContribution.java >--- src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java 13 Jan 2009 06:59:03 -0000 1.4 >+++ src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorExtensionSettingsContribution.java 17 Feb 2009 02:17:01 -0000 >@@ -72,8 +72,11 @@ > } > > @Override >- public Control createControl(Composite parent) { >- parent.setLayout(new GridLayout(1, true)); >+ public Control createControl(Composite parentControl) { >+ Composite parent = new Composite(parentControl, SWT.NONE); >+ GridLayout layout = new GridLayout(1, true); >+ layout.marginWidth = 0; >+ parent.setLayout(layout); > > String defaultExtensionId = TaskEditorExtensions.getDefaultTaskEditorExtensionId(getConnectorKind()); > selectedExtensionId = getRepository() == null ? defaultExtensionId >Index: .refactorings/2009/2/8/refactorings.history >=================================================================== >RCS file: .refactorings/2009/2/8/refactorings.history >diff -N .refactorings/2009/2/8/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/2/8/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<session version="1.0">
<refactoring comment="Extract method 'protected ExpandableComposite createSection(final Composite parentControl,final AbstractTaskRepositoryPageContribution contribution)' from 'org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPage.createContributionControls()' to 'org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPage'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Method name: 'createSection'
- Destination type: 'org.eclipse.mylyn.tasks.ui.wizards.AbstractTaskRepositoryPage'
- Declared visibility: 'protected'" comments="false" description="Extract method 'createSection'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src<org.eclipse.mylyn.tasks.ui.wizards{AbstractTaskRepositoryPage.java" name="createSection" replace="false" selection="7365 610" stamp="1234830352822" version="1.0" visibility="4"/>
<refactoring comment="Extract method 'private void initializeOldValues()' from 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage.createSettingControls()' to 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Method name: 'initializeOldValues'
- Destination type: 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Declared visibility: 'private'" comments="false" description="Extract method 'initializeOldValues'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src<org.eclipse.mylyn.tasks.ui.wizards{AbstractRepositorySettingsPage.java" name="initializeOldValues" replace="false" selection="7666 1516" stamp="1234831223727" version="1.0" visibility="2"/>
<refactoring comment="Extract method 'private void addHttpAuthSection()' from 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage.createSettingControls()' to 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Method name: 'addHttpAuthSection'
- Destination type: 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Declared visibility: 'private'" comments="false" description="Extract method 'addHttpAuthSection'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src<org.eclipse.mylyn.tasks.ui.wizards{AbstractRepositorySettingsPage.java" name="addHttpAuthSection" replace="false" selection="18218 3340" stamp="1234835010398" version="1.0" visibility="2"/>
<refactoring comment="Extract method 'private void addAdvancedSection()' from 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage.createSettingControls()' to 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Method name: 'addAdvancedSection'
- Destination type: 'org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage'
- Declared visibility: 'private'" comments="false" description="Extract method 'addAdvancedSection'" destination="0" exceptions="false" flags="786434" id="org.eclipse.jdt.ui.extract.method" input="/src<org.eclipse.mylyn.tasks.ui.wizards{AbstractRepositorySettingsPage.java" name="addAdvancedSection" replace="false" selection="14093 4094" stamp="1234835037678" version="1.0" visibility="2"/>
<refactoring comment="Extract local variable 'layout' from expression 'new GridLayout(1,true)'
- Original project: 'org.eclipse.mylyn.tasks.ui'
- Variable name: 'layout'
- Destination method: 'org.eclipse.mylyn.internal.tasks.ui.editors.TaskEditorExtensionSettingsContribution.createControl()'
- Variable expression: 'new GridLayout(1,true)'
- Replace occurrences of expression with variable" description="Extract local variable 'layout'" final="false" id="org.eclipse.jdt.ui.extract.temp" input="/src<org.eclipse.mylyn.internal.tasks.ui.editors{TaskEditorExtensionSettingsContribution.java" name="layout" replace="true" selection="2801 23" stamp="1234835828998" version="1.0"/> >+</session> >\ No newline at end of file >Index: .refactorings/2009/2/8/refactorings.index >=================================================================== >RCS file: .refactorings/2009/2/8/refactorings.index >diff -N .refactorings/2009/2/8/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2009/2/8/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,5 @@ >+1234830352822 Extract method 'createSection' >+1234831223727 Extract method 'initializeOldValues' >+1234835010398 Extract method 'addHttpAuthSection' >+1234835037678 Extract method 'addAdvancedSection' >+1234835828998 Extract local variable 'layout'
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 242445
:
124346
|
124780
|
124781
|
124782
|
125493
|
125494
|
125495
|
125496
|
125497
|
125700
| 125846 |
126259
|
126260