diff options
Diffstat (limited to 'javainstaller2/src/JavaSetup/org/openoffice/setup/Panel')
14 files changed, 1824 insertions, 0 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/AcceptLicense.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/AcceptLicense.java new file mode 100755 index 000000000000..42c1f91cdb13 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/AcceptLicense.java @@ -0,0 +1,104 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.InstallData; +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Insets; +import java.io.File; +import javax.swing.JPanel; +import javax.swing.JEditorPane; +import javax.swing.JScrollPane; +import javax.swing.border.EmptyBorder; +public class AcceptLicense extends JPanel { + + public AcceptLicense() { + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titletext = ResourceManager.getString("String_AcceptLicense1"); + PanelTitle titlebox = new PanelTitle(titletext); + add(titlebox, BorderLayout.NORTH); + + JPanel contentpanel = new JPanel(); + contentpanel.setLayout(new java.awt.BorderLayout()); + + String text1 = ResourceManager.getString("String_AcceptLicense2"); + PanelLabel label1 = new PanelLabel(text1); + + String text2 = ResourceManager.getString("String_AcceptLicense3"); + PanelLabel label2 = new PanelLabel(text2, true); + + JEditorPane editorPane = createEditorPane(); + JScrollPane editorScrollPane = new JScrollPane(editorPane); + + editorScrollPane.setPreferredSize(new Dimension(250, 145)); + editorScrollPane.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10))); + + contentpanel.add(label1, BorderLayout.NORTH); + contentpanel.add(editorScrollPane, BorderLayout.CENTER); + contentpanel.add(label2, BorderLayout.SOUTH); + + add(contentpanel, BorderLayout.CENTER); + } + + private JEditorPane createEditorPane() { + JEditorPane editorPane = new JEditorPane(); + editorPane.setEditable(false); + + InstallData data = InstallData.getInstance(); + File htmlDirectory = data.getInfoRoot("html"); + String licenseFile = ResourceManager.getFileName("String_License_Filename"); + + if ( htmlDirectory != null) { + File htmlFile = new File(htmlDirectory, licenseFile); + if (! htmlFile.exists()) { + System.err.println("Couldn't find file: " + htmlFile.toString()); + } + + try { + // System.err.println("URLPath: " + htmlFile.toURL()); + editorPane.setContentType("text/html;charset=utf-8"); + editorPane.setPage(htmlFile.toURL()); + } catch (Exception e) { + e.printStackTrace(); + System.err.println("Attempted to read a bad URL"); + } + } else { + System.err.println("Did not find html directory"); + } + + return editorPane; + } +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseComponents.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseComponents.java new file mode 100755 index 000000000000..89f76db06227 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseComponents.java @@ -0,0 +1,189 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.PanelHelper.TreeNodeRenderer; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupData.DisplayPackageDescription; +import org.openoffice.setup.SetupData.SetupDataProvider; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Insets; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import org.openoffice.setup.InstallData; + +public class ChooseComponents extends JPanel implements MouseListener, KeyListener, TreeSelectionListener { + + private JTree componentTree; + private PanelLabel descriptionLabel; + private PanelLabel sizeLabel; + + private String sizeString; + private PanelTitle titleBox; + + public ChooseComponents() { + + InstallData data = InstallData.getInstance(); + + setLayout(new BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_ChooseComponents1"); + String subtitleText = ResourceManager.getString("String_ChooseComponents2"); + titleBox = new PanelTitle(titleText, subtitleText, 2, 40); + titleBox.addVerticalStrut(20); + add(titleBox, BorderLayout.NORTH); + + DefaultMutableTreeNode root = SetupDataProvider.createTree(); + + componentTree = new JTree(root); + componentTree.setShowsRootHandles(true); + componentTree.setRootVisible(false); + componentTree.setVisibleRowCount(3); + componentTree.setCellRenderer(new TreeNodeRenderer()); + componentTree.addMouseListener( this ); + componentTree.addKeyListener( this ); + componentTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + componentTree.addTreeSelectionListener(this); + // if ( data.useRtl() ) { componentTree.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String BorderTitle = ResourceManager.getString("String_ChooseComponents3"); + TitledBorder PanelBorder = BorderFactory.createTitledBorder(BorderTitle); + + BorderLayout PanelLayout = new BorderLayout(); + PanelLayout.setHgap(20); + JPanel DescriptionPanel = new JPanel(); + DescriptionPanel.setBorder(PanelBorder); + DescriptionPanel.setLayout(PanelLayout); + + String DescriptionText = ""; + descriptionLabel = new PanelLabel(DescriptionText, 3, 20); + sizeString = ResourceManager.getString("String_ChooseComponents4"); + sizeLabel = new PanelLabel(sizeString, 1, 5); + + DescriptionPanel.add(descriptionLabel, BorderLayout.CENTER); + DescriptionPanel.add(sizeLabel, BorderLayout.EAST); + if ( data.useRtl() ) { DescriptionPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + add(new JScrollPane(componentTree), BorderLayout.CENTER); + add(DescriptionPanel, BorderLayout.SOUTH); + } + + public void setTitleText(String s) { + titleBox.setTitle(s); + } + + private void updateNode(DefaultMutableTreeNode node) { + if (node != null) { + DisplayPackageDescription nodeInfo = (DisplayPackageDescription)node.getUserObject(); + nodeInfo.toggleState(node); + + DefaultTreeModel model = (DefaultTreeModel)componentTree.getModel(); + // model.nodeChanged(node); + + // The following line was included because of task i78481. + // In Java 1.6 nodeChanged does not work correctly. + model.nodeStructureChanged(node); + + descriptionLabel.setText(nodeInfo.getDescription()); + sizeLabel.setText(sizeString + nodeInfo.getSize()); + } + } + + /** + * Implement the MouseListener Interface + */ + public void mouseClicked(MouseEvent event) { + } + public void mouseEntered(MouseEvent event) { + } + public void mouseExited(MouseEvent event) { + } + public void mousePressed(MouseEvent event) { + TreePath selPath = componentTree.getPathForLocation( event.getX(), event.getY() ); + if ((selPath != null) && (componentTree.getPathBounds(selPath).getX() + 20 >= event.getX())) { + updateNode((DefaultMutableTreeNode)selPath.getLastPathComponent()); + } + } + public void mouseReleased(MouseEvent e) { + } + + /** + * Implement the KeyListener Interface + */ + public void keyPressed(KeyEvent event) { + } + public void keyReleased(KeyEvent event) { + } + public void keyTyped(KeyEvent event) { + if ( event.getKeyChar() == ' ' ) { + TreePath selPath = componentTree.getAnchorSelectionPath(); + if ( selPath != null ) { + updateNode((DefaultMutableTreeNode)selPath.getLastPathComponent()); + } + } + } + + /** + * Implement the TreeSelectionListener Interface. + */ + public void valueChanged(TreeSelectionEvent event) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)componentTree.getLastSelectedPathComponent(); + if (node == null) { + descriptionLabel.setText(""); + sizeLabel.setText(""); + } else { + DisplayPackageDescription nodeInfo = (DisplayPackageDescription)node.getUserObject(); + + nodeInfo.updateSize(node); // important to set default values for nodes + DefaultTreeModel model = (DefaultTreeModel)componentTree.getModel(); + model.nodeChanged(node); + + descriptionLabel.setText(nodeInfo.getDescription()); + sizeLabel.setText(sizeString + nodeInfo.getSize()); + } + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseDirectory.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseDirectory.java new file mode 100755 index 000000000000..15d44fa2d179 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseDirectory.java @@ -0,0 +1,185 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.InstallData; +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import javax.swing.Box; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.border.EmptyBorder; + +public class ChooseDirectory extends JPanel implements ActionListener { + + private JFileChooser directoryChooser; + private JFileChooser directoryChooserRootdir; + private JButton directoryButton; + private JButton directoryButtonRootdir; + private JTextField directoryField; + private JTextField directoryFieldRootdir; + private PanelLabel databaseProgress; + private PanelTitle titleBox; + + public ChooseDirectory() { + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_ChooseDirectory1"); + String subtitleText = ResourceManager.getString("String_ChooseDirectory2"); + + titleBox = new PanelTitle(titleText, subtitleText); + titleBox.addVerticalStrut(10); + add(titleBox, BorderLayout.NORTH); + + Box contentBox = new Box(BoxLayout.Y_AXIS); + + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new GridBagLayout()); + + directoryChooser = new JFileChooser(); + directoryChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + + String browseText = ResourceManager.getString("String_ChooseDirectory3"); + directoryButton = new JButton(browseText); + directoryButton.addActionListener(this); + + directoryField = new JTextField(); + + GridBagConstraints constraints = new GridBagConstraints(); + + constraints.gridx = 0; + constraints.gridy = 0; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(directoryField, constraints); + + constraints.gridx = 1; + constraints.gridy = 0; + constraints.weightx = 0; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(directoryButton, constraints); + + constraints.gridx = 0; + constraints.gridy = 1; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + contentBox.add(contentPanel); + + // defining a place for text output + databaseProgress = new PanelLabel(""); // planned for database progress + contentBox.add(databaseProgress); + + add(contentBox, BorderLayout.CENTER); + } + + public void setDatabaseText(String s) { + databaseProgress.setText(s); + } + + public void setTitleText(String s) { + titleBox.setTitle(s); + } + + public void setDirectory(String dir) { + directoryField.setText(dir); + } + + public void disableDirectoryField() { + directoryField.setEditable(false) ; + } + + public void disableBrowseButton() { + directoryButton.setEnabled(false); + } + + public void enableDirectoryField() { + directoryField.setEditable(true) ; + } + + public String getDirectory() { + return directoryField.getText(); + } + + public void setRootDirectory(String dir) { + directoryFieldRootdir.setText(dir); + } + + public String getRootDirectory() { + return directoryFieldRootdir.getText(); + } + + public void actionPerformed(ActionEvent e) { + + //Handle open button action. + if (e.getSource() == directoryButton) { + int ReturnValue = directoryChooser.showOpenDialog(ChooseDirectory.this); + + if (ReturnValue == JFileChooser.APPROVE_OPTION) { + File file = directoryChooser.getSelectedFile(); + directoryField.setText(file.getAbsolutePath()); + } else { + // do nothing for now + } + } + + if (e.getSource() == directoryButtonRootdir) { + int ReturnValue = directoryChooserRootdir.showOpenDialog(ChooseDirectory.this); + + if (ReturnValue == JFileChooser.APPROVE_OPTION) { + File file = directoryChooserRootdir.getSelectedFile(); + directoryFieldRootdir.setText(file.getAbsolutePath()); + } else { + // do nothing for now + } + } + + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseInstallationType.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseInstallationType.java new file mode 100755 index 000000000000..74a72c936800 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseInstallationType.java @@ -0,0 +1,180 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.Controller.ChooseInstallationTypeCtrl; +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.KeyEvent; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import org.openoffice.setup.InstallData; + +public class ChooseInstallationType extends JPanel { + + private JRadioButton custom; + private JRadioButton typical; + + public ChooseInstallationType() { + + InstallData data = InstallData.getInstance(); + + setLayout(new BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_ChooseInstallationType1"); + String subtitleText = ResourceManager.getString("String_ChooseInstallationType2"); + PanelTitle titleBox = new PanelTitle(titleText, subtitleText); + titleBox.addVerticalStrut(20); + + if ( data.useRtl() ) { titleBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + add(titleBox, BorderLayout.NORTH); + + String borderTitle = ResourceManager.getString("String_ChooseInstallationType3"); + TitledBorder PanelBorder = BorderFactory.createTitledBorder(borderTitle); + + JPanel contentPanel = new JPanel(); + contentPanel.setBorder(PanelBorder); + contentPanel.setLayout(new GridBagLayout()); + if ( data.useRtl() ) { contentPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + GridBagConstraints constraints = new GridBagConstraints(); + constraints.insets = new Insets(0, 0, 0, 10); + // constraints.anchor = GridBagConstraints.NORTHWEST; + + String typicalText = ResourceManager.getString("String_ChooseInstallationType4"); + PanelLabel typicalComment = new PanelLabel(typicalText, true); + if ( data.useRtl() ) { typicalComment.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + String customText = ResourceManager.getString("String_ChooseInstallationType5"); + PanelLabel customComment = new PanelLabel(customText, true); + if ( data.useRtl() ) { customComment.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ButtonGroup group = new ButtonGroup(); + + String typicalButtonText = ResourceManager.getString("String_ChooseInstallationType6"); + typical = new JRadioButton(typicalButtonText, true); + typical.setMnemonic(KeyEvent.VK_C); + if ( data.useRtl() ) { typical.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String customButtonText = ResourceManager.getString("String_ChooseInstallationType7"); + custom = new JRadioButton(customButtonText, false); + custom.setMnemonic(KeyEvent.VK_U); + if ( data.useRtl() ) { custom.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + group.add(typical); + group.add(custom); + + constraints.gridx = 0; + constraints.gridy = 0; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + constraints.gridx = 0; + constraints.gridy = 1; + constraints.weightx = 0; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(typical, constraints); + + constraints.gridx = 1; + constraints.gridy = 1; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(typicalComment, constraints); + + constraints.gridx = 0; + constraints.gridy = 2; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + constraints.gridx = 0; + constraints.gridy = 3; + constraints.weightx = 0; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(custom, constraints); + + constraints.gridx = 1; + constraints.gridy = 3; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(customComment, constraints); + + constraints.gridx = 0; + constraints.gridy = 4; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + add(contentPanel, BorderLayout.CENTER); + } + + public void setActionListener(ChooseInstallationTypeCtrl actionListener) { + typical.addActionListener(actionListener); + custom.addActionListener(actionListener); + } + + public void removeActionListener(ChooseInstallationTypeCtrl actionListener) { + typical.removeActionListener(actionListener); + custom.removeActionListener(actionListener); + } + + public void setTypicalActionCommand(String typicalActionCommand) { + typical.setActionCommand(typicalActionCommand); + } + + public void setCustomActionCommand(String customActionCommand) { + custom.setActionCommand(customActionCommand); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationComponents.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationComponents.java new file mode 100755 index 000000000000..81de5505bc3c --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationComponents.java @@ -0,0 +1,182 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.PanelHelper.TreeNodeRenderer; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupData.DisplayPackageDescription; +import org.openoffice.setup.SetupData.SetupDataProvider; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Insets; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTree; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeModel; +import javax.swing.tree.TreePath; +import javax.swing.tree.TreeSelectionModel; +import org.openoffice.setup.InstallData; + + +public class ChooseUninstallationComponents extends JPanel implements MouseListener, KeyListener, TreeSelectionListener { + + private JTree componentTree; + private PanelLabel descriptionLabel; + private PanelLabel sizeLabel; + + private String sizeString; + + public ChooseUninstallationComponents() { + + InstallData data = InstallData.getInstance(); + + setLayout(new BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_ChooseComponents1"); + String subtitleText = ResourceManager.getString("String_ChooseUninstallationComponents2"); + PanelTitle titleBox = new PanelTitle(titleText, subtitleText, 2, 40); + // PanelTitle titleBox = new PanelTitle(titleText, subtitleText); + titleBox.addVerticalStrut(20); + add(titleBox, BorderLayout.NORTH); + + DefaultMutableTreeNode root = SetupDataProvider.createTree(); + + componentTree = new JTree(root); + componentTree.setShowsRootHandles(true); + componentTree.setRootVisible(false); + componentTree.setVisibleRowCount(3); + componentTree.setCellRenderer(new TreeNodeRenderer()); + componentTree.addMouseListener( this ); + componentTree.addKeyListener( this ); + componentTree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); + componentTree.addTreeSelectionListener(this); + // if ( data.useRtl() ) { componentTree.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String BorderTitle = ResourceManager.getString("String_ChooseComponents3"); + TitledBorder PanelBorder = BorderFactory.createTitledBorder(BorderTitle); + + BorderLayout PanelLayout = new BorderLayout(); + PanelLayout.setHgap(20); + JPanel DescriptionPanel = new JPanel(); + DescriptionPanel.setBorder(PanelBorder); + DescriptionPanel.setLayout(PanelLayout); + + String DescriptionText = ""; + descriptionLabel = new PanelLabel(DescriptionText, 3, 20); + sizeString = ResourceManager.getString("String_ChooseComponents4"); + sizeLabel = new PanelLabel(sizeString, 1, 5); + if ( data.useRtl() ) { descriptionLabel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + DescriptionPanel.add(descriptionLabel, BorderLayout.CENTER); + DescriptionPanel.add(sizeLabel, BorderLayout.EAST); + if ( data.useRtl() ) { DescriptionPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + add(new JScrollPane(componentTree), BorderLayout.CENTER); + add(DescriptionPanel, BorderLayout.SOUTH); + } + + private void updateNode(DefaultMutableTreeNode node) { + if (node != null) { + DisplayPackageDescription nodeInfo = (DisplayPackageDescription)node.getUserObject(); + nodeInfo.toggleState(node); + + DefaultTreeModel model = (DefaultTreeModel)componentTree.getModel(); + model.nodeChanged(node); + + descriptionLabel.setText(nodeInfo.getDescription()); + sizeLabel.setText(sizeString + nodeInfo.getSize()); + } + } + + /** + * Implement the MouseListener Interface + */ + public void mouseClicked(MouseEvent event) { + } + public void mouseEntered(MouseEvent event) { + } + public void mouseExited(MouseEvent event) { + } + public void mousePressed(MouseEvent event) { + TreePath selPath = componentTree.getPathForLocation( event.getX(), event.getY() ); + if ((selPath != null) && (componentTree.getPathBounds(selPath).getX() + 20 >= event.getX())) { + updateNode((DefaultMutableTreeNode)selPath.getLastPathComponent()); + } + } + public void mouseReleased(MouseEvent e) { + } + + /** + * Implement the KeyListener Interface + */ + public void keyPressed(KeyEvent event) { + } + public void keyReleased(KeyEvent event) { + } + public void keyTyped(KeyEvent event) { + if ( event.getKeyChar() == ' ' ) { + TreePath selPath = componentTree.getAnchorSelectionPath(); + if ( selPath != null ) { + updateNode((DefaultMutableTreeNode)selPath.getLastPathComponent()); + } + } + } + + /** + * Implement the TreeSelectionListener Interface. + */ + public void valueChanged(TreeSelectionEvent event) { + DefaultMutableTreeNode node = (DefaultMutableTreeNode)componentTree.getLastSelectedPathComponent(); + if (node == null) { + descriptionLabel.setText(""); + sizeLabel.setText(""); + } else { + DisplayPackageDescription nodeInfo = (DisplayPackageDescription)node.getUserObject(); + + nodeInfo.updateSize(node); // important to set default values for nodes + DefaultTreeModel model = (DefaultTreeModel)componentTree.getModel(); + model.nodeChanged(node); + + descriptionLabel.setText(nodeInfo.getDescription()); + sizeLabel.setText(sizeString + nodeInfo.getSize()); + } + } +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationType.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationType.java new file mode 100755 index 000000000000..45e29ba575de --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/ChooseUninstallationType.java @@ -0,0 +1,176 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.Controller.ChooseUninstallationTypeCtrl; +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.KeyEvent; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JRadioButton; +import javax.swing.border.EmptyBorder; +import javax.swing.border.TitledBorder; +import org.openoffice.setup.InstallData; + +public class ChooseUninstallationType extends JPanel { + + private JRadioButton custom; + private JRadioButton complete; + + public ChooseUninstallationType() { + + InstallData data = InstallData.getInstance(); + + setLayout(new BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_ChooseUninstallationType1"); + String subtitleText = ResourceManager.getString("String_ChooseUninstallationType2"); + PanelTitle titleBox = new PanelTitle(titleText, subtitleText); + titleBox.addVerticalStrut(20); + add(titleBox, BorderLayout.NORTH); + + String borderTitle = ResourceManager.getString("String_ChooseUninstallationType1"); + TitledBorder PanelBorder = BorderFactory.createTitledBorder(borderTitle); + + JPanel contentPanel = new JPanel(); + contentPanel.setBorder(PanelBorder); + contentPanel.setLayout(new GridBagLayout()); + if ( data.useRtl() ) { contentPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + GridBagConstraints constraints = new GridBagConstraints(); + constraints.insets = new Insets(0, 0, 0, 10); + // constraints.anchor = GridBagConstraints.NORTHWEST; + + String completeText = ResourceManager.getString("String_ChooseUninstallationType4"); + PanelLabel completeComment = new PanelLabel(completeText, true); + if ( data.useRtl() ) { completeComment.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + String customText = ResourceManager.getString("String_ChooseUninstallationType5"); + PanelLabel customComment = new PanelLabel(customText, true); + if ( data.useRtl() ) { customComment.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ButtonGroup group = new ButtonGroup(); + + String completeButtonText = ResourceManager.getString("String_ChooseUninstallationType6"); + complete = new JRadioButton(completeButtonText, true); + complete.setMnemonic(KeyEvent.VK_C); + if ( data.useRtl() ) { complete.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + String customButtonText = ResourceManager.getString("String_ChooseUninstallationType3"); + custom = new JRadioButton(customButtonText, false); + custom.setMnemonic(KeyEvent.VK_U); + if ( data.useRtl() ) { custom.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + group.add(complete); + group.add(custom); + + constraints.gridx = 0; + constraints.gridy = 0; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + constraints.gridx = 0; + constraints.gridy = 1; + constraints.weightx = 0; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(complete, constraints); + + constraints.gridx = 1; + constraints.gridy = 1; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(completeComment, constraints); + + constraints.gridx = 0; + constraints.gridy = 2; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + constraints.gridx = 0; + constraints.gridy = 3; + constraints.weightx = 0; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(custom, constraints); + + constraints.gridx = 1; + constraints.gridy = 3; + constraints.weightx = 1; + constraints.weighty = 0; + constraints.fill = GridBagConstraints.HORIZONTAL; + + contentPanel.add(customComment, constraints); + + constraints.gridx = 0; + constraints.gridy = 4; + constraints.weightx = 0; + constraints.weighty = 1; + constraints.fill = GridBagConstraints.VERTICAL; + + contentPanel.add(new JPanel(), constraints); + + add(contentPanel, BorderLayout.CENTER); + } + + public void setActionListener(ChooseUninstallationTypeCtrl actionListener) { + complete.addActionListener(actionListener); + custom.addActionListener(actionListener); + } + + public void removeActionListener(ChooseUninstallationTypeCtrl actionListener) { + complete.removeActionListener(actionListener); + custom.removeActionListener(actionListener); + } + + public void setCompleteActionCommand(String completeActionCommand) { + complete.setActionCommand(completeActionCommand); + } + + public void setCustomActionCommand(String customActionCommand) { + custom.setActionCommand(customActionCommand); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationImminent.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationImminent.java new file mode 100755 index 000000000000..7fda225f55d9 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationImminent.java @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Dimension; +import java.awt.Insets; +import javax.swing.JEditorPane; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class InstallationImminent extends JPanel { + + private String infoText; + private JEditorPane ProductInformation; + private JScrollPane ProductPane; + private PanelTitle titlebox; + + public InstallationImminent() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titletext = ResourceManager.getString("String_InstallationImminent1"); + titlebox = new PanelTitle(titletext); + add(titlebox, BorderLayout.NORTH); + + JPanel contentpanel = new JPanel(); + contentpanel.setLayout(new java.awt.BorderLayout()); + if ( data.useRtl() ) { contentpanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String text1 = ResourceManager.getString("String_InstallationImminent2"); + PanelLabel label1 = new PanelLabel(text1); + if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ProductInformation = new JEditorPane("text/html", getInfoText()); + ProductInformation.setEditable(false); + if ( data.useRtl() ) { ProductInformation.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ProductPane = new JScrollPane(ProductInformation); + ProductPane.setPreferredSize(new Dimension(250, 145)); + ProductPane.setBorder(new EmptyBorder(10, 0, 10, 0)); + if ( data.useRtl() ) { ProductPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + contentpanel.add(label1, BorderLayout.NORTH); + contentpanel.add(ProductPane, BorderLayout.CENTER); + + add(contentpanel, BorderLayout.CENTER); + } + + public void setInfoText(String text) { + infoText = text; + updateInfoText(); + } + + public void setTitleText(String s) { + titlebox.setTitle(s); + } + + public String getInfoText() { + return infoText; + } + + public void updateInfoText() { + ProductInformation.setText(infoText); + } + + public void setTabOrder() { + JScrollBar ScrollBar = ProductPane.getVerticalScrollBar(); + if ( ScrollBar.isShowing() ) { + ProductInformation.setFocusable(true); + } else { + ProductInformation.setFocusable(false); + } + } + + public void setCaretPosition() { + ProductInformation.setCaretPosition(0); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationOngoing.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationOngoing.java new file mode 100755 index 000000000000..7daf033ab3bd --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/InstallationOngoing.java @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupActionListener; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Container; +import java.awt.Insets; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class InstallationOngoing extends JPanel { + + private PanelLabel currentProgress; + private JProgressBar progressBar; + private JButton mStopButton; + private String mTitle = ""; + private PanelTitle mTitlebox; + + public InstallationOngoing() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + // String titleText = ResourceManager.getString("String_InstallationOngoing1"); + // PanelTitle titlebox = new PanelTitle(titleText); + // PanelTitle titlebox = new PanelTitle(mTitle); + mTitlebox = new PanelTitle(mTitle); + mTitlebox.addVerticalStrut(20); + add(mTitlebox, BorderLayout.NORTH); + + Container contentbox = Box.createVerticalBox(); + if ( data.useRtl() ) { contentbox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + // String progressText = ResourceManager.getString("String_InstallationOngoing2"); + String progressText = ""; + currentProgress = new PanelLabel(progressText); + + Container innerbox = Box.createHorizontalBox(); + if ( data.useRtl() ) { innerbox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + progressBar = new JProgressBar(0, 100); + if ( data.useRtl() ) { progressBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + mStopButton = new JButton(); + String progressButtonText = ResourceManager.getString("String_InstallationOngoing3"); + mStopButton.setText(progressButtonText); + mStopButton.setEnabled(true); + if ( data.useRtl() ) { mStopButton.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + innerbox.add(progressBar); + innerbox.add(Box.createHorizontalStrut(10)); + innerbox.add(mStopButton); + + contentbox.add(currentProgress); + contentbox.add(Box.createVerticalStrut(10)); + contentbox.add(innerbox); + contentbox.add(Box.createVerticalStrut(20)); + + add(contentbox, BorderLayout.SOUTH); + } + + public void setProgressText(String s) { + currentProgress.setText(s); + } + + public void setProgressValue(int i) { + progressBar.setValue(i); + } + + public void setTitle(String title) { + mTitlebox.setTitle(title); + mTitle = title; + } + + public void setStopButtonActionCommand(String actionCommand) { + mStopButton.setActionCommand(actionCommand); + } + + public void addStopButtonActionListener(SetupActionListener actionListener) { + mStopButton.addActionListener(actionListener); + } + + public void setStopButtonEnabled(boolean enabled) { + mStopButton.setEnabled(enabled); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/Prologue.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/Prologue.java new file mode 100755 index 000000000000..5209c98241ee --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/Prologue.java @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.InstallData; +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Insets; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; + +public class Prologue extends JPanel { + + public Prologue() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_Prologue1"); + PanelTitle titleBox = new PanelTitle(titleText); + if ( data.useRtl() ) { titleBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + add(titleBox, BorderLayout.NORTH); + + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new java.awt.BorderLayout()); + + String text1 = ResourceManager.getString("String_Prologue2"); + PanelLabel label1 = new PanelLabel(text1, true); + if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + String text2 = ResourceManager.getString("String_Prologue3"); + PanelLabel label2 = new PanelLabel(text2); + if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + contentPanel.add(label1, BorderLayout.NORTH); + contentPanel.add(label2, BorderLayout.CENTER); + + if ( data.isUserInstallation() ) { + String text3 = ResourceManager.getString("String_Prologue4"); + PanelLabel label3 = new PanelLabel(text3, true); + if ( data.useRtl() ) { label3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + contentPanel.add(label3, BorderLayout.SOUTH); + } + + add(contentPanel, BorderLayout.CENTER); + } +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationCompleted.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationCompleted.java new file mode 100755 index 000000000000..1c724fc47c86 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationCompleted.java @@ -0,0 +1,108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupActionListener; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Dimension; +import java.awt.Insets; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class UninstallationCompleted extends JPanel { + + public static final String ACTION_DETAILS = "ActionDetails"; + public static final int BUTTON_DETAILS = 5; + private JButton mDetailsButton; + private PanelLabel varLabel; + private PanelTitle titleBox; + + public UninstallationCompleted() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_UninstallationCompleted1"); + titleBox = new PanelTitle(titleText); + add(titleBox, BorderLayout.NORTH); + + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new java.awt.BorderLayout()); + if ( data.useRtl() ) { contentPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String dialogText = ResourceManager.getString("String_UninstallationCompleted2"); + varLabel = new PanelLabel(dialogText, true); + String text2 = ResourceManager.getString("String_InstallationCompleted3"); + PanelLabel label2 = new PanelLabel(text2); + if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + mDetailsButton = new JButton(); + String buttonText = ResourceManager.getString("String_InstallationCompleted_Button"); + mDetailsButton.setText(buttonText); + mDetailsButton.setEnabled(true); + if ( data.useRtl() ) { mDetailsButton.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + JPanel ButtonPanel = new JPanel(); + ButtonPanel.setLayout(new BorderLayout()); + ButtonPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10))); + ButtonPanel.setPreferredSize(new Dimension(120, 44)); + ButtonPanel.add(mDetailsButton, BorderLayout.NORTH); + if ( data.useRtl() ) { ButtonPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + contentPanel.add(varLabel, BorderLayout.NORTH); + contentPanel.add(ButtonPanel, BorderLayout.EAST); + contentPanel.add(label2, BorderLayout.CENTER); + + add(contentPanel, BorderLayout.CENTER); + } + + public void setDetailsButtonActionCommand(String actionCommand) { + mDetailsButton.setActionCommand(actionCommand); + } + + public void addDetailsButtonActionListener(SetupActionListener actionListener) { + mDetailsButton.addActionListener(actionListener); + } + + public void setTitleText(String s) { + titleBox.setTitle(s); + } + + public void setDialogText(String text) { + varLabel.setText(text); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationImminent.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationImminent.java new file mode 100755 index 000000000000..fdef8958a676 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationImminent.java @@ -0,0 +1,110 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Dimension; +import java.awt.Insets; +import javax.swing.JEditorPane; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class UninstallationImminent extends JPanel { + + private String infoText; + private JEditorPane ProductInformation; + private JScrollPane ProductPane; + + public UninstallationImminent() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titletext = ResourceManager.getString("String_UninstallationImminent1"); + PanelTitle titlebox = new PanelTitle(titletext); + add(titlebox, BorderLayout.NORTH); + + JPanel contentpanel = new JPanel(); + contentpanel.setLayout(new java.awt.BorderLayout()); + if ( data.useRtl() ) { contentpanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String text1 = ResourceManager.getString("String_UninstallationImminent2"); + PanelLabel label1 = new PanelLabel(text1); + if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ProductInformation = new JEditorPane("text/html", getInfoText()); + ProductInformation.setEditable(false); + if ( data.useRtl() ) { ProductInformation.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + ProductPane = new JScrollPane(ProductInformation); + ProductPane.setPreferredSize(new Dimension(250, 145)); + ProductPane.setBorder(new EmptyBorder(10, 0, 10, 0)); + if ( data.useRtl() ) { ProductPane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + contentpanel.add(label1, BorderLayout.NORTH); + contentpanel.add(ProductPane, BorderLayout.CENTER); + + add(contentpanel, BorderLayout.CENTER); + } + + public void setInfoText(String text) { + infoText = text; + updateInfoText(); + } + + public String getInfoText() { + return infoText; + } + + public void updateInfoText() { + ProductInformation.setText(infoText); + } + + public void setTabOrder() { + JScrollBar ScrollBar = ProductPane.getVerticalScrollBar(); + if ( ScrollBar.isShowing() ) { + ProductInformation.setFocusable(true); + } else { + ProductInformation.setFocusable(false); + } + } + + public void setCaretPosition() { + ProductInformation.setCaretPosition(0); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationOngoing.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationOngoing.java new file mode 100755 index 000000000000..6934308d6b47 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationOngoing.java @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupActionListener; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Container; +import java.awt.Insets; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class UninstallationOngoing extends JPanel { + + private PanelLabel currentProgress; + private JProgressBar progressBar; + private JButton mStopButton; + + public UninstallationOngoing() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_UninstallationOngoing1"); + PanelTitle titlebox = new PanelTitle(titleText); + titlebox.addVerticalStrut(20); + add(titlebox, BorderLayout.NORTH); + + Container contentbox = Box.createVerticalBox(); + if ( data.useRtl() ) { contentbox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + // String progressText = ResourceManager.getString("String_UninstallationOngoing2"); + String progressText = ""; + currentProgress = new PanelLabel(progressText); + + Container innerbox = Box.createHorizontalBox(); + if ( data.useRtl() ) { innerbox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + progressBar = new JProgressBar(0, 100); + if ( data.useRtl() ) { progressBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + mStopButton = new JButton(); + if ( data.useRtl() ) { mStopButton.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + String progressButtonText = ResourceManager.getString("String_InstallationOngoing3"); + mStopButton.setText(progressButtonText); + mStopButton.setEnabled(true); + + innerbox.add(progressBar); + innerbox.add(Box.createHorizontalStrut(10)); + innerbox.add(mStopButton); + + contentbox.add(currentProgress); + contentbox.add(Box.createVerticalStrut(10)); + contentbox.add(innerbox); + contentbox.add(Box.createVerticalStrut(20)); + + add(contentbox, BorderLayout.SOUTH); + } + + public void setProgressText(String s) { + currentProgress.setText(s); + } + + public void setProgressValue(int i) { + progressBar.setValue(i); + } + + public void setStopButtonActionCommand(String actionCommand) { + mStopButton.setActionCommand(actionCommand); + } + + public void addStopButtonActionListener(SetupActionListener actionListener) { + mStopButton.addActionListener(actionListener); + } + +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationPrologue.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationPrologue.java new file mode 100755 index 000000000000..d8ec108298b4 --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/UninstallationPrologue.java @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import java.awt.BorderLayout; +import java.awt.Insets; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; + +public class UninstallationPrologue extends JPanel { + + public UninstallationPrologue() { + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_Prologue1"); + PanelTitle titleBox = new PanelTitle(titleText); + add(titleBox, BorderLayout.NORTH); + + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new java.awt.BorderLayout()); + + String text1 = ResourceManager.getString("String_UninstallationPrologue2"); + PanelLabel label1 = new PanelLabel(text1, true); + String text2 = ResourceManager.getString("String_Prologue3"); + PanelLabel label2 = new PanelLabel(text2); + + contentPanel.add(label1, BorderLayout.NORTH); + contentPanel.add(label2, BorderLayout.CENTER); + + add(contentPanel, BorderLayout.CENTER); + } +} diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/installationCompleted.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/installationCompleted.java new file mode 100755 index 000000000000..e34636da8d6f --- /dev/null +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/installationCompleted.java @@ -0,0 +1,107 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package org.openoffice.setup.Panel; + +import org.openoffice.setup.PanelHelper.PanelLabel; +import org.openoffice.setup.PanelHelper.PanelTitle; +import org.openoffice.setup.ResourceManager; +import org.openoffice.setup.SetupActionListener; +import java.awt.BorderLayout; +import java.awt.ComponentOrientation; +import java.awt.Dimension; +import java.awt.Insets; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; +import org.openoffice.setup.InstallData; + +public class installationCompleted extends JPanel { + + public static final String ACTION_DETAILS = "ActionDetails"; + public static final int BUTTON_DETAILS = 5; + private JButton mDetailsButton; + private PanelLabel varLabel; + private PanelTitle titleBox; + + public installationCompleted() { + + InstallData data = InstallData.getInstance(); + + setLayout(new java.awt.BorderLayout()); + setBorder(new EmptyBorder(new Insets(10, 10, 10, 10))); + + String titleText = ResourceManager.getString("String_InstallationCompleted1"); + titleBox = new PanelTitle(titleText); + add(titleBox, BorderLayout.NORTH); + + JPanel contentPanel = new JPanel(); + contentPanel.setLayout(new java.awt.BorderLayout()); + if ( data.useRtl() ) { contentPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + String dialogText = ResourceManager.getString("String_InstallationCompleted2"); + varLabel = new PanelLabel(dialogText, true); + String text2 = ResourceManager.getString("String_InstallationCompleted3"); + PanelLabel label2 = new PanelLabel(text2); + if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + mDetailsButton = new JButton(); + String buttonText = ResourceManager.getString("String_InstallationCompleted_Button"); + mDetailsButton.setText(buttonText); + mDetailsButton.setEnabled(true); + if ( data.useRtl() ) { mDetailsButton.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + JPanel ButtonPanel = new JPanel(); + ButtonPanel.setLayout(new BorderLayout()); + ButtonPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10))); + ButtonPanel.setPreferredSize(new Dimension(120, 44)); + ButtonPanel.add(mDetailsButton, BorderLayout.NORTH); + if ( data.useRtl() ) { ButtonPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); } + + contentPanel.add(varLabel, BorderLayout.NORTH); + contentPanel.add(ButtonPanel, BorderLayout.EAST); + contentPanel.add(label2, BorderLayout.CENTER); + + add(contentPanel, BorderLayout.CENTER); + } + + public void setDetailsButtonActionCommand(String actionCommand) { + mDetailsButton.setActionCommand(actionCommand); + } + + public void addDetailsButtonActionListener(SetupActionListener actionListener) { + mDetailsButton.addActionListener(actionListener); + } + + public void setTitleText(String s) { + titleBox.setTitle(s); + } + + public void setDialogText(String text) { + varLabel.setText(text); + } +} |