Package org.eclipse.ui.texteditor

Examples of org.eclipse.ui.texteditor.ResourceAction


   */
  public EncodingActionGroup(ITextEditor editor) {

    fTextEditor= editor;

    ResourceAction a;
    if (SYSTEM_ENCODING != null) {
      a= new PredefinedEncodingAction(TextEditorMessages.getBundleForConstructedKeys(), SYSTEM_ENCODING, editor);
      a.setHelpContextId(IEncodingActionsHelpContextIds.SYSTEM);
      a.setActionDefinitionId(IEncodingActionsDefinitionIds.SYSTEM);
      editor.setAction(IEncodingActionsConstants.SYSTEM, a);
    }

    for (int i= 0; i < ENCODINGS.length; i++) {
      a= new PredefinedEncodingAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ConvertEncoding." + ENCODINGS[i][0] + ".", ENCODINGS[i][0], editor); //$NON-NLS-1$ //$NON-NLS-2$
      a.setHelpContextId( ENCODINGS[i][1]);
      a.setActionDefinitionId( ENCODINGS[i][2]);
      editor.setAction(ENCODINGS[i][0], a);
    }

    a= new CustomEncodingAction(TextEditorMessages.getBundleForConstructedKeys(), "Editor.ConvertEncoding." + IEncodingActionsConstants.CUSTOM + ".", editor); //$NON-NLS-1$ //$NON-NLS-2$
    a.setHelpContextId(IEncodingActionsHelpContextIds.CUSTOM);
    a.setActionDefinitionId(IEncodingActionsDefinitionIds.CUSTOM);
    editor.setAction(IEncodingActionsConstants.CUSTOM, a);
  }
View Full Code Here


    /**
     * Creates the actions.
     */
    private void initializeActions() {
        inheritAction = new ResourceAction(ThemesMessages.getResourceBundle(),
                RESOURCE_PREFIX + "allToInherit.") {
            // Javadoc inherited
            public void run() {
                ISelection selection = categoryTreeViewer.getSelection();
                if (selection instanceof IStructuredSelection) {
                    BeanProxy stylePropertiesProxy =
                            (BeanProxy) stylePropertiesProxyProvider.getProxy();
                    IStructuredSelection structuredSelection =
                            (IStructuredSelection) selection;
                    Iterator categories = structuredSelection.iterator();
                    while (categories.hasNext()) {
                        StyleCategory category = (StyleCategory) categories.next();
                        Iterator it = category.getProperties().iterator();
                        while (it.hasNext()) {
                            StyleProperty details = (StyleProperty) it.next();
                            PropertyIdentifier identifier = ThemeModel.
                                getPropertyIdentifierForStyleProperty(details);
                            Proxy propertyProxy =
                                    stylePropertiesProxy.getPropertyProxy(identifier);
                            PropertyValue value =
                                ThemeFactory.getDefaultInstance().
                                    createPropertyValue(
                                        details, THEME_FACTORY.getInherit());
                            propertyProxy.setModelObject(value);
                        }
                    }
                    stylePropertiesProxyReceiver.setProxy(stylePropertiesProxy);
                }
            }
        };

        priorityAction = new ResourceAction(
                    ThemesMessages.getResourceBundle(),
                    RESOURCE_PREFIX + "allToImportant.") {
            // Javadoc inherited
            public void run() {
                ISelection selection = categoryTreeViewer.getSelection();
View Full Code Here

TOP

Related Classes of org.eclipse.ui.texteditor.ResourceAction

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.