Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.SashForm


 
  protected void initialize() {
    System.out.println("MUCBrowserGUI initialize ...");
    this.setLayout(new FillLayout());
    rootSashForm = new SashForm(this, SWT.HORIZONTAL);
    rootSashForm.setLayout(new FillLayout());
    rootSashForm.addListener(SWT.FocusIn, focusInListener);
    createChatGUI(rootSashForm);
    createUserList();
    rootSashForm.setWeights(new int[] { 75, 25 });
View Full Code Here


    Control c = xtra.getParent();
    while (!(c instanceof ScrolledComposite))
      c = c.getParent();
    ((GridData) xtra.getLayoutData()).widthHint = c.getSize().x;
    ((GridData) xtra.getLayoutData()).heightHint = c.getSize().y;
    sashForm = new SashForm(xtra, SWT.HORIZONTAL);

    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); // needed

    leftPanel = newComposite(sashForm);
    ((GridLayout) leftPanel.getLayout()).marginHeight = 5;
View Full Code Here

   * This is a callback that will allow us
   * to create the viewer and initialize it.
   */
  public void createPartControl(Composite parent) {
    parent.setLayout(new FillLayout());
    SashForm sf = new SashForm(parent, SWT.HORIZONTAL);
    initMain(sf);
    initPool(sf);
    sf.setWeights(new int[]{8,2});
  }
View Full Code Here

    Control c = xtra.getParent();
    while (!(c instanceof ScrolledComposite))
      c = c.getParent();
    ((GridData) xtra.getLayoutData()).widthHint = c.getSize().x;
    ((GridData) xtra.getLayoutData()).heightHint = c.getSize().y;
    sashForm = new SashForm(xtra, SWT.HORIZONTAL);

    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); // needed

    leftPanel = newComposite(sashForm);
    ((GridLayout) leftPanel.getLayout()).marginHeight = 5;
View Full Code Here

   * This is a callback that will allow us
   * to create the viewer and initialize it.
   */
  public void createPartControl(Composite parent) {
   
    sashForm = new SashForm(parent, SWT.NONE);
    sashForm.setSashWidth(5);
   
    serverTreeViewer = new TreeViewer(sashForm, SWT.BORDER);
    serverTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
View Full Code Here

  protected Control createContents(Composite parent)
    {
    getShell().setText("Smart Trace");
    getShell().setSize(900, 500);
   
    SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
   
    SashForm sashForm2 = new SashForm(sashForm, SWT.HORIZONTAL);
    summary = new Show().crearVisorSummary(sashForm2);
    events = new Show().crearVisorEventos(sashForm2);
    sashForm2.setWeights(new int[]{30, 100});
   
    stackTrace = new Show().crearVisorStackTrace(sashForm);
   
    events.addSelectionChangedListener(new ISelectionChangedListener()
      {
View Full Code Here

    });
    filter.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
        .create());
    topBar.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
        .create());
    final SashForm owner = new SashForm(parent, SWT.VERTICAL);
    owner.setLayoutData(GridDataFactory.fillDefaults().grab(true, true)
        .create());
    Composite c = new Composite(owner, SWT.NONE);
    c.setLayout(new FillLayout());
    logViewer = new LogViewer(c);

    logViewer.configure(new ViewerConfiguration("Message", "",
        new LogViewerContentProvider(), new FilterMode[] {}, false,
        false, LogViewColumn.getLogColumns()));
    logViewer.getTreeViewer().addFilter(new ViewerFilter() {
     
     
      public boolean select(Viewer viewer, Object parentElement, Object element) {
        boolean cm = cm(element);
        if (!cm){
          if (element instanceof LogItem){
            LogItem z=(LogItem) element;
            ILogItem[] parts = z.getParts();
            for (ILogItem m:parts){
              if (cm(m)){
                return true;
              }
            }
          }
          else{
            if (cm(parentElement)){
              return true;
            }
          }
        }
        return cm;
      }
    });
    final TextConsole console = new TextConsole("console",
        "javaStackTraceConsole", null, false) {

     
      public String getType() {
        return super.getType();
      }

     
      protected IConsoleDocumentPartitioner getPartitioner() {
        return new MM(this);
      }
    };
    final TextConsoleViewer sv = new TextConsoleViewer(owner, console);
    ConsolePlugin.getDefault().getConsoleManager()
        .createPatternMatchListeners(console);
    IDocument document = console.getDocument();
    document.setDocumentPartitioner(new MM(console));
    logViewer.setFilter(new IFilter(){

      public boolean accept(Object o) {
        return true;
      }

      public Point match(String text) {
        if (filterText!=null&&filterText.length()>0){
          int indexOf = text.indexOf(filterText);
          if (indexOf!=-1){
            return new Point(indexOf,filterText.length());
          }
        }
        return new Point(0,0);
      }
     
    });
    sv.getTextWidget().setEditable(false);
    // sv.setDocument(document);

    // sv.getTextWidget().setFont(JFaceResources.getTextFont());
    logViewer.getSelectionProvider().addSelectionChangedListener(
        new ISelectionChangedListener() {

          public void selectionChanged(SelectionChangedEvent event) {
            if (!event.getSelection().isEmpty()) {
              IStructuredSelection sm = (IStructuredSelection) event
                  .getSelection();
              Object firstElement = sm.getFirstElement();
              ILogItem item = (ILogItem) firstElement;

              sv.getDocument().set(item.getMessage());
              Display.getCurrent().asyncExec(new Runnable() {

                public void run() {
                  sv.getTextWidget().redraw();
                }
              });
            }
          }
        });

    owner.setWeights(new int[] { 30, 50 });
    IMenuManager menuManager = getViewSite().getActionBars()
        .getMenuManager();
    menuManager.add(new Action("Settings") {
      public void run() {
        final Binding bnd=new Binding(LogViewPart.this);
        bnd.setAutoCommit(false);
        bnd.setReadOnly(false);
        Container r=new Container();
        IContainerLayoutManager ca=new OneElementOnLineLayouter();
        OneLineTextElement<Integer>str=new OneLineTextElement<Integer>(bnd.getBinding("days"));
        ComboEnumeratedValueSelector<Integer>sev=new ComboEnumeratedValueSelector<Integer>();
        sev.setOrdered(true);
        sev.setBinding(bnd.getBinding("minSeverityToFetch"));
        r.add(str);
        r.add(sev);       
        Container buttons=new Container();       
        HorizontalLayouter horizontalLayouter = new HorizontalLayouter();
        buttons.setLayoutManager(horizontalLayouter);
        r.add(buttons);
        final InputElementDialog inputElementDialog = new InputElementDialog(bnd,r,"Settings","you may configure settings here");
        ButtonSelector bs=new ButtonSelector();
        bs.setValue(new Runnable() {
          public void run() {
            bnd.commit();
            inputElementDialog.close();
          }
        });
        bs.setText("Apply");
        buttons.add(bs);       
        ButtonSelector bs1=new ButtonSelector();
        bs1.setValue(new Runnable() {
          public void run() {
            inputElementDialog.close();
          }
        });
        //buttons.add(bs);
        buttons.add(bs1);
        bs1.setText("Cancel");
        r.setLayoutManager(ca);
        DisposeBindingListener.linkBindingLifeCycle(bnd, r);
        inputElementDialog.open();
      }
    });
    menuManager.update(true);

    IToolBarManager toolBarManager = getViewSite().getActionBars()
        .getToolBarManager();
    toolBarManager.add(new Action("Export Log") {

      {
        setImageDescriptor(Activator.imageDescriptorFromPlugin(
            Activator.PLUGIN_ID, "/icons/export_log.gif"));
      }

      public void run() {
        FileDialog dlg = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.SAVE);
        dlg.setText("Export log to:");
        String open = dlg.open();
        if (open != null) {
          try {
           
            FileOutputStream s = new FileOutputStream(open);
            BufferedWriter bf = new BufferedWriter(
                new OutputStreamWriter(s));
            try {
              bf.append(currentLogs);
              bf.close();
            } catch (Exception e) {
              MessageDialog.openError(Display.getCurrent()
                  .getActiveShell(), "Error", e.getMessage());
            }

          } catch (FileNotFoundException e) {
            MessageDialog.openError(Display.getCurrent()
                .getActiveShell(), "Error", e.getMessage());
          }
        }
      }

    });
    toolBarManager.add(new Action("Import Log") {

      {
        setImageDescriptor(Activator.imageDescriptorFromPlugin(
            Activator.PLUGIN_ID, "/icons/import_log.gif"));
      }

      public void run() {
        FileDialog dlg = new FileDialog(Display.getCurrent()
            .getActiveShell(), SWT.OPEN);
        dlg.setText("Open log from");

        String open = dlg.open();
        if (open != null) {
          try {
            FileInputStream s = new FileInputStream(open);
            BufferedReader bf = new BufferedReader(
                new InputStreamReader(s));
            StringBuilder bld = new StringBuilder();
            ;
            ArrayList<LogItem> result = new ArrayList<LogItem>();
            try {
              while (true) {
                try {
                  String str = bf.readLine();
                  if (str == null) {
                    break;
                  }
                  try {
                    result.add(new LogItem(str));
                  } catch (Exception e) {
                    e.printStackTrace();
                  }
                  bld.append(str);
                  bld.append('\n');
                } catch (IOException e) {
                  MessageDialog.openError(Display
                      .getCurrent().getActiveShell(),
                      "Error", e.getMessage());
                }

              }
              logViewer.setInput(result
                  .toArray(new LogItem[result.size()]));
              currentLogs = bld.toString();

            } catch (Exception e) {
              MessageDialog.openError(Display.getCurrent()
                  .getActiveShell(), "Error", e.getMessage());
            }

          } catch (FileNotFoundException e) {
            MessageDialog.openError(Display.getCurrent()
                .getActiveShell(), "Error", e.getMessage());
          }
        }
      }

    });
    sync = new Action("Sync with Server") {

      {
        setImageDescriptor(Activator.imageDescriptorFromPlugin(
            Activator.PLUGIN_ID, "/icons/refresh.gif"));
      }

      public void run() {
        refreshLog(currentProject);
      }

    };
    menuManager.add(new Separator());
    Action action = new Action("Split horizontally",
        IAction.AS_RADIO_BUTTON) {
      {
        setImageDescriptor(Activator.imageDescriptorFromPlugin(
            Activator.PLUGIN_ID, "icons/horizontalOrientation.gif"));

      }

      public void run() {
        owner.setOrientation(SWT.HORIZONTAL);
        logViewer.getTreeViewer().getTree().layout(true, true);
      }
    };
    action.setChecked(owner.getOrientation() == SWT.HORIZONTAL);
    menuManager.add(action);
    menuManager
        .add(new Action("Split vertically", IAction.AS_RADIO_BUTTON) {
          {
            setImageDescriptor(Activator.imageDescriptorFromPlugin(
                Activator.PLUGIN_ID,
                "icons/verticalOrientation.gif"));
            setChecked(owner.getOrientation() == SWT.VERTICAL);
           
          }

          public void run() {
            owner.setOrientation(SWT.VERTICAL);
            logViewer.getTreeViewer().getTree().layout(true, true);
          }
        });
    sync.setEnabled(false);
    toolBarManager.add(sync);
View Full Code Here

        int chatInputStyle = (style & SWT.BORDER) | SWT.MULTI | SWT.V_SCROLL
            | SWT.WRAP;

        this.setLayout(new FillLayout());

        this.sashForm = new SashForm(this, SWT.VERTICAL);

        // ChatDisplay
        this.chatDisplay = new ChatDisplay(sashForm, chatDisplayStyle,
            displayBackgroundColor);
        this.chatDisplay.setAlwaysShowScrollBars(true);
View Full Code Here

    @Override
    public void createPartControl(Composite parent) {

        parent.setLayout(new FillLayout());

        SashForm baseSashForm = new SashForm(parent, SWT.SMOOTH);

        /*
         * LEFT COLUMN
         */
        leftComposite = new Composite(baseSashForm, SWT.BORDER);
View Full Code Here

      TabFolder tabfolder = new TabFolder(composite, SWT.NONE);
      tabfolder.setLayoutData(new GridData(GridData.FILL_BOTH));

      TabItem partitionTab = new TabItem(tabfolder, SWT.BORDER);
      partitionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_2); //$NON-NLS-1$
      SashForm partitions = new SashForm(tabfolder, SWT.NONE);
      partitions.setOrientation(SWT.VERTICAL);
      partitionTab.setControl(partitions);
      createPartitionTabContents(partitions);
      partitions.setWeights(new int[]{2, 1});

      TabItem annotationsTab = new TabItem(tabfolder, SWT.BORDER);
      annotationsTab.setText("Annotations"); //$NON-NLS-1$
      Composite annotations = new Composite(tabfolder, SWT.NONE);
      annotationsTab.setControl(annotations);
      createAnnotationTabContents(annotations);

      // only create the ITextRegions tab for IStructuredDocuments
      if (fDocument instanceof IStructuredDocument) {
        TabItem regionTab = new TabItem(tabfolder, SWT.BORDER);
        regionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_3); //$NON-NLS-1$
        SashForm regions = new SashForm(tabfolder, SWT.NONE);
        regions.setOrientation(SWT.HORIZONTAL);
        regionTab.setControl(regions);
        createRegionTabContents(regions);
        regions.setWeights(new int[]{3, 2});
      }

      if (structuredSelection != null) {
        TabItem editorSelectionTab = new TabItem(tabfolder, SWT.BORDER);
        editorSelectionTab.setText(SSEUIMessages.OffsetStatusLineContributionItem_14);
View Full Code Here

TOP

Related Classes of org.eclipse.swt.custom.SashForm

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.