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 101387 Details for
Bug 224278
Add Ganymede Update Site
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.
Work in progress to introduce an add repository action
patch.txt (text/plain), 5.52 KB, created by
John Arthorne
on 2008-05-21 16:54:47 EDT
(
hide
)
Description:
Work in progress to introduce an add repository action
Filename:
MIME Type:
Creator:
John Arthorne
Created:
2008-05-21 16:54:47 EDT
Size:
5.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.p2.touchpoint.eclipse >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ActionConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ActionConstants.java,v >retrieving revision 1.3 >diff -u -r1.3 ActionConstants.java >--- src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ActionConstants.java 24 Apr 2008 22:35:46 -0000 1.3 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/ActionConstants.java 21 May 2008 20:53:42 -0000 >@@ -37,4 +37,8 @@ > public static final String PARM_TARGET_FILE = "targetFile"; //$NON-NLS-1$ > public static final String PARM_PERMISSIONS = "permissions"; //$NON-NLS-1$ > >+ public static final String PARM_REPOSITORY_LOCATION = "location"; //$NON-NLS-1$ >+ public static final String PARM_REPOSITORY_TYPE = "type"; //$NON-NLS-1$ >+ public static final String PARM_REPOSITORY_ENABLEMENT = "enabled"; //$NON-NLS-1$ >+ > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.equinox/p2/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF,v >retrieving revision 1.24 >diff -u -r1.24 MANIFEST.MF >--- META-INF/MANIFEST.MF 25 Apr 2008 19:09:45 -0000 1.24 >+++ META-INF/MANIFEST.MF 21 May 2008 20:53:42 -0000 >@@ -13,6 +13,7 @@ > org.eclipse.equinox.internal.provisional.frameworkadmin, > org.eclipse.equinox.internal.provisional.p2.artifact.repository, > org.eclipse.equinox.internal.provisional.p2.core, >+ org.eclipse.equinox.internal.provisional.p2.core.eventbus, > org.eclipse.equinox.internal.provisional.p2.core.location, > org.eclipse.equinox.internal.provisional.p2.core.repository, > org.eclipse.equinox.internal.provisional.p2.engine, >Index: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java >=================================================================== >RCS file: src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java >diff -N src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/AddRepositoryAction.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,70 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 IBM Corporation 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions; >+ >+import java.net.MalformedURLException; >+import java.net.URL; >+import java.util.Map; >+import org.eclipse.core.runtime.*; >+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; >+import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Activator; >+import org.eclipse.equinox.internal.p2.touchpoint.eclipse.Util; >+import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; >+import org.eclipse.equinox.internal.provisional.p2.core.repository.RepositoryEvent; >+import org.eclipse.equinox.internal.provisional.p2.engine.ProvisioningAction; >+import org.eclipse.osgi.util.NLS; >+ >+/** >+ * >+ */ >+public class AddRepositoryAction extends ProvisioningAction { >+ public static final String ID = "addRepository"; //$NON-NLS-1$ >+ >+ private RepositoryEvent createEvent(Map parameters) throws CoreException { >+ String parm = (String) parameters.get(ActionConstants.PARM_REPOSITORY_LOCATION); >+ if (parm == null) >+ throw new CoreException(Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_REPOSITORY_LOCATION, ID))); >+ URL location = null; >+ try { >+ location = new URL(parm); >+ } catch (MalformedURLException e) { >+ throw new CoreException(Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_REPOSITORY_LOCATION, ID), e)); >+ } >+ parm = (String) parameters.get(ActionConstants.PARM_REPOSITORY_TYPE); >+ if (parm == null) >+ throw new CoreException(Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_REPOSITORY_TYPE, ID))); >+ int type = 0; >+ try { >+ type = Integer.parseInt(parm); >+ } catch (NumberFormatException e) { >+ throw new CoreException(Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_REPOSITORY_TYPE, ID), e)); >+ } >+ boolean enabled = Boolean.parseBoolean((String) parameters.get(ActionConstants.PARM_REPOSITORY_ENABLEMENT)); >+ return new RepositoryEvent(location, type, RepositoryEvent.DISCOVERED, enabled); >+ } >+ >+ public IStatus execute(Map parameters) { >+ IProvisioningEventBus bus = (IProvisioningEventBus) ServiceHelper.getService(Activator.getContext(), IProvisioningEventBus.SERVICE_NAME); >+ try { >+ if (bus != null) >+ bus.publishEvent(createEvent(parameters)); >+ return Status.OK_STATUS; >+ } catch (CoreException e) { >+ return e.getStatus(); >+ } >+ } >+ >+ public IStatus undo(Map parameters) { >+ //no generic way to remove a repository >+ return Status.OK_STATUS; >+ } >+ >+}
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 224278
: 101387 |
101619
|
101633