/** * Show the amount of free space available for the installation path. */ private void showFreeSpace() { if (IoHelper.supported("getFreeSpace") && freeSpaceLabel != null) { String msg = null; long freeBytes = getAvaiableBytes(); if (freeBytes < 0) { msg = getString("PacksPanel.notAscertainable"); } else { msg = Pack.toByteUnitsString(freeBytes); } freeSpaceLabel.setText(msg); } }
@Override public void showFreeSpace() { if (IoHelper.supported("getFreeSpace") && freeSpaceLabel != null) { String msg; freeBytes = IoHelper.getFreeSpace(IoHelper.existingParent( new File(this.installData.getInstallPath())).getAbsolutePath()); if (freeBytes < 0) { msg = getString("PacksPanel.notAscertainable"); } else { msg = Pack.toByteUnitsString(freeBytes); } freeSpaceLabel.setText(msg); } }
/** * Indicates whether the panel has been validated or not. * * @return true if the needed space is less than the free space, else false */ @Override public boolean isValidated() { packsModel.updatePacksToInstall(); long freeBytes = getAvaiableBytes(); if (IoHelper.supported("getFreeSpace") && freeBytes >= 0 && freeBytes <= packsModel.getTotalByteSize()) { JOptionPane.showMessageDialog( this, getString("PacksPanel.notEnoughSpace"), getString("installer.error"), JOptionPane.ERROR_MESSAGE); return false; } return true; }
public boolean isValidated() if (IoHelper.supported("getFreeSpace") && freeBytes >= 0 && freeBytes <= bytes)
@Override protected void createNormalLayout() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); createLabel("PacksPanel.info", "preferences", null, null); add(Box.createRigidArea(new Dimension(0, 3))); createLabel("PacksPanel.tip", "tip", null, null); add(Box.createRigidArea(new Dimension(0, 5))); tableScroller = new JScrollPane(); packsTable = createPacksTable(300, tableScroller, null, null); if (dependenciesExist) { dependencyArea = createTextArea("PacksPanel.dependencyList", null, null, null); } descriptionArea = createTextArea("PacksPanel.description", null, null, null); spaceLabel = createPanelWithLabel("PacksPanel.space", null, null); if (IoHelper.supported("getFreeSpace")) { add(Box.createRigidArea(new Dimension(0, 3))); freeSpaceLabel = createPanelWithLabel("PacksPanel.freespace", null, null); } }
if (IoHelper.supported("getFreeSpace"))
/** * The Implementation of this method should create the layout for the current class. */ private void createNormalLayout() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); createLabel("PacksPanel.info", "preferences", null, null); add(Box.createRigidArea(new Dimension(0, 3))); createLabel("PacksPanel.tip", "tip", null, null); add(Box.createRigidArea(new Dimension(0, 5))); tableScroller = new JScrollPane(); tableScroller.setColumnHeaderView(null); tableScroller.setColumnHeader(null); packsTree = createPacksTree(300, tableScroller, null, null); if (packsModel.dependenciesExist()) { dependencyArea = createTextArea("PacksPanel.dependencyList", null, null, null); } descriptionArea = createTextArea("PacksPanel.description", null, null, null); requiredSpaceLabel = createPanelWithLabel("PacksPanel.space", null, null); if (IoHelper.supported("getFreeSpace")) { add(Box.createRigidArea(new Dimension(0, 3))); freeSpaceLabel = createPanelWithLabel("PacksPanel.freespace", null, null); } }