xref: /AOO41X/main/javainstaller2/src/JavaSetup/org/openoffice/setup/Panel/Prologue.java (revision 67e470dafe1997e73f56ff7ff4878983707e3e07)
1*9a1eeea9SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9a1eeea9SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9a1eeea9SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9a1eeea9SAndrew Rist  * distributed with this work for additional information
6*9a1eeea9SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9a1eeea9SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9a1eeea9SAndrew Rist  * "License"); you may not use this file except in compliance
9*9a1eeea9SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*9a1eeea9SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*9a1eeea9SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9a1eeea9SAndrew Rist  * software distributed under the License is distributed on an
15*9a1eeea9SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9a1eeea9SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9a1eeea9SAndrew Rist  * specific language governing permissions and limitations
18*9a1eeea9SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*9a1eeea9SAndrew Rist  *************************************************************/
21*9a1eeea9SAndrew Rist 
22*9a1eeea9SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir package org.openoffice.setup.Panel;
25cdf0e10cSrcweir 
26cdf0e10cSrcweir import org.openoffice.setup.InstallData;
27cdf0e10cSrcweir import org.openoffice.setup.PanelHelper.PanelLabel;
28cdf0e10cSrcweir import org.openoffice.setup.PanelHelper.PanelTitle;
29cdf0e10cSrcweir import org.openoffice.setup.ResourceManager;
30cdf0e10cSrcweir import java.awt.BorderLayout;
31cdf0e10cSrcweir import java.awt.ComponentOrientation;
32cdf0e10cSrcweir import java.awt.Insets;
33cdf0e10cSrcweir import javax.swing.JPanel;
34cdf0e10cSrcweir import javax.swing.border.EmptyBorder;
35cdf0e10cSrcweir 
36cdf0e10cSrcweir public class Prologue extends JPanel {
37cdf0e10cSrcweir 
Prologue()38cdf0e10cSrcweir     public Prologue() {
39cdf0e10cSrcweir 
40cdf0e10cSrcweir         InstallData data = InstallData.getInstance();
41cdf0e10cSrcweir 
42cdf0e10cSrcweir         setLayout(new java.awt.BorderLayout());
43cdf0e10cSrcweir         setBorder(new EmptyBorder(new Insets(10, 10, 10, 10)));
44cdf0e10cSrcweir 
45cdf0e10cSrcweir         String titleText = ResourceManager.getString("String_Prologue1");
46cdf0e10cSrcweir         PanelTitle titleBox = new PanelTitle(titleText);
47cdf0e10cSrcweir         if ( data.useRtl() ) { titleBox.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
48cdf0e10cSrcweir         add(titleBox, BorderLayout.NORTH);
49cdf0e10cSrcweir 
50cdf0e10cSrcweir         JPanel contentPanel = new JPanel();
51cdf0e10cSrcweir         contentPanel.setLayout(new java.awt.BorderLayout());
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         String text1 = ResourceManager.getString("String_Prologue2");
54cdf0e10cSrcweir         PanelLabel label1 = new PanelLabel(text1, true);
55cdf0e10cSrcweir         if ( data.useRtl() ) { label1.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
56cdf0e10cSrcweir         String text2 = ResourceManager.getString("String_Prologue3");
57cdf0e10cSrcweir         PanelLabel label2 = new PanelLabel(text2);
58cdf0e10cSrcweir         if ( data.useRtl() ) { label2.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
59cdf0e10cSrcweir 
60cdf0e10cSrcweir         contentPanel.add(label1, BorderLayout.NORTH);
61cdf0e10cSrcweir         contentPanel.add(label2, BorderLayout.CENTER);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir         if ( data.isUserInstallation() ) {
64cdf0e10cSrcweir             String text3 = ResourceManager.getString("String_Prologue4");
65cdf0e10cSrcweir             PanelLabel label3 = new PanelLabel(text3, true);
66cdf0e10cSrcweir             if ( data.useRtl() ) { label3.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); }
67cdf0e10cSrcweir             contentPanel.add(label3, BorderLayout.SOUTH);
68cdf0e10cSrcweir         }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir         add(contentPanel, BorderLayout.CENTER);
71cdf0e10cSrcweir     }
72cdf0e10cSrcweir }
73