Package org.eclipse.wst.sse.ui.preferences

Examples of org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter


    ICompletionProposalCategoriesConfigurationReader properties = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(this.fContentTypeID);
    if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY) &&
        properties instanceof ICompletionProposalCategoriesConfigurationWriter  &&
        ((ICompletionProposalCategoriesConfigurationWriter)properties).hasAssociatedPropertiesPage()) {
     
      ICompletionProposalCategoriesConfigurationWriter propertiesExtension = (ICompletionProposalCategoriesConfigurationWriter)properties;
     
      final Shell shell= SSEUIPlugin.getActiveWorkbenchShell();
      String title= SSEUIMessages.ContentAssist_all_disabled_title;
      String message= SSEUIMessages.ContentAssist_all_disabled_message;
      // see PreferencePage#createControl for the 'defaults' label
      final String restoreButtonLabel= JFaceResources.getString("defaults"); //$NON-NLS-1$
      final String linkMessage= NLS.bind(SSEUIMessages.ContentAssist_all_disabled_preference_link, LegacyActionTools.removeMnemonics(restoreButtonLabel));
      final int restoreId= IDialogConstants.CLIENT_ID + 10;
      final int settingsId= IDialogConstants.CLIENT_ID + 11;
      final OptionalMessageDialog dialog= new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
        /*
         * @see org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
         */
        protected Control createCustomArea(Composite composite) {
          // wrap link and checkbox in one composite without space
          Composite parent= new Composite(composite, SWT.NONE);
          GridLayout layout= new GridLayout();
          layout.marginHeight= 0;
          layout.marginWidth= 0;
          layout.verticalSpacing= 0;
          parent.setLayout(layout);

          Composite linkComposite= new Composite(parent, SWT.NONE);
          layout= new GridLayout();
          layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
          layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
          layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
          linkComposite.setLayout(layout);

              Link link= new Link(linkComposite, SWT.NONE);
              link.setText(linkMessage);
              link.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                  setReturnCode(settingsId);
                  close();
                }
              });
              GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
              gridData.widthHint= this.getMinimumMessageWidth();
          link.setLayoutData(gridData);

          // create checkbox and "don't show this message" prompt
          super.createCustomArea(parent);

          return parent;
            }

        /*
         * @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
         */
        protected void createButtonsForButtonBar(Composite parent) {
              Button[] buttons= new Button[2];
          buttons[0]= createButton(parent, restoreId, restoreButtonLabel, false);
              buttons[1]= createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
              setButtons(buttons);
        }
          };
          int returnValue = dialog.open();
         
          //based on user actions either reset defaults or open preference dialog
          if (restoreId == returnValue || settingsId == returnValue) {
            if (restoreId == returnValue) {
              propertiesExtension.loadDefaults();
              propertiesExtension.saveConfiguration();
            }
            if (settingsId == returnValue) {
          PreferencesUtil.createPreferenceDialogOn(shell,
              propertiesExtension.getPropertiesPageID(), null, null).open();
            }
           
            return true;
          }
    }
View Full Code Here


   */
  public ICompletionProposalCategoriesConfigurationWriter getWritableConfiguration(String contentTypeID) {
    this.ensureLoaded();
   
    ICompletionProposalCategoriesConfigurationReader reader = getReadableConfiguration(contentTypeID);
    ICompletionProposalCategoriesConfigurationWriter writer = null;
    if(reader instanceof ICompletionProposalCategoriesConfigurationWriter) {
      writer = (ICompletionProposalCategoriesConfigurationWriter)reader;
    }
   
    return writer;
View Full Code Here

    ICompletionProposalCategoriesConfigurationReader properties = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getReadableConfiguration(this.fContentTypeID);
    if (OptionalMessageDialog.isDialogEnabled(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY) &&
        properties instanceof ICompletionProposalCategoriesConfigurationWriter  &&
        ((ICompletionProposalCategoriesConfigurationWriter)properties).hasAssociatedPropertiesPage()) {
     
      ICompletionProposalCategoriesConfigurationWriter propertiesExtension = (ICompletionProposalCategoriesConfigurationWriter)properties;
     
      final Shell shell= SSEUIPlugin.getActiveWorkbenchShell();
      String title= SSEUIMessages.ContentAssist_all_disabled_title;
      String message= SSEUIMessages.ContentAssist_all_disabled_message;
      // see PreferencePage#createControl for the 'defaults' label
      final String restoreButtonLabel= JFaceResources.getString("defaults"); //$NON-NLS-1$
      final String linkMessage= NLS.bind(SSEUIMessages.ContentAssist_all_disabled_preference_link, LegacyActionTools.removeMnemonics(restoreButtonLabel));
      final int restoreId= IDialogConstants.CLIENT_ID + 10;
      final int settingsId= IDialogConstants.CLIENT_ID + 11;
      final OptionalMessageDialog dialog= new OptionalMessageDialog(PREF_WARN_ABOUT_EMPTY_ASSIST_CATEGORY, shell, title, null /* default image */, message, MessageDialog.WARNING, new String[] { restoreButtonLabel, IDialogConstants.CLOSE_LABEL }, 1) {
        /*
         * @see org.eclipse.jdt.internal.ui.dialogs.OptionalMessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
         */
        protected Control createCustomArea(Composite composite) {
          // wrap link and checkbox in one composite without space
          Composite parent= new Composite(composite, SWT.NONE);
          GridLayout layout= new GridLayout();
          layout.marginHeight= 0;
          layout.marginWidth= 0;
          layout.verticalSpacing= 0;
          parent.setLayout(layout);

          Composite linkComposite= new Composite(parent, SWT.NONE);
          layout= new GridLayout();
          layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
          layout.marginWidth= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN);
          layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
          linkComposite.setLayout(layout);

              Link link= new Link(linkComposite, SWT.NONE);
              link.setText(linkMessage);
              link.addSelectionListener(new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) {
                  setReturnCode(settingsId);
                  close();
                }
              });
              GridData gridData= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
              gridData.widthHint= this.getMinimumMessageWidth();
          link.setLayoutData(gridData);

          // create checkbox and "don't show this message" prompt
          super.createCustomArea(parent);

          return parent;
            }

        /*
         * @see org.eclipse.jface.dialogs.MessageDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
         */
        protected void createButtonsForButtonBar(Composite parent) {
              Button[] buttons= new Button[2];
          buttons[0]= createButton(parent, restoreId, restoreButtonLabel, false);
              buttons[1]= createButton(parent, IDialogConstants.CLOSE_ID, IDialogConstants.CLOSE_LABEL, true);
              setButtons(buttons);
        }
          };
          int returnValue = dialog.open();
         
          //based on user actions either reset defaults or open preference dialog
          if (restoreId == returnValue || settingsId == returnValue) {
            if (restoreId == returnValue) {
              propertiesExtension.loadDefaults();
              propertiesExtension.saveConfiguration();
            }
            if (settingsId == returnValue) {
          PreferencesUtil.createPreferenceDialogOn(shell,
              propertiesExtension.getPropertiesPageID(), null, null).open();
            }
           
            return true;
          }
    }
View Full Code Here

  /**
   * <p>Create the contents for the content assist cycling preference group</p>
   * @param parent {@link Composite} parent of the group
   */
  private void createContentsForCyclingGroup(Composite parent) {
    ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(JSP_CONTENT_TYPE_ID);
   
    if(configurationWriter != null) {
      fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(JSP_CONTENT_TYPE_ID, configurationWriter);
      fConfigurationBlock.createContents(parent, JSPUIMessages.Cycling_UI);
    } else {
View Full Code Here

  /**
   * <p>Create the contents for the content assist cycling preference group</p>
   * @param parent {@link Composite} parent of the group
   */
  private void createContentsForCyclingGroup(Composite parent) {
    ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(JSP_CONTENT_TYPE_ID);
   
    if(configurationWriter != null) {
      fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(JSP_CONTENT_TYPE_ID, configurationWriter);
      fConfigurationBlock.createContents(parent, null);
    } else {
View Full Code Here

  /**
   * <p>Create the contents for the content assist cycling preference group</p>
   * @param parent {@link Composite} parent of the group
   */
  private void createContentsForCyclingGroup(Composite parent) {
    ICompletionProposalCategoriesConfigurationWriter configurationWriter = CompletionProposoalCatigoriesConfigurationRegistry.getDefault().getWritableConfiguration(XML_CONTENT_TYPE_ID);
   
    if(configurationWriter != null) {
      fConfigurationBlock = new CodeAssistCyclingConfigurationBlock(XML_CONTENT_TYPE_ID, configurationWriter);
      fConfigurationBlock.createContents(parent, XMLUIMessages.XMLContentAssistPreferencePage_Cycling_UI_);
    } else {
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.preferences.ICompletionProposalCategoriesConfigurationWriter

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.