List of usage examples for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_AS_NEEDED
int VERTICAL_SCROLLBAR_AS_NEEDED
To view the source code for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_AS_NEEDED.
Click Source Link
From source file:edu.ku.brc.specify.tasks.subpane.qb.QueryBldrPane.java
/** * @param report// ww w .ja v a2 s .c o m * * Loads and runs the query that acts as data source for report. Then runs report. */ public static void runReport(final SpReport report, final String title, final RecordSetIFace rs) { //XXX This is now also used to run Workbench reports. Really should extract the general stuff out //to a higher level... boolean isQueryBuilderRep = report.getReportObject() instanceof SpQuery; if (isQueryBuilderRep) { UsageTracker.incrUsageCount("QB.RunReport." + report.getQuery().getContextName()); } else { UsageTracker.incrUsageCount("WB.RunReport"); } TableTree tblTree = null; Hashtable<String, TableTree> ttHash = null; QueryParameterPanel qpp = null; if (isQueryBuilderRep) { UsageTracker.incrUsageCount("QB.RunReport." + report.getQuery().getContextName()); QueryTask qt = (QueryTask) ContextMgr.getTaskByClass(QueryTask.class); if (qt != null) { Pair<TableTree, Hashtable<String, TableTree>> trees = qt.getTableTrees(); tblTree = trees.getFirst(); ttHash = trees.getSecond(); } else { log.error("Could not find the Query task when running report " + report.getName()); //blow up throw new RuntimeException("Could not find the Query task when running report " + report.getName()); } qpp = new QueryParameterPanel(); qpp.setQuery(report.getQuery(), tblTree, ttHash); } boolean go = true; try { JasperCompilerRunnable jcr = new JasperCompilerRunnable(null, report.getName(), null); jcr.findFiles(); if (jcr.isCompileRequired()) { jcr.get(); } //if isCompileRequired() is still true, then an error probably occurred compiling the report. JasperReport jr = !jcr.isCompileRequired() ? (JasperReport) JRLoader.loadObject(jcr.getCompiledFile()) : null; ReportParametersPanel rpp = jr != null ? new ReportParametersPanel(jr, true) : null; JRDataSource src = null; if (rs == null && ((qpp != null && qpp.getHasPrompts()) || (rpp != null && rpp.getParamCount() > 0))) { Component pane = null; if (qpp != null && qpp.getHasPrompts() && rpp != null && rpp.getParamCount() > 0) { pane = new JTabbedPane(); ((JTabbedPane) pane).addTab(UIRegistry.getResourceString("QB_REP_RUN_CRITERIA_TAB_TITLE"), new JScrollPane(qpp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); ((JTabbedPane) pane).addTab(UIRegistry.getResourceString("QB_REP_RUN_PARAM_TAB_TITLE"), new JScrollPane(rpp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER)); } else if (qpp != null && qpp.getHasPrompts()) { pane = new JScrollPane(qpp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); } else { pane = new JScrollPane(rpp, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); } CustomDialog cd = new CustomDialog((Frame) UIRegistry.getTopWindow(), UIRegistry.getResourceString("QB_GET_REPORT_CONTENTS_TITLE"), true, CustomDialog.OKCANCELHELP, pane); cd.setHelpContext("RepRunSettings"); cd.createUI(); Dimension ps = cd.getPreferredSize(); ps.setSize(ps.getWidth() * 1.3, ps.getHeight()); cd.setSize(ps); UIHelper.centerAndShow(cd); go = !cd.isCancelled(); cd.dispose(); } if (go) { if (isQueryBuilderRep) { TableQRI rootQRI = null; int cId = report.getQuery().getContextTableId(); for (TableTree tt : ttHash.values()) { if (cId == tt.getTableInfo().getTableId()) { rootQRI = tt.getTableQRI(); break; } } Vector<QueryFieldPanel> qfps = new Vector<QueryFieldPanel>(qpp.getFields()); for (int f = 0; f < qpp.getFields(); f++) { qfps.add(qpp.getField(f)); } HQLSpecs sql = null; // XXX need to allow modification of SelectDistinct(etc) ??? //boolean includeRecordIds = true; boolean includeRecordIds = !report.getQuery().isSelectDistinct(); try { //XXX Is it safe to assume that query is not an export query? sql = QueryBldrPane.buildHQL(rootQRI, !includeRecordIds, qfps, tblTree, rs, report.getQuery().getSearchSynonymy() == null ? false : report.getQuery().getSearchSynonymy(), false, null); } catch (Exception ex) { String msg = StringUtils.isBlank(ex.getLocalizedMessage()) ? getResourceString("QB_RUN_ERROR") : ex.getLocalizedMessage(); UIRegistry.getStatusBar().setErrorMessage(msg, ex); UIRegistry.writeTimedSimpleGlassPaneMsg(msg, Color.RED); return; } int smushedCol = (report.getQuery().getSmushed() != null && report.getQuery().getSmushed()) ? getSmushedCol(qfps) + 1 : -1; src = new QBDataSource(sql.getHql(), sql.getArgs(), sql.getSortElements(), getColumnInfo(qfps, true, rootQRI.getTableInfo(), false), includeRecordIds, report.getRepeats(), smushedCol, /*getRecordIdCol(qfps)*/0); ((QBDataSource) src).startDataAcquisition(); } else { DataProviderSessionIFace session = DataProviderFactory.getInstance().createSession(); try { boolean loadedWB = false; if (rs != null && rs.getOnlyItem() != null) { Workbench wb = session.get(Workbench.class, rs.getOnlyItem().getRecordId()); if (wb != null) { wb.forceLoad(); src = new WorkbenchJRDataSource(wb, true, report.getRepeats()); loadedWB = true; } } if (!loadedWB) { UIRegistry.displayErrorDlgLocalized("QueryBldrPane.WB_LOAD_ERROR_FOR_REPORT", rs != null ? rs.getName() : "[" + UIRegistry.getResourceString("NONE") + "]"); return; } } finally { session.close(); } } final CommandAction cmd = new CommandAction(ReportsBaseTask.REPORTS, ReportsBaseTask.PRINT_REPORT, src); cmd.setProperty("title", title); cmd.setProperty("file", report.getName()); if (rs == null) { cmd.setProperty("skip-parameter-prompt", "true"); } //if isCompileRequired is true then an error probably occurred while compiling, //and, if so, it will be caught again and reported in the report results pane. if (!jcr.isCompileRequired()) { cmd.setProperty("compiled-file", jcr.getCompiledFile()); } if (rpp != null && rpp.getParamCount() > 0) { StringBuilder params = new StringBuilder(); for (int p = 0; p < rpp.getParamCount(); p++) { Pair<String, String> param = rpp.getParam(p); if (StringUtils.isNotBlank(param.getSecond())) { params.append(param.getFirst()); params.append("="); params.append(param.getSecond()); params.append(";"); } cmd.setProperty("params", params.toString()); } } CommandDispatcher.dispatch(cmd); } } catch (JRException ex) { UsageTracker.incrHandledUsageCount(); edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(QueryBldrPane.class, ex); log.error(ex); ex.printStackTrace(); } }
From source file:net.sourceforge.pmd.util.designer.Designer.java
private JPanel createXPathQueryPanel() { JPanel p = new JPanel(); p.setLayout(new BorderLayout()); xpathQueryArea.setBorder(BorderFactory.createLineBorder(Color.black)); makeTextComponentUndoable(xpathQueryArea); JScrollPane scrollPane = new JScrollPane(xpathQueryArea); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); final JButton b = createGoButton(); JPanel topPanel = new JPanel(); topPanel.setLayout(new BorderLayout()); topPanel.add(new JLabel("XPath Query (if any):"), BorderLayout.WEST); topPanel.add(createXPathVersionPanel(), BorderLayout.EAST); p.add(topPanel, BorderLayout.NORTH); p.add(scrollPane, BorderLayout.CENTER); p.add(b, BorderLayout.SOUTH); return p;//from w ww . java 2 s . c om }
From source file:org.apache.cayenne.modeler.dialog.ErrorDebugDialog.java
protected void init() { setResizable(false);/* www. ja va2s. c om*/ Container pane = this.getContentPane(); pane.setLayout(new BorderLayout()); // info area JEditorPane infoText = new JEditorPane("text/html", infoHTML()); infoText.setBackground(pane.getBackground()); infoText.setEditable(false); // popup hyperlinks infoText.addHyperlinkListener(this); JPanel infoPanel = new JPanel(); infoPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); infoPanel.add(infoText); pane.add(infoPanel, BorderLayout.NORTH); // exception area if (throwable != null) { exText.setEditable(false); exText.setLineWrap(true); exText.setWrapStyleWord(true); exText.setRows(16); exText.setColumns(40); JScrollPane exScroll = new JScrollPane(exText, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); exPanel = new JPanel(); exPanel.setLayout(new BorderLayout()); exPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); exPanel.add(exScroll, BorderLayout.CENTER); // buttons showHide = new JButton(""); showHide.addActionListener(this); if (isDetailed()) { showDetails(); } else { hideDetails(); } } close = new JButton("Close"); close.addActionListener(this); JButton[] buttons = (showHide != null) ? new JButton[] { showHide, close } : new JButton[] { close }; pane.add(PanelFactory.createButtonPanel(buttons), BorderLayout.SOUTH); //add a listener to clear static variables, not to produce garbage addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { instance = null; } }); // prepare to display this.pack(); this.centerWindow(); }
From source file:org.jajuk.ui.views.ArtistView.java
@Override public void shortCall(Object in) { removeAll();//from w ww .ja v a 2 s . c o m jspAlbums = getLastFMSuggestionsPanel(SuggestionType.OTHERS_ALBUMS, true); // Artist unknown from last.fm, leave if (artistInfo == null // If image url is void, last.fm doesn't provide enough data about this // artist, we reset the view || StringUtils.isBlank(artistInfo.getImageUrl())) { reset(); return; } artistThumb = new LastFmArtistThumbnail(artistInfo); // No known icon next to artist thumb artistThumb.setArtistView(true); artistThumb.populate(); jtaArtistDesc = new JTextArea(bio) { private static final long serialVersionUID = 9217998016482118852L; // We set the margin this way, setMargin() doesn't work due to // existing border @Override public Insets getInsets() { return new Insets(2, 4, 0, 4); } }; jtaArtistDesc.setBorder(null); jtaArtistDesc.setEditable(false); jtaArtistDesc.setLineWrap(true); jtaArtistDesc.setWrapStyleWord(true); jtaArtistDesc.setOpaque(false); JScrollPane jspWiki = new JScrollPane(jtaArtistDesc); jspWiki.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jspWiki.setBorder(null); jspWiki.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); // Add items, layout is different according wiki text availability if (StringUtils.isNotBlank(jtaArtistDesc.getText())) { setLayout(new MigLayout("ins 5,gapy 5", "[grow]", "[grow][20%!][grow]")); add(artistThumb, "center,wrap"); // don't add the textarea if no wiki text available add(jspWiki, "growx,wrap"); add(jspAlbums, "grow,wrap"); } else { setLayout(new MigLayout("ins 5,gapy 5", "[grow]")); add(artistThumb, "center,wrap"); // don't add the textarea if no wiki text available add(jspAlbums, "grow,wrap"); } revalidate(); repaint(); }
From source file:org.jajuk.ui.views.SuggestionView.java
/** * Return the result panel for local albums. * * @param type /*from www . j av a 2s . c om*/ * * @return the local suggestions panel */ JScrollPane getLocalSuggestionsPanel(SuggestionType type) { FlowScrollPanel out = new FlowScrollPanel(); out.setLayout(new FlowLayout(FlowLayout.LEFT)); JScrollPane jsp = new JScrollPane(out, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jsp.setBorder(null); out.setScroller(jsp); List<Album> albums = null; if (type == SuggestionType.BEST_OF) { albums = albumsPrefered; } else if (type == SuggestionType.NEWEST) { albums = albumsNewest; } else if (type == SuggestionType.RARE) { albums = albumsRare; } if (albums != null && albums.size() > 0) { for (Album album : albums) { LocalAlbumThumbnail thumb = new LocalAlbumThumbnail(album, 100, false); thumb.populate(); thumb.getIcon().addMouseListener(new ThumbMouseListener()); out.add(thumb); } } else { out.add(UtilGUI.getCentredPanel(new JLabel(Messages.getString("WikipediaView.3")))); } return jsp; }
From source file:org.jajuk.ui.views.SuggestionView.java
/** * Return the result panel for lastFM information. * * @param type /* w w w . ja v a 2 s .c o m*/ * @param artistView * * @return the last fm suggestions panel */ JScrollPane getLastFMSuggestionsPanel(SuggestionType type, boolean artistView) { FlowScrollPanel flowPanel = new FlowScrollPanel(); JScrollPane jsp = new JScrollPane(flowPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); jsp.setBorder(null); flowPanel.setScroller(jsp); flowPanel.setLayout(new FlowLayout(FlowLayout.CENTER)); if (type == SuggestionType.OTHERS_ALBUMS) { if (albums != null && albums.getAlbums().size() > 0) { for (AlbumInfo album : albums.getAlbums()) { AbstractThumbnail thumb = new LastFmAlbumThumbnail(album); thumb.setArtistView(artistView); thumb.populate(); if (thumb.getIcon() != null) { thumb.getIcon().addMouseListener(new ThumbMouseListener()); flowPanel.add(thumb); } } } // No result found else { return new JScrollPane(getNothingFoundPanel()); } } else if (type == SuggestionType.SIMILAR_ARTISTS) { if (similar != null) { List<ArtistInfo> artists = similar.getArtists(); for (ArtistInfo similarArtist : artists) { AbstractThumbnail thumb = new LastFmArtistThumbnail(similarArtist); thumb.setArtistView(artistView); thumb.populate(); if (thumb.getIcon() != null) { thumb.getIcon().addMouseListener(new ThumbMouseListener()); flowPanel.add(thumb); } } } // No result found else { return new JScrollPane(getNothingFoundPanel()); } } return jsp; }
From source file:org.kepler.gui.ComponentLibraryPreferencesTab.java
/** * Initialize the source list table.// ww w .jav a 2s. c o m */ private void initSourceList() { try { ComponentSourceTableModel cstm = new ComponentSourceTableModel(); _sourceList = new JTable(cstm); _sourceList.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); _sourceList.setShowGrid(true); _sourceList.setShowHorizontalLines(true); _sourceList.setShowVerticalLines(true); _sourceList.setGridColor(Color.lightGray); _sourceList.setIntercellSpacing(new Dimension(5, 5)); _sourceList.setRowHeight(_sourceList.getRowHeight() + 10); _sourceList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); if (isDebugging) { log.debug("intercellspacing: " + _sourceList.getIntercellSpacing().toString()); log.debug("getRowHeight(): " + _sourceList.getRowHeight()); } // Search column TableColumn c0 = _sourceList.getColumnModel().getColumn(0); c0.setMinWidth(50); c0.setPreferredWidth(60); c0.setMaxWidth(100); c0.setResizable(true); // Save column TableColumn c1 = _sourceList.getColumnModel().getColumn(1); c1.setMinWidth(50); c1.setPreferredWidth(60); c1.setMaxWidth(100); c1.setResizable(true); // Type column TableColumn c2 = _sourceList.getColumnModel().getColumn(2); c2.setMinWidth(50); c2.setPreferredWidth(60); c2.setMaxWidth(100); c2.setResizable(true); // Name column TableColumn c3 = _sourceList.getColumnModel().getColumn(3); c3.setMinWidth(50); c3.setPreferredWidth(100); c3.setMaxWidth(200); c3.setResizable(true); // Source column TableColumn c4 = _sourceList.getColumnModel().getColumn(4); c4.setMinWidth(200); c4.setPreferredWidth(600); c4.setMaxWidth(2000); c4.setResizable(true); JScrollPane sourceListSP = new JScrollPane(_sourceList); sourceListSP.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); sourceListSP.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); sourceListSP.setBackground(TabManager.BGCOLOR); add(sourceListSP); } catch (Exception e) { System.out.println(e.toString()); } }
From source file:org.kepler.gui.WorkflowOutlinePanel.java
public void refreshOutlineTree() { if (isDebugging) { log.debug("refreshOutlineTree()"); }/*from w ww. j a v a 2 s. c o m*/ this.removeAll(); _ptree = new AnnotatedPTree(wotm, this); _mouseListener = new OutlinePopupListener(_ptree); _ptree.setMouseListener(_mouseListener); _ptree.setRootVisible(false); _ptree.initAnotatedPTree(); JScrollPane jSP = new JScrollPane(_ptree, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); jSP.setPreferredSize(new Dimension(200, 200)); this.add(jSP, BorderLayout.CENTER); setControls(); this.repaint(); this.validate(); // if panel was showing the results of a search, redo the search if (_searchTerm != null && !_searchTerm.isEmpty()) { search(_searchTerm); } }
From source file:org.kuali.test.ui.base.SimpleInputDlg2.java
private void initComponents(String labelTxt, String txt) { setTitle(labelTxt);/* ww w . j av a 2s . c o m*/ getContentPane().setLayout(new BorderLayout()); getContentPane().add(new JLabel(labelTxt + ":"), BorderLayout.NORTH); value = new JTextArea(); value.setWrapStyleWord(true); value.setLineWrap(true); if (StringUtils.isNotBlank(txt)) { value.setText(txt); } getContentPane().add(new JScrollPane(value, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER); addStandardButtons(); setDefaultBehavior(); }
From source file:org.nuclos.client.dbtransfer.DBTransferImport.java
private PanelWizardStep newStep1(final MainFrameTab ifrm) { final SpringLocaleDelegate localeDelegate = getSpringLocaleDelegate(); final PanelWizardStep step = new PanelWizardStep( localeDelegate.getMessage("dbtransfer.import.step1.1", "Konfigurationsdatei"), localeDelegate.getMessage("dbtransfer.import.step1.2", "Bitte w\u00e4hlen Sie eine Konfigurationsdatei aus.")); final JLabel lbFile = new JLabel(localeDelegate.getMessage("dbtransfer.import.step1.3", "Datei")); utils.initJPanel(step,// w ww . jav a2 s . co m new double[] { TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.FILL }, new double[] { 20, TableLayout.PREFERRED, lbFile.getPreferredSize().height, TableLayout.FILL }); final JButton btnBrowse = new JButton("..."); //final JProgressBar progressBar = new JProgressBar(0, 230); final JCheckBox chbxImportAsNuclon = new JCheckBox( localeDelegate.getMessage("configuration.transfer.import.as.nuclon", "Import als Nuclon")); chbxImportAsNuclon.setEnabled(false); final JEditorPane editWarnings = new JEditorPane(); editWarnings.setContentType("text/html"); editWarnings.setEditable(false); editWarnings.setBackground(Color.WHITE); final JScrollPane scrollWarn = new JScrollPane(editWarnings); scrollWarn.setPreferredSize(new Dimension(680, 250)); scrollWarn.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); scrollWarn.getVerticalScrollBar().setUnitIncrement(20); scrollWarn.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollWarn.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); final JScrollPane scrollPrev = new JScrollPane(jpnPreviewContent); scrollPrev.setPreferredSize(new Dimension(680, 250)); scrollPrev.setBorder(new LineBorder(Color.LIGHT_GRAY, 1)); scrollPrev.getVerticalScrollBar().setUnitIncrement(20); scrollPrev.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPrev.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); final JPanel jpnPreview = new JPanel(new BorderLayout()); jpnPreview.add(jpnPreviewHeader, BorderLayout.NORTH); jpnPreview.add(scrollPrev, BorderLayout.CENTER); jpnPreview.add(jpnPreviewFooter, BorderLayout.SOUTH); jpnPreview.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); jpnPreview.setBackground(Color.WHITE); jpnPreviewHeader.setBackground(Color.WHITE); jpnPreviewContent.setBackground(Color.WHITE); jpnPreviewFooter.setBackground(Color.WHITE); final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.addTab(localeDelegate.getMessage("configuration.transfer.prepare.warnings.tab", "Warnungen"), scrollWarn); final String sDefaultPreparePreviewTabText = localeDelegate .getMessage("configuration.transfer.prepare.preview.tab", "Vorschau der Schema Aenderungen"); tabbedPane.addTab(sDefaultPreparePreviewTabText, jpnPreview); final JLabel lbNewUser = new JLabel(); step.add(lbFile, "0,0"); step.add(tfTransferFile, "1,0"); step.add(btnBrowse, "2,0"); step.add(chbxImportAsNuclon, "1,1");//step.add(progressBar, "1,1"); step.add(lbNewUser, "0,2,3,2"); step.add(tabbedPane, "0,3,3,3"); tfTransferFile.setEditable(false); final ActionListener prepareImportAction = new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { ifrm.lockLayerWithProgress(Transfer.TOPIC_CORRELATIONID_PREPARE); Thread t = new Thread() { @Override public void run() { step.setComplete(false); boolean blnTransferWithWarnings = false; //progressBar.setValue(0); //progressBar.setVisible(true); try { String fileName = tfTransferFile.getText(); if (StringUtils.isNullOrEmpty(fileName)) { return; } File f = new File(fileName); long size = f.length(); final InputStream fin = new BufferedInputStream(new FileInputStream(f)); final byte[] transferFile; try { transferFile = utils.getBytes(fin, (int) size); } finally { fin.close(); } resetStep2(); importTransferObject = getTransferFacadeRemote().prepareTransfer(isNuclon, transferFile); chbxImportAsNuclon.setEnabled(importTransferObject.getTransferOptions() .containsKey(TransferOption.IS_NUCLON_IMPORT_ALLOWED)); step.setComplete(!importTransferObject.result.hasCriticals()); if (!importTransferObject.result.hasCriticals() && !importTransferObject.result.hasWarnings()) { editWarnings.setText(localeDelegate.getMessage( "configuration.transfer.prepare.no.warnings", "Keine Warnungen")); } else { editWarnings.setText("<html><body><font color=\"#800000\">" + importTransferObject.result.getCriticals() + "</font>" + (importTransferObject.result.hasCriticals() ? "<br />" : "") + importTransferObject.result.getWarnings() + "</body></html>"); } int iPreviewSize = importTransferObject.getPreviewParts().size(); blnTransferWithWarnings = setupPreviewPanel(importTransferObject.getPreviewParts()); tabbedPane.setTitleAt(1, sDefaultPreparePreviewTabText + (iPreviewSize == 0 ? "" : " (" + iPreviewSize + ")")); lbNewUser.setText( "Neue Benutzer" + ": " + (importTransferObject.getNewUserCount() == 0 ? "keine" : importTransferObject.getNewUserCount())); } catch (Exception e) { // progressBar.setVisible(false); Errors.getInstance().showExceptionDialog(ifrm, e); } finally { btnBrowse.setEnabled(true); // progressBar.setVisible(false); ifrm.unlockLayer(); } if (blnTransferWithWarnings) { JOptionPane.showMessageDialog(jpnPreviewContent, localeDelegate.getMessage( "dbtransfer.import.step1.19", "Nicht alle Statements knnen durchgefhrt werden!\nBitte kontrollieren Sie die mit rot markierten Eintrge!", "Warning", JOptionPane.WARNING_MESSAGE)); } } }; t.start(); } }; final ActionListener browseAction = new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { final JFileChooser filechooser = utils.getFileChooser( localeDelegate.getMessage("configuration.transfer.file.nuclet", "Nuclet-Dateien"), ".nuclet"); final int iBtn = filechooser.showOpenDialog(ifrm); if (iBtn == JFileChooser.APPROVE_OPTION) { final File file = filechooser.getSelectedFile(); if (file != null) { tfTransferFile.setText(""); btnBrowse.setEnabled(false); //progressBar.setVisible(true); String fileName = file.getPath(); if (StringUtils.isNullOrEmpty(fileName)) { return; } tfTransferFile.setText(fileName); prepareImportAction.actionPerformed(new ActionEvent(this, 0, "prepare")); } } } }; final ActionListener importAsNuclonAction = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { isNuclon = chbxImportAsNuclon.isSelected(); prepareImportAction.actionPerformed(new ActionEvent(this, 0, "prepare")); } }; btnBrowse.addActionListener(browseAction); chbxImportAsNuclon.addActionListener(importAsNuclonAction); // progressBar.setVisible(false); return step; }