cleanup
[fedora-idea.git] / platform / platform-api / src / com / intellij / ui / TitledSeparator.java
blob5a57b193a318933b26ed1f0157c7db366a901220
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package com.intellij.ui;
19 import javax.swing.*;
20 import java.awt.*;
22 /**
23 * @author cdr
25 public class TitledSeparator extends JPanel {
26 private final JLabel myLabel = new JLabel();
28 public TitledSeparator() {
29 setLayout(new GridBagLayout());
30 add(myLabel, new GridBagConstraints(0,0,1,0,0,0,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0,5,0,5), 0,0));
31 JSeparator separator = new JSeparator(SwingConstants.HORIZONTAL);
32 add(separator, new GridBagConstraints(1,0,GridBagConstraints.REMAINDER,0,1,0,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,5), 0,0));
35 public TitledSeparator(String text) {
36 this();
37 setText(text);
40 public String getText() {
41 return myLabel.getText();
43 public void setText(String text) {
44 myLabel.setText(text);
47 public void setTitleFont(Font font) {
48 myLabel.setFont(font);