public static boolean fixErrors(List<DatabaseError> list, ProgressCallbackListener pcl) { DriveMap.tryWait(); pcl.setMax(list.size()); pcl.reset(); boolean fullsuccess = true; for (int i = 0; i < list.size(); i++) { pcl.step(); DatabaseError error = list.get(i); if (!canFix(list, error)) continue; boolean succval = error.autoFix(); if (!succval) { CCLog.addWarning( LocaleBundle.getFormattedString( "CheckDatabaseDialog.Autofix.problem", error.getErrorString(), error.getElement1Name())); // $NON-NLS-1$ fullsuccess = false; } } pcl.reset(); return fullsuccess; }
private void initGUI() { setTitle(LocaleBundle.getString("SearchFrame.this.title")); // $NON-NLS-1$ setIconImage(CachedResourceLoader.getImage(Resources.IMG_FRAME_ICON)); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); pnTop = new JPanel(); getContentPane().add(pnTop, BorderLayout.NORTH); pnTop.setLayout(new BorderLayout(0, 0)); edSearch = new JTextField(); edSearch .getDocument() .addDocumentListener( new DocumentListener() { @Override public void removeUpdate(DocumentEvent arg0) { onUpdate(); } @Override public void insertUpdate(DocumentEvent arg0) { onUpdate(); } @Override public void changedUpdate(DocumentEvent arg0) { onUpdate(); } }); pnTop.add(edSearch, BorderLayout.CENTER); edSearch.setColumns(40); verticalStrut = Box.createVerticalStrut(5); pnTop.add(verticalStrut, BorderLayout.NORTH); verticalStrut_1 = Box.createVerticalStrut(10); pnTop.add(verticalStrut_1, BorderLayout.SOUTH); horizontalStrut = Box.createHorizontalStrut(5); pnTop.add(horizontalStrut, BorderLayout.WEST); horizontalStrut_1 = Box.createHorizontalStrut(5); pnTop.add(horizontalStrut_1, BorderLayout.EAST); horizontalStrut_2 = Box.createHorizontalStrut(5); getContentPane().add(horizontalStrut_2, BorderLayout.WEST); horizontalStrut_3 = Box.createHorizontalStrut(5); getContentPane().add(horizontalStrut_3, BorderLayout.EAST); verticalStrut_2 = Box.createVerticalStrut(5); getContentPane().add(verticalStrut_2, BorderLayout.SOUTH); scrollPane = new JScrollPane(); getContentPane().add(scrollPane, BorderLayout.CENTER); lsMain = new JList<>(); lsMain.setVisibleRowCount(12); lsMain.setModel(lsmdl = new DefaultListModel<>()); lsMain.addMouseListener( new MouseListener() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { onDblClick(); } } @Override public void mouseEntered(MouseEvent arg0) { // nothing } @Override public void mouseExited(MouseEvent arg0) { // nothing } @Override public void mousePressed(MouseEvent arg0) { // nothing } @Override public void mouseReleased(MouseEvent arg0) { // nothing } }); scrollPane.setViewportView(lsMain); pack(); }