Package org.eclipse.wst.sse.ui.internal

Examples of org.eclipse.wst.sse.ui.internal.StructuredTextViewer


        Messages.getString("AbstractNamespaceMasterPart.MOVE_UP_BUTTON"), SWT.FLAT); //$NON-NLS-1$
    upButton.setLayoutData(data);
    upButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        StructuredTextViewer textView = getConfigEditor().getTextViewer();
        Action action = new RaiseNodeAction(treeViewer, xmlProcessor, textView);
        action.run();
      }
    });
    upButton.setEnabled(false);

    downButton = toolkit.createButton(client,
        Messages.getString("AbstractNamespaceMasterPart.MOVE_DOWN_BUTTON"), SWT.FLAT); //$NON-NLS-1$
    downButton.setLayoutData(data);
    downButton.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        StructuredTextViewer textView = getConfigEditor().getTextViewer();
        Action action = new LowerNodeAction(treeViewer, xmlProcessor, textView);
        action.run();
      }
    });
    downButton.setEnabled(false);
View Full Code Here


   *
   * @param manager the menu manager on the master viewer
   * @param parent the selected XML node
   */
  protected void createNodeInsertActions(IMenuManager manager, IDOMElement parent) {
    StructuredTextViewer textView = getConfigEditor().getTextViewer();
    Map<String, List<String>> childMap = getChildNames(parent);
    if (childMap.keySet().size() > 1) {
      for (String prefix : childMap.keySet()) {
        MenuManager subManager;
        String label;
View Full Code Here

  }

  @Override
  protected void fillContextMenu(IMenuManager manager) {
    IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection();
    StructuredTextViewer textView = getConfigEditor().getTextViewer();
    if (!selection.isEmpty()) {
      Object obj = selection.getFirstElement();
      if (obj != null && obj instanceof IDOMElement) {
        IDOMElement node = (IDOMElement) obj;
        createNodeInsertActions(manager, node);
View Full Code Here

          versionViewer.setCheckedElements(new Object[0]);
          selectedVersions.remove(selectedNamespaceDefinition);
        }

        if (getMasterPart() instanceof NamespacesMasterPart) {
          StructuredTextViewer textView = getConfigEditor().getTextViewer();
          IDOMDocument doc = getConfigEditor().getDomDocument();
          doc.getModel().beginRecording(textView);

          NamespacesMasterPart namespaceMaster = (NamespacesMasterPart) getMasterPart();
          namespaceMaster.updateXsdVersion();
View Full Code Here

    getNamespaceDefinitionList();
  }

  protected void addXsdDefinition(INamespaceDefinition definition) {
    if (!existsInConfiguration(definition)) {
      StructuredTextViewer textView = getConfigEditor().getTextViewer();
      IDOMDocument doc = getConfigEditor().getDomDocument();
      doc.getModel().beginRecording(textView);

      if (rootElement == null) {
        // Create a beans element and add the default namespace
View Full Code Here

    super.refresh();
  }

  protected void removeXsdDefinition(INamespaceDefinition definition) {
    if (existsInConfiguration(definition)) {
      StructuredTextViewer textView = getConfigEditor().getTextViewer();
      IDOMDocument doc = getConfigEditor().getDomDocument();
      doc.getModel().beginRecording(textView);

      rootElement.removeAttribute(ConfigCoreUtils.ATTR_NAMESPACE_PREFIX
          + definition.getNamespacePrefix(getConfigEditor().getResourceFile()));
View Full Code Here

   * @param attrName the attribute name
   * @param newValue the new attribute value
   */
  public void editAttribute(String attrName, String newValue) {
    if (input != null && input.getParentNode() != null) {
      StructuredTextViewer textView = editor.getTextViewer();
      input.getModel().beginRecording(textView);

      String existingValue = getAttributeValue(attrName);
      // If new value is empty...
      if (newValue == null || newValue.trim().equals("")) { //$NON-NLS-1$
View Full Code Here

      if (editor instanceof IConfigEditor) {
        IConfigEditor configEditor = (IConfigEditor) editor;
        int startOffset = bean.getStartOffset();
        int length = bean.getEndOffset() - startOffset;

        StructuredTextViewer textViewer = configEditor.getTextViewer();
        textViewer.setRangeIndication(startOffset, length, true);
        textViewer.revealRange(startOffset, length);
      }

      newBean = bean;
    }
    catch (IOException e) {
View Full Code Here

  public void testLowerBeforeRaise() throws Exception {
    cEditor = openFileInEditor("src/many-beans.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
View Full Code Here

  public void testRaiseBeforeLower() throws Exception {
    cEditor = openFileInEditor("src/many-beans.xml");
    assertNotNull("Could not open a configuration editor.", cEditor);

    AbstractConfigFormPage page = cEditor.getFormPage(OverviewFormPage.ID);
    StructuredTextViewer textView = cEditor.getTextViewer();
    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.StructuredTextViewer

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.