01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.core.plugin;
11:
12: import org.eclipse.core.runtime.CoreException;
13:
14: /**
15: * A model object that represents the content of the fragment.xml
16: * file.
17: */
18: public interface IFragment extends IPluginBase {
19: /**
20: * A property that will be used to notify
21: * that a plugin id has changed.
22: */
23: String P_PLUGIN_ID = "plugin-id"; //$NON-NLS-1$
24: /**
25: * A property that will be used to notify
26: * that a plugin version has changed.
27: */
28: String P_PLUGIN_VERSION = "plugin-version"; //$NON-NLS-1$
29: /**
30: * A property that will be used to notify
31: * that a plugin version match rule has changed.
32: */
33: String P_RULE = "match"; //$NON-NLS-1$
34:
35: /**
36: * Returns the id of the fragment host.
37: *
38: * @return the host id
39: */
40: String getPluginId();
41:
42: /**
43: * Returns the version of the fragment host.
44: *
45: * @return the host version
46: */
47: String getPluginVersion();
48:
49: /**
50: * Returns an optional version match rule as defined in
51: * IMatchRule interface.
52: *
53: * @return the match rule
54: */
55: int getRule();
56:
57: /**
58: * Sets the id of the plug-in that will be the target of this fragment.
59: * @param id the id of the referenced plug-in.
60: * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
61: */
62: void setPluginId(String id) throws CoreException;
63:
64: /**
65: * Sets the version of the plug-in that will be the target of this fragment.'
66: * @param version the version of the referenced version.
67: * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
68: */
69: void setPluginVersion(String version) throws CoreException;
70:
71: /**
72: * Sets the optional version match rule as defined in IMatchRules. This
73: * rule will be used when attempting to match the referenced plug-in
74: * version.
75: * @param rule the match rule to be used when locating the referenced the plug-in.
76: * @exception org.eclipse.core.runtime.CoreException attempts to modify a read-only fragment will result in an exception
77: */
78: void setRule(int rule) throws CoreException;
79: }
|