Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/context/symbol/provider/IContentProposalProvider.java')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/context/symbol/provider/IContentProposalProvider.java60
1 files changed, 60 insertions, 0 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/context/symbol/provider/IContentProposalProvider.java b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/context/symbol/provider/IContentProposalProvider.java
new file mode 100644
index 000000000..87075f045
--- /dev/null
+++ b/jsf/plugins/org.eclipse.jst.jsf.common/src/org/eclipse/jst/jsf/context/symbol/provider/IContentProposalProvider.java
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2006 Oracle Corporation.
+ * 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:
+ * Cameron Bateman/Oracle - initial API and implementation
+ *
+ ********************************************************************************/
+
+package org.eclipse.jst.jsf.context.symbol.provider;
+
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * Adapts an object to appropriate content proposal
+ *
+ * @author cbateman
+ *
+ */
+public interface IContentProposalProvider
+{
+ /**
+ * @param target
+ * @param proposalFactory
+ * @return an content proposal for target or null
+ * if nothing appropriate can be created
+ */
+ ICompletionProposal[] getProposals(Object target,
+ IProposalCreationFactory proposalFactory);
+
+ /**
+ * Implementors of the class can configure certain aspects of the returned
+ * proposals
+ *
+ * @author cbateman
+ *
+ */
+ public interface IProposalCreationFactory
+ {
+ /**
+ * @param replacementText The text to be replaced
+ * @param displayText The text to be displayed in the assist window
+ * @param additionalText The text to be displayed in the "addition info"
+ * or null
+ * @param displayImage The image to be displayed or null
+ * @param sourceObject The original source object. Implementors should
+ * make no assumptions (i.e. always test instanceof before casting)
+ * @return a configured completion proposal for the parameters
+ */
+ ICompletionProposal createProposal(final String replacementText,
+ final String displayText,
+ final String additionalText,
+ final Image displayImage,
+ final Object sourceObject);
+ }
+}

Back to the top