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 149740 Details for
Bug 291283
Sharing a single project using Quick Access
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
the final patch version
0001-Share-a-single-project-using-Quick-Access.patch (text/plain), 7.01 KB, created by
Mykola Nikishov
on 2009-10-16 08:11:01 EDT
(
hide
)
Description:
the final patch version
Filename:
MIME Type:
Creator:
Mykola Nikishov
Created:
2009-10-16 08:11:01 EDT
Size:
7.01 KB
patch
obsolete
>From aea8e858194e94671d98245eab59656dd49cede6 Mon Sep 17 00:00:00 2001 >From: Mykola Nikishov <mn@mn.com.ua> >Date: Sun, 4 Oct 2009 02:02:45 +0300 >Subject: [PATCH] Share a single project using Quick Access > >Implements sharing a single project using Quick Access with a keyboard >from the almost any place of the workspace: >- activate Quick Access (which is bound to Ctrl+3 by default) >- typing SWG (which means 'share with Git') will provide user with a list > of all currently open projects not connected to any team provider >- 'Configure Git Repository' dialog with a selected project would be > presented to user > >Bug: https://bugs.eclipse.org/291283 >Signed-off-by: Mykola Nikishov <mn@mn.com.ua> >Change-Id: I13a286001c27739b1b6aebfe564c115de4ab368e >--- > org.eclipse.egit.ui/plugin.properties | 3 + > org.eclipse.egit.ui/plugin.xml | 15 ++++++ > .../commands/ProjectNameParameterValues.java | 41 ++++++++++++++++ > .../commands/ShareSingleProjectCommand.java | 51 ++++++++++++++++++++ > 4 files changed, 110 insertions(+), 0 deletions(-) > create mode 100644 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java > create mode 100644 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java > >diff --git a/org.eclipse.egit.ui/plugin.properties b/org.eclipse.egit.ui/plugin.properties >index 989dbb9..2fdbb24 100644 >--- a/org.eclipse.egit.ui/plugin.properties >+++ b/org.eclipse.egit.ui/plugin.properties >@@ -77,3 +77,6 @@ GitPreferences_name=Git > GitPreferences_HistoryPreferencePage_name=History > GitPreferences_WindowCachePreferencePage_name=Window Cache > GitPreferences_DecoratorPreferencePage_name=Label Decorations >+ >+ShareProjectCommand_name=Share with Git >+ShareProjectCommand_desc=Share the project using Git >diff --git a/org.eclipse.egit.ui/plugin.xml b/org.eclipse.egit.ui/plugin.xml >index ae9f083..f3099cd 100644 >--- a/org.eclipse.egit.ui/plugin.xml >+++ b/org.eclipse.egit.ui/plugin.xml >@@ -385,4 +385,19 @@ > </action> > </actionSet> > </extension> >+ <extension >+ point="org.eclipse.ui.commands"> >+ <command >+ defaultHandler="org.eclipse.egit.ui.internal.commands.ShareSingleProjectCommand" >+ description="%ShareProjectCommand_desc" >+ id="org.eclipse.egit.ui.command.shareProject" >+ name="%ShareProjectCommand_name"> >+ <commandParameter >+ id="org.eclipse.egit.ui.command.projectNameParameter" >+ name="Project" >+ optional="false" >+ values="org.eclipse.egit.ui.internal.commands.ProjectNameParameterValues"> >+ </commandParameter> >+ </command> >+ </extension> > </plugin> >diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java >new file mode 100644 >index 0000000..ae0e6b9 >--- /dev/null >+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ProjectNameParameterValues.java >@@ -0,0 +1,41 @@ >+/******************************************************************************* >+ * Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua> >+ * >+ * 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+package org.eclipse.egit.ui.internal.commands; >+ >+import java.util.HashMap; >+import java.util.Map; >+ >+import org.eclipse.core.commands.IParameterValues; >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.IWorkspaceRoot; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.team.core.RepositoryProvider; >+ >+/** >+ * Provides list of accessible and non-shared projects' names for the Share >+ * Project command. >+ * >+ * @since 0.6.0 >+ */ >+public class ProjectNameParameterValues implements IParameterValues { >+ >+ public Map getParameterValues() { >+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); >+ IProject[] projects = root.getProjects(); >+ Map<String, String> paramValues = new HashMap<String, String>(); >+ for (IProject project : projects) { >+ final boolean notAlreadyShared = RepositoryProvider >+ .getProvider(project) == null; >+ if (project.isAccessible() && notAlreadyShared) >+ paramValues.put(project.getName(), project.getName()); >+ } >+ return paramValues; >+ } >+ >+} >diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java >new file mode 100644 >index 0000000..5dbdf85 >--- /dev/null >+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/ShareSingleProjectCommand.java >@@ -0,0 +1,51 @@ >+/******************************************************************************* >+ * Copyright (C) 2009, Mykola Nikishov <mn@mn.com.ua> >+ * >+ * 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+package org.eclipse.egit.ui.internal.commands; >+ >+import org.eclipse.core.commands.AbstractHandler; >+import org.eclipse.core.commands.ExecutionEvent; >+import org.eclipse.core.commands.ExecutionException; >+import org.eclipse.core.resources.IProject; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.egit.ui.internal.sharing.SharingWizard; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.team.internal.ui.wizards.ConfigureProjectWizard; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.handlers.HandlerUtil; >+ >+/** >+ * Provides a handler for the Share Project command. This can then be bound to >+ * whatever keybinding the user prefers. >+ * >+ * @since 0.6.0 >+ */ >+public class ShareSingleProjectCommand extends AbstractHandler { >+ >+ private static final String PROJECT_NAME_PARAMETER = "org.eclipse.egit.ui.command.projectNameParameter"; //$NON-NLS-1$ >+ >+ /** >+ * Invokes 'Configure Git Repository' dialog to share given project. >+ * >+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent) >+ */ >+ public Object execute(ExecutionEvent event) throws ExecutionException { >+ final String projectName = event.getParameter(PROJECT_NAME_PARAMETER); >+ final IProject projectToShare = ResourcesPlugin.getWorkspace() >+ .getRoot().getProject(projectName); >+ IWorkbench workbench = HandlerUtil.getActiveWorkbenchWindow(event) >+ .getWorkbench(); >+ >+ final SharingWizard wizard = new SharingWizard(); >+ wizard.init(workbench, projectToShare); >+ final Shell shell = HandlerUtil.getActiveShell(event); >+ ConfigureProjectWizard.openWizard(shell, wizard); >+ return null; >+ } >+ >+} >-- >1.6.5 >
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
Flags:
sop
:
iplog+
sop
:
review+
Actions:
View
|
Diff
Attachments on
bug 291283
:
148716
| 149740