1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package org.openoffice.setup.Panel;
25 
26 import org.openoffice.setup.PanelHelper.PanelLabel;
27 import org.openoffice.setup.PanelHelper.PanelTitle;
28 import org.openoffice.setup.ResourceManager;
29 import org.openoffice.setup.SetupActionListener;
30 import java.awt.BorderLayout;
31 import java.awt.ComponentOrientation;
32 import java.awt.Dimension;
33 import java.awt.Insets;
34 import javax.swing.JButton;
35 import javax.swing.JPanel;
36 import javax.swing.border.EmptyBorder;
37 import org.openoffice.setup.InstallData;
38 
39 public class UninstallationCompleted extends JPanel {
40 
41     public static final String ACTION_DETAILS   = "ActionDetails";
42     public static final int BUTTON_DETAILS  = 5;
43     private JButton mDetailsButton;
44     private PanelLabel varLabel;
45     private PanelTitle titleBox;
46 
UninstallationCompleted()47     public UninstallationCompleted() {
48 
49         InstallData data = InstallData.getInstance();
50 
51         setLayout(new java.awt.BorderLayout());
52         setBorder(new EmptyBorder(new Insets(10, 10, 10, 10)));
53 
54         String titleText = ResourceManager.getString("String_UninstallationCompleted1");
55         titleBox = new PanelTitle(titleText);
56         add(titleBox, BorderLayout.NORTH);
57 
58         JPanel contentPanel = new JPanel();
59         contentPanel.setLayout(new java.awt.BorderLayout());
60         if ( data.useRtl() ) { contentPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
61 
62         String dialogText = ResourceManager.getString("String_UninstallationCompleted2");
63         varLabel = new PanelLabel(dialogText, true);
64         String text2 = ResourceManager.getString("String_InstallationCompleted3");
65         PanelLabel label2 = new PanelLabel(text2);
66         if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
67 
68         mDetailsButton = new JButton();
69         String buttonText = ResourceManager.getString("String_InstallationCompleted_Button");
70         mDetailsButton.setText(buttonText);
71         mDetailsButton.setEnabled(true);
72         if ( data.useRtl() ) { mDetailsButton.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
73 
74         JPanel ButtonPanel = new JPanel();
75         ButtonPanel.setLayout(new BorderLayout());
76         ButtonPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
77         ButtonPanel.setPreferredSize(new Dimension(120, 44));
78         ButtonPanel.add(mDetailsButton, BorderLayout.NORTH);
79         if ( data.useRtl() ) { ButtonPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
80 
81         contentPanel.add(varLabel, BorderLayout.NORTH);
82         contentPanel.add(ButtonPanel, BorderLayout.EAST);
83         contentPanel.add(label2, BorderLayout.CENTER);
84 
85         add(contentPanel, BorderLayout.CENTER);
86     }
87 
setDetailsButtonActionCommand(String actionCommand)88     public void setDetailsButtonActionCommand(String actionCommand) {
89         mDetailsButton.setActionCommand(actionCommand);
90     }
91 
addDetailsButtonActionListener(SetupActionListener actionListener)92     public void addDetailsButtonActionListener(SetupActionListener actionListener) {
93         mDetailsButton.addActionListener(actionListener);
94     }
95 
setTitleText(String s)96     public void setTitleText(String s) {
97         titleBox.setTitle(s);
98     }
99 
setDialogText(String text)100     public void setDialogText(String text) {
101         varLabel.setText(text);
102     }
103 
104 }
105