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 46316 Details for
Bug 150677
Trac connector: add repository templates
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.
[patch]
Adds Edgewall repository as a template for Trac
mylar-trac-repository-template-patch.txt (text/plain), 5.89 KB, created by
Steffen Pingel
on 2006-07-14 15:52:23 EDT
(
hide
)
Description:
Adds Edgewall repository as a template for Trac
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2006-07-14 15:52:23 EDT
Size:
5.89 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.tasks.ui >Index: src/org/eclipse/mylar/internal/tasks/ui/wizards/AbstractRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/internal/tasks/ui/wizards/AbstractRepositorySettingsPage.java,v >retrieving revision 1.1 >diff -u -r1.1 AbstractRepositorySettingsPage.java >--- src/org/eclipse/mylar/internal/tasks/ui/wizards/AbstractRepositorySettingsPage.java 14 Jul 2006 15:39:01 -0000 1.1 >+++ src/org/eclipse/mylar/internal/tasks/ui/wizards/AbstractRepositorySettingsPage.java 14 Jul 2006 19:50:09 -0000 >@@ -87,6 +87,8 @@ > > private boolean needsEncoding; > >+ private Composite container; >+ > public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnector connector) { > super(title); > super.setTitle(title); >@@ -99,7 +101,7 @@ > } > > public void createControl(Composite parent) { >- final Composite container = new Composite(parent, SWT.NULL); >+ container = new Composite(parent, SWT.NULL); > FillLayout layout = new FillLayout(); > container.setLayout(layout); > >@@ -132,8 +134,7 @@ > anonymousButton.setText("Anonymous Access"); > anonymousButton.addSelectionListener(new SelectionListener() { > public void widgetSelected(SelectionEvent e) { >- boolean selected = anonymousButton.getSelection(); >- updateAnonymousButton(selected, container); >+ setAnonymous(anonymousButton.getSelection()); > } > > public void widgetDefaultSelected(SelectionEvent e) { >@@ -172,9 +173,8 @@ > if (needsAnonymousLogin()) { > // do this after username and password widgets have been intialized > if (repository != null) { >- anonymousButton.setSelection(isAnonymousAccess()); >+ setAnonymous(isAnonymousAccess()); > } >- updateAnonymousButton(anonymousButton.getSelection(), container); > } > > // TODO: put this back if we can't get the info from all connectors >@@ -283,7 +283,13 @@ > } > } > >- private void updateAnonymousButton(boolean selected, Composite parent) { >+ public void setAnonymous(boolean selected) { >+ if (!needsAnonymousLogin) { >+ return; >+ } >+ >+ anonymousButton.setSelection(selected); >+ > if (selected) { > oldUsername = userNameEditor.getStringValue(); > oldPassword = ((StringFieldEditor) passwordEditor).getStringValue(); >@@ -294,8 +300,8 @@ > ((StringFieldEditor) passwordEditor).setStringValue(oldPassword); > } > >- userNameEditor.setEnabled(!selected, parent); >- ((StringFieldEditor) passwordEditor).setEnabled(!selected, parent); >+ userNameEditor.setEnabled(!selected, container); >+ ((StringFieldEditor) passwordEditor).setEnabled(!selected, container); > } > > protected abstract void createAdditionalControls(Composite parent); >#P org.eclipse.mylar.trac >Index: src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/sandbox/org.eclipse.mylar.trac/src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java,v >retrieving revision 1.4 >diff -u -r1.4 TracRepositorySettingsPage.java >--- src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java 14 Jul 2006 15:37:12 -0000 1.4 >+++ src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java 14 Jul 2006 19:50:10 -0000 >@@ -27,6 +27,7 @@ > import org.eclipse.mylar.internal.trac.core.ITracClient.Version; > import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnector; > import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; > import org.eclipse.swt.events.SelectionEvent; > import org.eclipse.swt.events.SelectionListener; > import org.eclipse.swt.widgets.Combo; >@@ -46,6 +47,12 @@ > > private Combo accessTypeCombo; > >+ private static TracRepositoryInfo[] REPOSITORY_TEMPLATES = { new TracRepositoryInfo("Edgewall", >+ "http://trac.edgewall.org", true, Version.TRAC_0_9), >+ // new TracRepositoryInfo("Mylar Trac Client", >+ // "http://mylar.eclipse.org/mylar-trac-client", true, Version.XML_RPC), >+ }; >+ > /** Supported access types. */ > private Version[] versions; > >@@ -58,6 +65,25 @@ > } > > protected void createAdditionalControls(final Composite parent) { >+ for (TracRepositoryInfo info : REPOSITORY_TEMPLATES) { >+ repositoryLabelCombo.add(info.label); >+ } >+ repositoryLabelCombo.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ String text = repositoryLabelCombo.getText(); >+ for (TracRepositoryInfo info : REPOSITORY_TEMPLATES) { >+ if (info.label.equals(text)) { >+ setUrl(info.url); >+ setAnonymous(info.anonymous); >+ setTracVersion(info.version); >+ getContainer().updateButtons(); >+ return; >+ } >+ } >+ } >+ }); >+ > Label accessTypeLabel = new Label(parent, SWT.NONE); > accessTypeLabel.setText("Access Type: "); > accessTypeCombo = new Combo(parent, SWT.READ_ONLY); >@@ -153,8 +179,12 @@ > } > }); > >- MessageDialog.openInformation(null, MylarTracPlugin.TITLE_MESSAGE_DIALOG, >- "Authentication credentials are valid."); >+ if (username.length() > 0) { >+ MessageDialog.openInformation(null, MylarTracPlugin.TITLE_MESSAGE_DIALOG, >+ "Authentication credentials are valid."); >+ } else { >+ MessageDialog.openInformation(null, MylarTracPlugin.TITLE_MESSAGE_DIALOG, "Repository is valid."); >+ } > > if (result[0] != null) { > setTracVersion(result[0]); >@@ -178,4 +208,23 @@ > super.getWizard().getContainer().updateButtons(); > } > >+ private static class TracRepositoryInfo { >+ >+ final String label; >+ >+ final String url; >+ >+ final boolean anonymous; >+ >+ final Version version; >+ >+ public TracRepositoryInfo(String label, String url, boolean anonymous, Version version) { >+ this.label = label; >+ this.url = url; >+ this.anonymous = anonymous; >+ this.version = version; >+ } >+ >+ } >+ > } >\ No newline at end of file
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 150677
:
46315
| 46316