### Eclipse Workspace Patch 1.0 #P org.eclipse.mylyn.tasks.ui 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.7 diff -u -r1.7 messages.properties --- src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties 30 Jan 2009 06:21:08 -0000 1.7 +++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/messages.properties 31 Jan 2009 00:39:25 -0000 @@ -112,7 +112,7 @@ AbstractRepositorySettingsPage_Character_encoding=Character encoding\: AbstractRepositorySettingsPage_Create_new_account=Create new account AbstractRepositorySettingsPage_Default__=Default ( -AbstractRepositorySettingsPage_Disconnected=Disconnected +AbstractRepositorySettingsPage_Disconnected=Disconnected Mode AbstractRepositorySettingsPage_Enable_proxy_authentication=Enable proxy authentication AbstractRepositorySettingsPage_Enabled=Enabled AbstractRepositorySettingsPage_Enter_a_valid_server_url=Enter a valid server url 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 31 Jan 2009 00:39:25 -0000 @@ -50,7 +50,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; @@ -289,7 +288,7 @@ } compositeContainer = new Composite(parent, SWT.NULL); - FillLayout layout = new FillLayout(); + GridLayout layout = new GridLayout(3, false); compositeContainer.setLayout(layout); new Label(compositeContainer, SWT.NONE).setText(LABEL_SERVER); @@ -317,7 +316,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,23 +335,14 @@ getWizard().getContainer().updateButtons(); } } + + @Override + public int getNumberOfControls() { + return 3; + } }; // 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(); - } - }); - } - repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ compositeContainer) { @@ -368,7 +359,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 +397,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) { @@ -413,6 +430,7 @@ StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN, "Could not set field value", t)); //$NON-NLS-1$ } } + addStatusSection(); if (needsAnonymousLogin()) { if (repository != null) { @@ -468,7 +486,7 @@ } }); - GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(advancedExpComposite); + GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(advancedExpComposite); advancedComp = toolkit.createComposite(advancedExpComposite, SWT.NONE); GridLayout gridLayout2 = new GridLayout(); @@ -574,31 +592,17 @@ } }); - GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(httpAuthExpComposite); + GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(httpAuthExpComposite); httpAuthComp = toolkit.createComposite(httpAuthExpComposite, SWT.NONE); GridLayout gridLayout2 = new GridLayout(); - gridLayout2.numColumns = 2; + gridLayout2.numColumns = 3; gridLayout2.verticalSpacing = 0; httpAuthComp.setLayout(gridLayout2); httpAuthComp.setBackground(compositeContainer.getBackground()); + GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(httpAuthComp); 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$ @@ -614,14 +618,43 @@ 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) (httpAuthComp.getLayout())).numColumns++; + httpAuthButton = new Button(httpAuthComp, SWT.CHECK); + + httpAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enabled); + + httpAuthButton.addSelectionListener(new SelectionListener() { + public void widgetSelected(SelectionEvent e) { + setHttpAuth(httpAuthButton.getSelection()); + } + + public void widgetDefaultSelected(SelectionEvent e) { + // ignore + } + }); + httpAuthPasswordEditor = new RepositoryStringFieldEditor( "", Messages.AbstractRepositorySettingsPage_Password_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ - httpAuthComp); + httpAuthComp) { + @Override + public int getNumberOfControls() { + return 2; + } + }; ((RepositoryStringFieldEditor) httpAuthPasswordEditor).getTextControl().setEchoChar('*'); + // need to increase column number here, because above string editor will use them if declared beforehand + ((GridLayout) (httpAuthComp.getLayout())).numColumns++; + saveHttpPasswordButton = new Button(httpAuthComp, SWT.CHECK); - GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(saveHttpPasswordButton); +// GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(saveHttpPasswordButton); saveHttpPasswordButton.setText(Messages.AbstractRepositorySettingsPage_Save_Http_Password); httpAuthUserNameEditor.setEnabled(httpAuthButton.getSelection(), httpAuthComp); @@ -641,8 +674,6 @@ addProxySection(); } - addStatusSection(); - addContributionSection(); Composite managementComposite = new Composite(compositeContainer, SWT.NULL); @@ -727,24 +758,24 @@ } }); - GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(proxyExpComposite); + GridDataFactory.fillDefaults().span(3, SWT.DEFAULT).applyTo(proxyExpComposite); proxyAuthComp = toolkit.createComposite(proxyExpComposite, SWT.NONE); GridLayout gridLayout2 = new GridLayout(); - gridLayout2.numColumns = 2; gridLayout2.verticalSpacing = 0; + gridLayout2.numColumns = 3; proxyAuthComp.setLayout(gridLayout2); proxyAuthComp.setBackground(compositeContainer.getBackground()); proxyExpComposite.setClient(proxyAuthComp); Composite settingsComposite = new Composite(proxyAuthComp, SWT.NULL); GridLayout gridLayout3 = new GridLayout(); - gridLayout3.numColumns = 2; gridLayout3.verticalSpacing = 0; + gridLayout3.numColumns = 2; settingsComposite.setLayout(gridLayout3); systemProxyButton = new Button(settingsComposite, SWT.CHECK); - GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(settingsComposite); + GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo(settingsComposite); systemProxyButton.setText(Messages.AbstractRepositorySettingsPage_Use_global_Network_Connections_preferences); Hyperlink changeProxySettingsLink = toolkit.createHyperlink(settingsComposite, @@ -793,22 +824,15 @@ getWizard().getContainer().updateButtons(); } } + + @Override + public int getNumberOfControls() { + return 2; + } }; proxyHostnameEditor.setStringValue(oldProxyHostname); - - proxyPortEditor = new RepositoryStringFieldEditor( - "", Messages.AbstractRepositorySettingsPage_Proxy_host_port_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ - proxyAuthComp); - - proxyPortEditor.setStringValue(oldProxyPort); - - proxyHostnameEditor.setEnabled(systemProxyButton.getSelection(), proxyAuthComp); - proxyPortEditor.setEnabled(systemProxyButton.getSelection(), proxyAuthComp); - - // ************* PROXY AUTHENTICATION ************** - + ((GridLayout) (proxyAuthComp.getLayout())).numColumns++; proxyAuthButton = new Button(proxyAuthComp, SWT.CHECK); - GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(proxyAuthButton); proxyAuthButton.setText(Messages.AbstractRepositorySettingsPage_Enable_proxy_authentication); proxyAuthButton.addSelectionListener(new SelectionListener() { @@ -821,6 +845,23 @@ } }); + proxyPortEditor = new RepositoryStringFieldEditor( + "", Messages.AbstractRepositorySettingsPage_Proxy_host_port_, StringFieldEditor.UNLIMITED, //$NON-NLS-1$ + proxyAuthComp) { + + @Override + public int getNumberOfControls() { + return 3; + } + }; + + proxyPortEditor.setStringValue(oldProxyPort); + + proxyHostnameEditor.setEnabled(systemProxyButton.getSelection(), proxyAuthComp); + proxyPortEditor.setEnabled(systemProxyButton.getSelection(), proxyAuthComp); + + // ************* PROXY AUTHENTICATION ************** + proxyUserNameEditor = new StringFieldEditor( "", Messages.AbstractRepositorySettingsPage_User_ID_, StringFieldEditor.UNLIMITED, proxyAuthComp) { //$NON-NLS-1$ @@ -836,10 +877,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,8 +900,9 @@ // 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.setEnabled(proxyAuthButton.getSelection()); @@ -867,7 +920,7 @@ private void addContributionSection() { Composite composite = toolkit.createComposite(compositeContainer); - GridDataFactory.fillDefaults().grab(true, false).span(2, SWT.DEFAULT).applyTo(composite); + GridDataFactory.fillDefaults().grab(true, false).span(3, SWT.DEFAULT).applyTo(composite); GridLayout layout = new GridLayout(1, false); layout.marginWidth = 0; @@ -880,36 +933,10 @@ } 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 = new Button(compositeContainer, SWT.CHECK); disconnectedButton.setText(Messages.AbstractRepositorySettingsPage_Disconnected); - GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(disconnectedButton); + GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(3, SWT.DEFAULT).applyTo(disconnectedButton); disconnectedButton.setSelection(repository != null ? repository.isOffline() : false); - statusComposite.setExpanded(disconnectedButton.getSelection()); } protected void setEncoding(String encoding) {