use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class DocumentRegionProcessor method getFoldingStrategy.
/**
* <p>Get the folding strategy for this processor. Retrieved from the
* extended configuration builder. The processor chosen is set by the plugin.</p>
*
* <p>EX:<br />
* <code><extension point="org.eclipse.wst.sse.ui.editorConfiguration"><br />
* <provisionalConfiguration<br />
* type="foldingstrategy"<br />
* class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"<br />
* target="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.core.xmlsource" /><br />
* </extension></code></p>
*
* <p>The type must be equal to <code>AbstractFoldingStrategy.ID</code> (AKA: foldingstrategy)
* and the class must extend <code>org.eclipse.wst.sse.ui.internal.projection.AbstractFoldingStrategy</code>
* and the target must be a structured editor content type ID</p>
*
* @return the requested folding strategy or null if none can be found
*/
protected IReconcilingStrategy getFoldingStrategy() {
if (fFoldingStrategy == null && getDocument() != null) {
String contentTypeId = getContentType(getDocument());
if (contentTypeId == null) {
contentTypeId = IContentTypeManager.CT_TEXT;
}
ITextViewer viewer = getTextViewer();
if (viewer instanceof ProjectionViewer) {
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
IContentType type = Platform.getContentTypeManager().getContentType(contentTypeId);
while (fFoldingStrategy == null && type != null) {
fFoldingStrategy = (AbstractStructuredFoldingStrategy) builder.getConfiguration(AbstractStructuredFoldingStrategy.ID, type.getId());
type = type.getBaseType();
}
if (fFoldingStrategy != null) {
fFoldingStrategy.setViewer((ProjectionViewer) viewer);
fFoldingStrategy.setDocument(getDocument());
}
}
}
return fFoldingStrategy;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createPropertySheetConfiguration.
protected PropertySheetConfiguration createPropertySheetConfiguration() {
PropertySheetConfiguration cfg = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; cfg == null && i < ids.length; i++) {
cfg = (PropertySheetConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.PROPERTYSHEETCONFIGURATION, ids[i]);
}
return cfg;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createContentOutlineConfiguration.
private ContentOutlineConfiguration createContentOutlineConfiguration() {
ContentOutlineConfiguration cfg = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; cfg == null && i < ids.length; i++) {
cfg = (ContentOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.CONTENTOUTLINECONFIGURATION, ids[i]);
}
return cfg;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method getDefinitions.
private String[] getDefinitions(String[] ids) {
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] definitions = null;
/* Iterate through the configuration ids until one is found that has
* an activecontexts definition
*/
for (int i = 0; i < ids.length; i++) {
// $NON-NLS-1$
definitions = builder.getDefinitions("activecontexts", ids[i]);
if (definitions != null && definitions.length > 0)
return definitions;
}
return null;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method collectContextMenuPreferencePages.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.texteditor.AbstractDecoratedTextEditor#collectContextMenuPreferencePages()
*/
protected String[] collectContextMenuPreferencePages() {
List allIds = new ArrayList(0);
// get contributed preference pages
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] configurationIds = getConfigurationPoints();
for (int i = 0; i < configurationIds.length; i++) {
// $NON-NLS-1$
String[] definitions = builder.getDefinitions("preferencepages", configurationIds[i]);
for (int j = 0; j < definitions.length; j++) {
String someIds = definitions[j];
if (someIds != null && someIds.length() > 0) {
// supports multiple comma-delimited page IDs in one
// element
String[] ids = StringUtils.unpack(someIds);
for (int k = 0; k < ids.length; k++) {
// trim, just to keep things clean
String id = ids[k].trim();
if (!allIds.contains(id)) {
allIds.add(id);
}
}
}
}
}
// add pages contributed by super
String[] superPages = super.collectContextMenuPreferencePages();
for (int m = 0; m < superPages.length; m++) {
// trim, just to keep things clean
String id = superPages[m].trim();
if (!allIds.contains(id)) {
allIds.add(id);
}
}
return (String[]) allIds.toArray(new String[0]);
}
Aggregations