コード例 #1
0
  @Override
  public void restoreSettings() {
    appendResults.setSelected(GuiSettings.getDefaultAppendResults());
    rowHeightResize.setSelected(GuiSettings.getAllowRowHeightResizing());
    autoRowHeight.setSelected(GuiSettings.getAutomaticOptimalRowHeight());
    maxRowHeight.setText(Integer.toString(GuiSettings.getAutRowHeightMaxLines()));
    autoColWidth.setSelected(GuiSettings.getAutomaticOptimalWidth());
    includeHeaderWidth.setSelected(GuiSettings.getIncludeHeaderInOptimalWidth());
    ignoreEmptyRows.setSelected(GuiSettings.getIgnoreWhitespaceForAutoRowHeight());
    minColSizeField.setText(Integer.toString(GuiSettings.getMinColumnWidth()));
    maxColSizeField.setText(Integer.toString(GuiSettings.getMaxColumnWidth()));
    selectSummary.setSelected(GuiSettings.getShowSelectionSummary());
    multiLineThreshold.setText(Integer.toString(GuiSettings.getMultiLineThreshold()));
    wrapMultineRender.setSelected(GuiSettings.getWrapMultilineRenderer());
    wrapMultlineEdit.setSelected(GuiSettings.getWrapMultilineEditor());

    defMaxRows.setText(Integer.toString(GuiSettings.getDefaultMaxRows()));
    retrieveComments.setSelected(GuiSettings.getRetrieveQueryComments());
    showRowNumbers.setSelected(GuiSettings.getShowTableRowNumbers());
    showMaxRowsWarn.setSelected(GuiSettings.getShowMaxRowsReached());
    showMaxRowsTooltip.setSelected(GuiSettings.getShowMaxRowsTooltip());
    nullString.setText(GuiSettings.getDisplayNullString());
    showGeneratingSQL.setSelected(GuiSettings.getShowResultSQL());
    useTableName.setSelected(GuiSettings.getUseTablenameAsResultName());
    int align = GuiSettings.getNumberDataAlignment();
    if (align == SwingConstants.LEFT) {
      alignmentDropDown.setSelectedIndex(1);
    } else {
      alignmentDropDown.setSelectedIndex(0);
    }
    boldHeader.setSelected(GuiSettings.showTableHeaderInBold());
    fillLanguageDropDown();
  }
コード例 #2
0
 @Override
 public void executeAction(ActionEvent e) {
   if (client == null) return;
   final boolean respectColName =
       ((e.getModifiers() & ActionEvent.SHIFT_MASK) == ActionEvent.SHIFT_MASK)
           || GuiSettings.getIncludeHeaderInOptimalWidth();
   final int column = client.getPopupColumnIndex();
   Thread t =
       new WbThread("OptimizeCol Thread") {
         @Override
         public void run() {
           optimizer.optimizeColWidth(column, respectColName);
         }
       };
   t.start();
 }