Examples of TextViewer


Examples of org.eclipse.jface.text.TextViewer

    }));
       
        ToolBar batchActionBar = tbManager.createControl(groupNew);
        batchActionBar.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 2,1));

        _textViewer = new TextViewer(groupNew, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.WRAP);
        _textViewer.setDocument(new Document());
    licenceT = _textViewer.getTextWidget();
    licenceT.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 4, 1));
        licenceT.setEditable(false);
       
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

    GridDataFactory.fillDefaults().grab(true, false).applyTo(commitId);

    Label commitMessageLabel = new Label(commitGroup, SWT.NONE);
    commitMessageLabel
        .setText(UIText.RebaseResultDialog_CommitMessageLabel);
    TextViewer commitMessage = new TextViewer(commitGroup, SWT.H_SCROLL
        | SWT.V_SCROLL | SWT.MULTI | SWT.BORDER | SWT.READ_ONLY);
    GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 60)
        .applyTo(commitMessage.getControl());

    boolean conflictListFailure = false;
    DirCache dc = null;
    RevWalk rw = null;
    try {
      rw = new RevWalk(repo);
      // the commits might not have been fully loaded
      RevCommit commit = rw.parseCommit(result.getCurrentCommit());
      commitMessage.getTextWidget().setText(commit.getFullMessage());
      commitId.setText(commit.name());
      dc = repo.lockDirCache();
      for (int i = 0; i < dc.getEntryCount(); i++)
        if (dc.getEntry(i).getStage() > 0)
          conflictPaths.add(dc.getEntry(i).getPathString());
      if (conflictPaths.size() > 0) {
        message = NLS.bind(UIText.RebaseResultDialog_Conflicting,
            Integer.valueOf(conflictPaths.size()));
        messageLabel.setText(message);
      }
    } catch (IOException e) {
      // the file list will be empty
      conflictListFailure = true;
    } finally {
      if (rw != null)
        rw.release();
      if (dc != null)
        dc.unlock();
    }

    boolean mergeToolAvailable = true;
    final CheckResult checkResult;
    if (!conflictListFailure) {
      checkResult = FileChecker.checkFiles(repo, conflictPaths);
      mergeToolAvailable = checkResult.isOk();
    }
    else {
      checkResult = null;
      mergeToolAvailable = false;
    }

    if (conflictListFailure) {
      Label failureLabel = new Label(main, SWT.NONE);
      failureLabel
          .setText(UIText.RebaseResultDialog_ConflictListFailureMessage);
    } else {
      if (checkResult != null && !checkResult.isOk()) {
        Label failureLabel = new Label(main, SWT.NONE);
        failureLabel
          .setText(getProblemDescription(checkResult));
      }
      Label conflictListLabel = new Label(main, SWT.NONE);
      conflictListLabel
      .setText(UIText.RebaseResultDialog_DiffDetailsLabel);
      TableViewer conflictList = new TableViewer(main, SWT.BORDER);
      GridDataFactory.fillDefaults().span(2, 1).grab(true, true).applyTo(
          conflictList.getTable());
      conflictList.setContentProvider(ArrayContentProvider.getInstance());
      conflictList.setInput(conflictPaths);
      conflictList.setLabelProvider(new LabelProvider() {
        @Override
        public String getText(Object element) {
          String path = (String) element;
          if (checkResult != null && !checkResult.isOk()) {
            CheckResultEntry entry = checkResult.getEntry(path);
            if (entry != null) {
              if (!entry.inWorkspace)
                return UIText.RebaseResultDialog_notInWorkspace + SPACE + path;
              if (!entry.shared)
                return UIText.RebaseResultDialog_notShared + SPACE + path;
            }
          }
          return super.getText(element);
        }

      });
    }

    Group actionGroup = new Group(main, SWT.SHADOW_ETCHED_IN);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(actionGroup);
    actionGroup.setText(UIText.RebaseResultDialog_ActionGroupTitle);
    actionGroup.setLayout(new GridLayout(1, false));

    nextStepsGroup = new Group(main, SWT.SHADOW_ETCHED_IN);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(nextStepsGroup);
    nextStepsGroup.setText(UIText.RebaseResultDialog_NextSteps);
    nextStepsGroup.setLayout(new GridLayout(1, false));
    final TextViewer nextSteps = new TextViewer(nextStepsGroup, SWT.MULTI
        | SWT.BORDER | SWT.READ_ONLY);
    GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 60)
        .applyTo(nextSteps.getControl());
    nextSteps.getTextWidget().setText(
        UIText.RebaseResultDialog_NextStepsAfterResolveConflicts);

    startMergeButton = new Button(actionGroup, SWT.RADIO);
    startMergeButton.setText(UIText.RebaseResultDialog_StartMergeRadioText);
    startMergeButton.setEnabled(mergeToolAvailable);
    startMergeButton.addSelectionListener(new SelectionListener() {

      public void widgetSelected(SelectionEvent e) {
        if (startMergeButton.getSelection())
          nextSteps
              .getTextWidget()
              .setText(
                  UIText.RebaseResultDialog_NextStepsAfterResolveConflicts);
      }

      public void widgetDefaultSelected(SelectionEvent e) {
        // nothing
      }

    });

    skipCommitButton = new Button(actionGroup, SWT.RADIO);
    skipCommitButton.setText(UIText.RebaseResultDialog_SkipCommitButton);
    skipCommitButton.addSelectionListener(new SelectionListener() {

      public void widgetSelected(SelectionEvent e) {
        if (skipCommitButton.getSelection())
          nextSteps.getTextWidget().setText(""); //$NON-NLS-1$
      }

      public void widgetDefaultSelected(SelectionEvent e) {
        // nothing
      }

    });

    abortRebaseButton = new Button(actionGroup, SWT.RADIO);
    abortRebaseButton
        .setText(UIText.RebaseResultDialog_AbortRebaseRadioText);
    abortRebaseButton.addSelectionListener(new SelectionListener() {

      public void widgetSelected(SelectionEvent e) {
        if (abortRebaseButton.getSelection())
          nextSteps.getTextWidget().setText(""); //$NON-NLS-1$
      }

      public void widgetDefaultSelected(SelectionEvent e) {
        // nothing
      }

    });

    doNothingButton = new Button(actionGroup, SWT.RADIO);
    doNothingButton.setText(UIText.RebaseResultDialog_DoNothingRadioText);
    doNothingButton.addSelectionListener(new SelectionListener() {

      public void widgetSelected(SelectionEvent e) {
        if (doNothingButton.getSelection())
          nextSteps.getTextWidget().setText(
              UIText.RebaseResultDialog_NextStepsDoNothing);
      }

      public void widgetDefaultSelected(SelectionEvent e) {
        // nothing
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

          break;
        }
      if (busyLabel == null)
        throw new IllegalArgumentException();

      final TextViewer titleViewer = new TextViewer(titleRegion, SWT.READ_ONLY);
      titleViewer.setDocument(new Document(text));

      titleLabel = titleViewer.getTextWidget();
      titleLabel.setForeground(heading.getForeground());
      titleLabel.setFont(heading.getFont());
      titleLabel.addFocusListener(new FocusAdapter() {
        public void focusLost(FocusEvent e) {
          titleLabel.setSelection(0);
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

  @Before
  public void setUp() throws Exception {
    detector = new CommitHyperlinkDetector();
    Shell shell = new Shell();
    textViewer = new TextViewer(shell, SWT.NONE);
    textViewer.setDocument(new Document());
  }
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

    {
        ToolBar toolBar;
        Composite composite;
        CTabFolder messageTabFolder;
        CTabItem sourceTab;
        TextViewer sourceViewer;
       
        Browser browser;
        GridData gridData;
        ToolItem btnReply;
        ToolItem btnReplyAll;
        ToolItem btnForward;
        ToolItem btnDelete;
        ToolItem btnSpam;
       
        ToolItem btnCreateFilter;
       
        GridLayout gridLayout;
        ComboViewer labelViewer;
       
        ExpandableComposite expandableComposite;
        Composite composite_1;
        FormText receiversText;
        parent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
        parent.setLayout(new GridLayout());
       
        composite = this.toolkit.createComposite(parent, SWT.NONE);
        composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
        composite.setBackgroundMode(SWT.INHERIT_FORCE);
        gridLayout = new GridLayout();
        gridLayout.numColumns = 5;
        composite.setLayout(gridLayout);
        this.toolkit.paintBordersFor(composite);
       
        toolBar = new ToolBar(composite, SWT.FLAT);
        toolBar.setBackgroundMode(SWT.INHERIT_FORCE);
        gridData = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
        gridData.horizontalIndent = 5;
        toolBar.setLayoutData(gridData);
        this.toolkit.adapt(toolBar, true, true);
       
        btnReply = new ToolItem(toolBar, SWT.PUSH);
        btnReply.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/reply_small.png"));
        btnReply.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnReply.toolTipText")); //$NON-NLS-1$
       
        btnReplyAll = new ToolItem(toolBar, SWT.PUSH);
        btnReplyAll.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/reply_all_small.png"));
        btnReplyAll.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnReplyAll.toolTipText")); //$NON-NLS-1$
       
        btnForward = new ToolItem(toolBar, SWT.PUSH);
        btnForward.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/forward_small.png"));
        btnForward.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnForward.toolTipText")); //$NON-NLS-1$
       
        new ToolItem(toolBar, SWT.SEPARATOR);
       
        btnDelete = new ToolItem(toolBar, SWT.PUSH);
        btnDelete.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/delete_small.png"));
        btnDelete.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnDelete.toolTipText")); //$NON-NLS-1$
       
        btnSpam = new ToolItem(toolBar, SWT.CHECK);
        btnSpam.setHotImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/virus-detected.png"));
        btnSpam.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/virus-detected-2.png"));
        btnSpam.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnSpam.toolTipText")); //$NON-NLS-1$
       
        new ToolItem(toolBar, SWT.SEPARATOR);
       
        btnCreateFilter = new ToolItem(toolBar, SWT.PUSH);
        btnCreateFilter.setImage(SWTResourceManager.getImage(SimpleMessageEditor.class, "/icons/kview.png"));
        btnCreateFilter.setToolTipText(MessageEditorMessages.getString("MessageEditor.btnCreateFilter.toolTipText")); //$NON-NLS-1$
       
        this.toolkit.createLabel(composite, MessageEditorMessages.getString("MessageEditor.label.text"), SWT.NONE); //$NON-NLS-1$
       
        labelViewer = new ComboViewer(composite, SWT.READ_ONLY);
        labelViewer.setLabelProvider(new ListLabelProvider());
        labelViewer.setContentProvider(new ContentProvider_1());
        labelViewer.setInput(new Object());
        this.combo = labelViewer.getCombo();
        this.toolkit.adapt(this.combo, true, true);
        this.combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
        new Label(composite, SWT.NONE);
        expandableComposite = this.toolkit.createExpandableComposite(composite, ExpandableComposite.COMPACT
                                                                                | ExpandableComposite.TWISTIE
                                                                                | ExpandableComposite.NO_TITLE
                                                                                | ExpandableComposite.FOCUS_TITLE);
        gridData = new GridData(SWT.FILL, SWT.CENTER, true, false, 4, 1);
        gridData.widthHint = 295;
        expandableComposite.setLayoutData(gridData);
        expandableComposite.setText("Empf�nger");
        this.toolkit.paintBordersFor(expandableComposite);
        composite_1 = this.toolkit.createComposite(expandableComposite, SWT.NONE);
        this.toolkit.paintBordersFor(composite_1);
        expandableComposite.setClient(composite_1);
        receiversText = this.toolkit.createFormText(composite_1, false);
       
        this.lnkTo = this.toolkit.createImageHyperlink(receiversText, SWT.NONE);
        this.lnkTo.setBounds(0, 0, 130, 24);
        this.lnkTo.setImage(SWTResourceManager.getImage(MessageEditor.class, "/icons/abcard-item.png"));
        this.lnkTo.setToolTipText("to: dummy@spotnik.de");
        this.lnkTo.setText("Dummy");
       
        this.lnkCC = this.toolkit.createImageHyperlink(receiversText, SWT.NONE);
        this.lnkCC.setBounds(0, 0, 97, 24);
        this.lnkCC.setImage(SWTResourceManager.getImage(MessageEditor.class, "/icons/ablist-item.png"));
        this.lnkCC.setText("Jack Black");
       
        receiversText.setControl("to", this.lnkTo);
        receiversText.setControl("cc", this.lnkCC);
       
        receiversText.setText("<form><p><control href=\"to\" /> <control href=\"cc\" /></p></form>", true, true);
       
        new Label(composite, SWT.NONE);
        new Label(composite, SWT.NONE);
        new Label(composite, SWT.NONE);
       
        messageTabFolder = new CTabFolder(parent, SWT.BOTTOM | SWT.FLAT);
        gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        messageTabFolder.setLayoutData(gridData);
        messageTabFolder.setSelectionBackground(
                                                new Color[] {
                                                             Display.getCurrent().getSystemColor(
                                                                                                 SWT.COLOR_TITLE_BACKGROUND),
                                                             Display.getCurrent().getSystemColor(
                                                                                                 SWT.COLOR_TITLE_BACKGROUND_GRADIENT),
                                                             Display.getCurrent().getSystemColor(
                                                                                                 SWT.COLOR_WIDGET_BACKGROUND) },
                                                new int[] { 50, 100 });
        messageTabFolder.setBorderVisible(true);
        messageTabFolder.setBackgroundMode(SWT.INHERIT_FORCE);
        this.toolkit.adapt(messageTabFolder, true, true);
       
        CTabItem emailTab = new CTabItem(messageTabFolder, SWT.NONE);
        emailTab.setText(MessageEditorMessages.getString("MessageEditor.emailTab.text")); //$NON-NLS-1$
       
        Composite emailComposite = new Composite(messageTabFolder, SWT.NONE);
        emailComposite.setLayout(new FillLayout());
        this.toolkit.adapt(emailComposite);
        emailTab.setControl(emailComposite);
       
        browser = new Browser(emailComposite, SWT.NONE);
        this.toolkit.adapt(browser, true, true);
        browser.setUrl("file:///D:/spotnik.workspace/de.spotnik.mail.core/src/main/resources/message.html");
       
        sourceTab = new CTabItem(messageTabFolder, SWT.NONE);
        sourceTab.setText(MessageEditorMessages.getString("MessageEditor.sourceTab.text")); //$NON-NLS-1$
       
        Composite sourceComposite = new Composite(messageTabFolder, SWT.NONE);
        sourceComposite.setLayout(new FillLayout());
        this.toolkit.adapt(sourceComposite);
        sourceTab.setControl(sourceComposite);
       
        sourceViewer = new TextViewer(sourceComposite, SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL);
        sourceViewer.setEditable(false);
        this.sourceText = sourceViewer.getTextWidget();
        this.toolkit.adapt(this.sourceText, true, true);
        sourceViewer.setInput(new Object());
        //
    }
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

        Composite sourceComposite = new Composite(messageTabFolder, SWT.NONE);
        sourceComposite.setLayout(new FillLayout());
        this.toolkit.adapt(sourceComposite);
        sourceTab.setControl(sourceComposite);
       
        this.sourceViewer = new TextViewer(sourceComposite, SWT.V_SCROLL | SWT.MULTI | SWT.READ_ONLY | SWT.H_SCROLL);
        this.sourceViewer.setEditable(false);
        this.toolkit.adapt(sashForm, true, true);
       
        composite = this.toolkit.createComposite(sashForm, SWT.NONE);
        composite.setBackgroundMode(SWT.INHERIT_FORCE);
View Full Code Here

Examples of org.eclipse.jface.text.TextViewer

        }
    }

    public void onCreateSourceViewer(ISourceViewer viewer) {
        if (viewer instanceof TextViewer) {
            TextViewer textViewer = (TextViewer) viewer;
            ((TextViewer) viewer).appendVerifyKeyListener(PyBackspace.createVerifyKeyListener(textViewer, null));
        }
    }
View Full Code Here
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.