Package org.eclipse.ui.editors.text

Examples of org.eclipse.ui.editors.text.DefaultEncodingSupport


   * @see org.eclipse.ui.texteditor.StatusTextEditor#createStatusControl(org.eclipse.swt.widgets.Composite, org.eclipse.core.runtime.IStatus)
   * @since 3.1
   */
  protected Control createStatusControl(Composite parent, final IStatus status) {
    Object adapter= getAdapter(IEncodingSupport.class);
    DefaultEncodingSupport encodingSupport= null;
    if (adapter instanceof DefaultEncodingSupport)
      encodingSupport= (DefaultEncodingSupport)adapter;

    if (encodingSupport == null || !encodingSupport.isEncodingError(status))
      return super.createStatusControl(parent, status);

    Shell shell= getSite().getShell();
    Display display= shell.getDisplay();
    Color bgColor= display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
    Color fgColor= display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);

    Composite composite= new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    composite.setBackground(bgColor);
    composite.setForeground(fgColor);

    Control control= super.createStatusControl(composite, status);
    control.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite buttonComposite= new Composite(composite, SWT.NONE);
    buttonComposite.setLayout(new GridLayout());
    buttonComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
    buttonComposite.setBackground(bgColor);
    buttonComposite.setForeground(fgColor);

    encodingSupport.createStatusEncodingChangeControl(buttonComposite, status);
//
//    Button button= new Button(buttonComposite, SWT.PUSH | SWT.FLAT);
//    button.setText(action.getText());
//    button.addSelectionListener(new SelectionAdapter() {
//      /*
 
View Full Code Here

TOP

Related Classes of org.eclipse.ui.editors.text.DefaultEncodingSupport

Copyright © 2018 www.massapicom. 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.