Package org.dozer.eclipse.plugin.sourcepage

Source Code of org.dozer.eclipse.plugin.sourcepage.DozerStructuredTextViewerConfiguration

/**
* Copyright 2005-2013 Dozer Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.dozer.eclipse.plugin.sourcepage;

import org.dozer.eclipse.plugin.sourcepage.contentassist.DozerContentAssistProcessor;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.wst.sse.core.text.IStructuredPartitions;
import org.eclipse.wst.xml.core.text.IXMLPartitions;
import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;

public class DozerStructuredTextViewerConfiguration extends
    StructuredTextViewerConfigurationXML {

  @Override
  public IContentAssistProcessor[] getContentAssistProcessors(
      ISourceViewer sourceViewer, String partitionType) {

    IContentAssistProcessor[] processors;

    if (partitionType == IStructuredPartitions.DEFAULT_PARTITION
        || partitionType == IXMLPartitions.XML_DEFAULT) {
      //adding the DozerContentAssistProcessor to XML partions of the sourceview
      processors = new IContentAssistProcessor[] { new DozerContentAssistProcessor() };
    } else {
      processors = super.getContentAssistProcessors(sourceViewer, partitionType);
    }
   
    return processors;
  }

}
TOP

Related Classes of org.dozer.eclipse.plugin.sourcepage.DozerStructuredTextViewerConfiguration

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.