use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method configureOutlinePresenter.
private IInformationPresenter configureOutlinePresenter(ISourceViewer sourceViewer, SourceViewerConfiguration config) {
InformationPresenter presenter = null;
// Get the quick outline configuration
AbstractQuickOutlineConfiguration cfg = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; cfg == null && i < ids.length; i++) {
cfg = (AbstractQuickOutlineConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.QUICKOUTLINECONFIGURATION, ids[i]);
}
if (cfg != null) {
presenter = new InformationPresenter(getOutlinePresenterControlCreator(cfg));
presenter.setDocumentPartitioning(config.getConfiguredDocumentPartitioning(sourceViewer));
presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
IInformationProvider provider = new SourceInfoProvider(this);
String[] contentTypes = config.getConfiguredContentTypes(sourceViewer);
for (int i = 0; i < contentTypes.length; i++) {
presenter.setInformationProvider(provider, contentTypes[i]);
}
presenter.setSizeConstraints(50, 20, true, false);
}
return presenter;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createShowInTargetIds.
/**
* Loads the Show In Target IDs from the Extended Configuration extension
* point.
*
* @return
*/
private String[] createShowInTargetIds() {
List allIds = new ArrayList(0);
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] configurationIds = getConfigurationPoints();
for (int i = 0; i < configurationIds.length; i++) {
// $NON-NLS-1$
String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]);
for (int j = 0; j < definitions.length; j++) {
String someIds = definitions[j];
if (someIds != null && someIds.length() > 0) {
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);
}
}
}
}
}
if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
allIds.add(IPageLayout.ID_RES_NAV);
}
if (!allIds.contains(IPageLayout.ID_PROJECT_EXPLORER)) {
allIds.add(IPageLayout.ID_PROJECT_EXPLORER);
}
if (!allIds.contains(IPageLayout.ID_OUTLINE)) {
allIds.add(IPageLayout.ID_OUTLINE);
}
return (String[]) allIds.toArray(new String[0]);
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createSourceViewerConfiguration.
private ConfigurationAndTarget createSourceViewerConfiguration() {
ConfigurationAndTarget cat = null;
StructuredTextViewerConfiguration cfg = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; cfg == null && i < ids.length; i++) {
cfg = (StructuredTextViewerConfiguration) builder.getConfiguration(ExtendedConfigurationBuilder.SOURCEVIEWERCONFIGURATION, ids[i]);
cat = new ConfigurationAndTarget(ids[i], cfg);
}
if (cfg == null) {
cfg = new StructuredTextViewerConfiguration();
// $NON-NLS-1$
String targetid = getClass().getName() + "#default";
cat = new ConfigurationAndTarget(targetid, cfg);
}
return cat;
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class DebugTextEditor method createShowInTargetIds.
/**
* Loads the Show In Target IDs from the Extended Configuration extension
* point.
*
* @return
*/
protected String[] createShowInTargetIds() {
List allIds = new ArrayList(0);
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] configurationIds = getConfigurationPoints();
for (int i = 0; i < configurationIds.length; i++) {
// $NON-NLS-1$
String[] definitions = builder.getDefinitions("showintarget", configurationIds[i]);
for (int j = 0; j < definitions.length; j++) {
String someIds = definitions[j];
if (someIds != null && someIds.length() > 0) {
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);
}
}
}
}
}
if (!allIds.contains(IPageLayout.ID_RES_NAV)) {
allIds.add(IPageLayout.ID_RES_NAV);
}
return (String[]) allIds.toArray(new String[0]);
}
use of org.eclipse.wst.sse.ui.internal.ExtendedConfigurationBuilder in project webtools.sourceediting by eclipse.
the class StructuredTextEditor method createSourceEditingTextTools.
/**
* @return
*/
private ISourceEditingTextTools createSourceEditingTextTools() {
ISourceEditingTextTools tools = null;
ExtendedConfigurationBuilder builder = ExtendedConfigurationBuilder.getInstance();
String[] ids = getConfigurationPoints();
for (int i = 0; tools == null && i < ids.length; i++) {
tools = (ISourceEditingTextTools) builder.getConfiguration(NullSourceEditingTextTools.ID, ids[i]);
}
if (tools == null) {
tools = NullSourceEditingTextTools.getInstance();
((NullSourceEditingTextTools) tools).setTextEditor(this);
}
// $NON-NLS-1$
Method method = null;
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { StructuredTextEditor.class });
} catch (NoSuchMethodException e) {
}
if (method == null) {
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { ITextEditor.class });
} catch (NoSuchMethodException e) {
}
}
if (method == null) {
try {
// $NON-NLS-1$
method = tools.getClass().getMethod("setTextEditor", new Class[] { IEditorPart.class });
} catch (NoSuchMethodException e) {
}
}
if (method != null) {
if (!method.isAccessible()) {
method.setAccessible(true);
}
try {
method.invoke(tools, new Object[] { this });
} catch (Exception e) {
// $NON-NLS-1$
Logger.logException("Problem creating ISourceEditingTextTools implementation", e);
}
}
return tools;
}
Aggregations