public void setViewPanesOrientation(int orientation) {
    fViewOrientation = orientation;
    if (fViewOrientation == VERTICAL_VIEW_ORIENTATION) fSashForm.setOrientation(SWT.VERTICAL);
    else fSashForm.setOrientation(SWT.HORIZONTAL);

    saveOrientation();
    updateOrientationActions();
  }
 public void run() {
   isVerticalSashing = !isVerticalSashing;
   if (isVerticalSashing) {
     container.setOrientation(SWT.VERTICAL);
   } else {
     container.setOrientation(SWT.HORIZONTAL);
   }
   setState();
 }
  @Override
  public void createControls(Composite parent) {
    AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(page.getProject());
    syncClones();

    super.createControls(parent);
    Composite composite = usercomp;

    settingsStore = AutotoolsConfigurePrefStore.getInstance();
    configToPageListMap = new HashMap<>();

    // assume parent page uses griddata
    GridData gd =
        new GridData(
            GridData.HORIZONTAL_ALIGN_CENTER
                | GridData.VERTICAL_ALIGN_FILL
                | GridData.FILL_HORIZONTAL
                | GridData.FILL_VERTICAL);
    composite.setLayoutData(gd);
    GridLayout layout = new GridLayout();
    composite.setLayout(layout);

    // Create the sash form
    sashForm = new SashForm(usercomp, SWT.NONE);
    sashForm.setOrientation(SWT.HORIZONTAL);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));

    layout = new GridLayout(2, true);
    layout.marginHeight = 5;
    sashForm.setLayout(layout);
    createSelectionArea(sashForm);
    createEditArea(sashForm);
  }
  @Override
  public void createPage() {
    super.createPage();
    Composite parent = (Composite) getContent();
    coolBar = new CoolBar(parent, SWT.FLAT);

    createControlsToolBar(coolBar);
    createConfigurationToolBar(coolBar);
    packCoolBar();

    SashForm sashForm = new SashForm(parent, SWT.NONE);
    sashForm.setLayout(new GridLayout());
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    sashForm.setOrientation(SWT.VERTICAL);
    sashForm.SASH_WIDTH = 3;

    createScriptTableSection(sashForm);
    createStatusWindow(sashForm);

    sashForm.setWeights(new int[] {8, 2});
    setMinSize(0, 0);

    // TODO: Change to use OteHelpContext
    HelpUtil.setHelp(this, "test_manager_scripts_page", "org.eclipse.osee.framework.help.ui");
  }
Esempio n. 5
0
  private void configureSashMode(int mode) {
    tabFolder = null;
    if (sashForm != null) {
      if (sashForm.getOrientation() != mode) sashForm.setOrientation(mode);
      return;
    }
    recreateRootComposite();
    sashForm = new SashForm(rootComposite, mode);

    createMessageViewers(sashForm);

    sashForm.setWeights(new int[] {50, 50});
    parentComposite.layout();
    processCurrentTransaction();
  }
  @Override
  public void createControls(Composite parent) {
    AutotoolsConfigurationManager.getInstance().clearTmpConfigurations(getProject());
    syncClones();

    super.createControls(parent);
    Composite composite = usercomp;

    settingsStore = AutotoolsConfigurePrefStore.getInstance();
    configToPageListMap = new HashMap<>();

    // assume parent page uses griddata
    GridData gd =
        new GridData(
            GridData.HORIZONTAL_ALIGN_CENTER
                | GridData.VERTICAL_ALIGN_FILL
                | GridData.FILL_HORIZONTAL
                | GridData.FILL_VERTICAL);
    composite.setLayoutData(gd);
    GridLayout layout = new GridLayout();
    //		layout.numColumns= 2;
    // PixelConverter pc= new PixelConverter(composite);
    // layout.verticalSpacing= pc.convertHeightInCharsToPixels(1) / 2;
    composite.setLayout(layout);

    // Create the sash form
    sashForm = new SashForm(usercomp, SWT.NONE);
    sashForm.setOrientation(SWT.HORIZONTAL);
    sashForm.setLayoutData(new GridData(GridData.FILL_BOTH));

    layout = new GridLayout(2, true);
    layout.marginHeight = 5;
    sashForm.setLayout(layout);
    createSelectionArea(sashForm);
    createEditArea(sashForm);

    //		usercomp.addControlListener(new ControlAdapter() {
    //			@Override
    //			public void controlResized(ControlEvent e) {
    //				specificResize();
    //			}});

  }
  private void createWidget(final CTabFolder tabFolderObject) {
    tbtmSynonym = new CTabItem(tabFolderObject, SWT.NONE);
    tbtmSynonym.setText(Messages.get().TadpoleSynonymComposite_0);
    tbtmSynonym.setData(TAB_DATA_KEY, PublicTadpoleDefine.OBJECT_TYPE.SYNONYM.name());

    Composite compositeTables = new Composite(tabFolderObject, SWT.NONE);
    tbtmSynonym.setControl(compositeTables);
    GridLayout gl_compositeTables = new GridLayout(1, false);
    gl_compositeTables.verticalSpacing = 2;
    gl_compositeTables.horizontalSpacing = 2;
    gl_compositeTables.marginHeight = 2;
    gl_compositeTables.marginWidth = 2;
    compositeTables.setLayout(gl_compositeTables);
    compositeTables.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    SashForm sashForm = new SashForm(compositeTables, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    // SWT.VIRTUAL 일 경우 FILTER를 적용하면 데이터가 보이지 않는 오류수정.
    synonymListViewer = new TableViewer(sashForm, SWT.BORDER | SWT.FULL_SELECTION);
    synonymListViewer.addDoubleClickListener(
        new IDoubleClickListener() {
          public void doubleClick(DoubleClickEvent event) {
            try {
              IStructuredSelection is = (IStructuredSelection) event.getSelection();
              if (null != is) {
                OracleSynonymDAO tableDAO = (OracleSynonymDAO) is.getFirstElement();

                if (PublicTadpoleDefine.OBJECT_TYPE
                    .FUNCTIONS
                    .toString()
                    .startsWith(tableDAO.getObject_type())) {
                  AbstractRDBDDLScript rdbScript =
                      new OracleDDLScript(userDB, PublicTadpoleDefine.OBJECT_TYPE.FUNCTIONS);
                  ProcedureFunctionDAO dao = new ProcedureFunctionDAO();
                  dao.setName(tableDAO.getTable_name());

                  FindEditorAndWriteQueryUtil.run(
                      userDB,
                      rdbScript.getFunctionScript(dao),
                      PublicTadpoleDefine.OBJECT_TYPE.FUNCTIONS);
                }
              }
            } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
            }
          }
        });
    synonymListViewer.addPostSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            try {
              IStructuredSelection is = (IStructuredSelection) event.getSelection();
              Object synonymDAO = is.getFirstElement();

              if (synonymDAO != null) {
                OracleSynonymDAO synonym = (OracleSynonymDAO) synonymDAO;

                if (selectSynonymName.equals(synonym.getSynonym_name())) return;
                selectSynonymName = synonym.getSynonym_name();

                SqlMapClient sqlClient = TadpoleSQLManager.getInstance(userDB);
                Map<String, String> mapParam = new HashMap<String, String>();
                mapParam.put("db", userDB.getDb()); // $NON-NLS-1$
                mapParam.put("owner", synonym.getTable_owner()); // $NON-NLS-1$
                mapParam.put("table", synonym.getTable_name()); // $NON-NLS-1$

                showSynonymColumns =
                    sqlClient.queryForList("synonymColumnList", mapParam); // $NON-NLS-1$

              } else showSynonymColumns = null;

              synonymColumnViewer.setInput(showSynonymColumns);
              synonymColumnViewer.refresh();

            } catch (Exception e) {
              logger.error("get table column", e); // $NON-NLS-1$

              Status errStatus =
                  new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); // $NON-NLS-1$
              ExceptionDetailsErrorDialog.openError(
                  tabFolderObject.getShell(), "Error", e.getMessage(), errStatus); // $NON-NLS-1$
            }
          }
        });

    Table tableTableList = synonymListViewer.getTable();
    tableTableList.setLinesVisible(true);
    tableTableList.setHeaderVisible(true);

    createSynonymMenu();

    // columns
    synonymColumnViewer = new TableViewer(sashForm, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
    synonymColumnViewer.addDoubleClickListener(
        new IDoubleClickListener() {
          public void doubleClick(DoubleClickEvent event) {
            IStructuredSelection is = (IStructuredSelection) event.getSelection();

            if (null != is) {
              OracleSynonymColumnDAO synonymDAO = (OracleSynonymColumnDAO) is.getFirstElement();
              FindEditorAndWriteQueryUtil.runAtPosition(synonymDAO.getColumn_name());
            }
          }
        });
    Table tableTableColumn = synonymColumnViewer.getTable();
    tableTableColumn.setHeaderVisible(true);
    tableTableColumn.setLinesVisible(true);

    createSysnonymListColumne();
    createSynonymDetailColumne();

    synonymListViewer.setInput(showSynonyms);
    synonymListViewer.refresh();

    synonymFilter = new DefaultTableColumnFilter();
    synonymListViewer.addFilter(synonymFilter);

    sashForm.setWeights(new int[] {1, 1});
  }
    @Override
    protected void createContent(Composite parent) {
      fSashForm = new SashForm(parent, parent.getStyle());
      fSashForm.setOrientation(SWT.VERTICAL);

      // update presentation context
      AbstractDebugView view = getViewToEmulate();
      fContext = new PresentationContext(TCFModel.ID_EXPRESSION_HOVER);
      if (view != null) {
        // copy over properties
        IPresentationContext copy = ((TreeModelViewer) view.getViewer()).getPresentationContext();
        try {
          String[] properties = copy.getProperties();
          for (int i = 0; i < properties.length; i++) {
            String key = properties[i];
            fContext.setProperty(key, copy.getProperty(key));
          }
        } catch (NoSuchMethodError e) {
          // ignore
        }
      }

      fViewer =
          new TreeModelViewer(fSashForm, SWT.MULTI | SWT.VIRTUAL | SWT.FULL_SELECTION, fContext);
      fViewer.setAutoExpandLevel(fExpansionLevel);

      if (view != null) {
        // copy over filters
        StructuredViewer structuredViewer = (StructuredViewer) view.getViewer();
        if (structuredViewer != null) {
          ViewerFilter[] filters = structuredViewer.getFilters();
          for (int i = 0; i < filters.length; i++) {
            fViewer.addFilter(filters[i]);
          }
        }
      }
      fInputService = new ViewerInputService(fViewer, this);
      fTree = fViewer.getTree();

      if (fShowDetailPane) {
        fDetailPaneComposite = SWTFactory.createComposite(fSashForm, 1, 1, GridData.FILL_BOTH);
        Layout layout = fDetailPaneComposite.getLayout();
        if (layout instanceof GridLayout) {
          GridLayout gl = (GridLayout) layout;
          gl.marginHeight = 0;
          gl.marginWidth = 0;
        }

        fDetailPane = new DetailPaneProxy(new DetailPaneContainer());
        fDetailPane.display(null); // Bring up the default pane so the
        // user doesn't see an empty
        // composite

        fTree.addSelectionListener(
            new SelectionListener() {
              public void widgetSelected(SelectionEvent e) {
                fDetailPane.display((IStructuredSelection) fViewer.getSelection());
              }

              public void widgetDefaultSelected(SelectionEvent e) {}
            });
      }

      initSashWeights();

      // add update listener to auto-select and display details of root
      // expression
      fViewer.addViewerUpdateListener(
          new IViewerUpdateListener() {
            public void viewerUpdatesComplete() {
              fViewer
                  .getDisplay()
                  .timerExec(
                      100,
                      new Runnable() {
                        public void run() {
                          if (fViewer.getControl().isDisposed()) return;
                          TreeSelection selection = (TreeSelection) fViewer.getSelection();
                          if (selection.isEmpty())
                            selection = new TreeSelection(fViewer.getTopElementPath());
                          fViewer.setSelection(selection);
                          if (fDetailPane != null) fDetailPane.display(selection);
                        }
                      });
            }

            public void viewerUpdatesBegin() {}

            public void updateStarted(IViewerUpdate update) {}

            public void updateComplete(IViewerUpdate update) {}
          });

      setBackgroundColor(getShell().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    }
  private void createWidget(final CTabFolder tabFolderObject) {
    CTabItem tbtmIndex = new CTabItem(tabFolderObject, SWT.NONE);
    tbtmIndex.setText("Indexes"); // $NON-NLS-1$

    Composite compositeIndexes = new Composite(tabFolderObject, SWT.NONE);
    tbtmIndex.setControl(compositeIndexes);
    GridLayout gl_compositeIndexes = new GridLayout(1, false);
    gl_compositeIndexes.verticalSpacing = 2;
    gl_compositeIndexes.horizontalSpacing = 2;
    gl_compositeIndexes.marginHeight = 2;
    gl_compositeIndexes.marginWidth = 2;
    compositeIndexes.setLayout(gl_compositeIndexes);

    SashForm sashForm = new SashForm(compositeIndexes, SWT.NONE);
    sashForm.setOrientation(SWT.VERTICAL);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    //  SWT.VIRTUAL 일 경우 FILTER를 적용하면 데이터가 보이지 않는 오류수정.
    tableViewer = new TableViewer(sashForm, SWT.BORDER | SWT.FULL_SELECTION);

    tableViewer.addPostSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            if (PublicTadpoleDefine.YES_NO.NO.toString().equals(userDB.getIs_showtables())) return;

            // 테이블의 컬럼 목록을 출력합니다.
            try {
              IStructuredSelection is = (IStructuredSelection) event.getSelection();
              Object tableDAO = is.getFirstElement();

              if (tableDAO != null) {
                InformationSchemaDAO index = (InformationSchemaDAO) tableDAO;

                if (selectIndexName.equals(index.getINDEX_NAME())) return;
                selectIndexName = index.getINDEX_NAME();

                SqlMapClient sqlClient = TadpoleSQLManager.getInstance(userDB);
                HashMap<String, String> paramMap = new HashMap<String, String>();
                paramMap.put("table_schema", index.getTABLE_SCHEMA());
                paramMap.put("table_name", index.getTABLE_NAME());
                paramMap.put("index_name", index.getINDEX_NAME());

                showIndexColumns =
                    sqlClient.queryForList("indexDetailList", paramMap); // $NON-NLS-1$

              } else showIndexColumns = null;

              indexColumnViewer.setInput(showIndexColumns);
              indexColumnViewer.refresh();
              TableUtil.packTable(indexColumnViewer.getTable());

            } catch (Exception e) {
              logger.error("get table column", e); // $NON-NLS-1$

              Status errStatus =
                  new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); // $NON-NLS-1$
              ExceptionDetailsErrorDialog.openError(
                  tabFolderObject.getShell(), "Error", e.getMessage(), errStatus); // $NON-NLS-1$
            }
          }
        });

    Table tableTableList = tableViewer.getTable();
    tableTableList.setLinesVisible(true);
    tableTableList.setHeaderVisible(true);

    indexComparator = new DefaultComparator();
    tableViewer.setSorter(indexComparator);

    createIndexesColumn(tableViewer, indexComparator);

    tableViewer.setLabelProvider(new IndexesLabelProvicer());
    tableViewer.setContentProvider(new ArrayContentProvider());
    //		tableViewer.setInput(listIndexes);

    indexFilter = new IndexesViewFilter();
    tableViewer.addFilter(indexFilter);

    // columns
    indexColumnViewer = new TableViewer(sashForm, SWT.VIRTUAL | SWT.BORDER | SWT.FULL_SELECTION);
    Table tableTableColumn = indexColumnViewer.getTable();
    tableTableColumn.setHeaderVisible(true);
    tableTableColumn.setLinesVisible(true);

    indexColumnComparator = new IndexColumnComparator();
    indexColumnViewer.setSorter(indexColumnComparator);

    createIndexColumne(indexColumnViewer);

    indexColumnViewer.setContentProvider(new ArrayContentProvider());
    indexColumnViewer.setLabelProvider(new IndexColumnLabelprovider());

    createMenu();
    // index detail column

    sashForm.setWeights(new int[] {1, 1});
  }