From b67af12576f51573a030b4e63d985d40254b4a8d Mon Sep 17 00:00:00 2001 From: Sergey Vasiliev Date: Fri, 10 Feb 2006 17:46:21 +0300 Subject: [PATCH] jsf forms refactoring --- .../intellij/jsf/ui/forms/CaptionComponent.form | 26 ++++++++++++ .../intellij/jsf/ui/forms/CaptionComponent.java | 46 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 web/source/com/intellij/jsf/ui/forms/CaptionComponent.form create mode 100644 web/source/com/intellij/jsf/ui/forms/CaptionComponent.java diff --git a/web/source/com/intellij/jsf/ui/forms/CaptionComponent.form b/web/source/com/intellij/jsf/ui/forms/CaptionComponent.form new file mode 100644 index 0000000000..274c5c1b4e --- /dev/null +++ b/web/source/com/intellij/jsf/ui/forms/CaptionComponent.form @@ -0,0 +1,26 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/source/com/intellij/jsf/ui/forms/CaptionComponent.java b/web/source/com/intellij/jsf/ui/forms/CaptionComponent.java new file mode 100644 index 0000000000..bf808f619b --- /dev/null +++ b/web/source/com/intellij/jsf/ui/forms/CaptionComponent.java @@ -0,0 +1,46 @@ +package com.intellij.jsf.ui.forms; + +import javax.swing.*; +import java.awt.*; + +/** + * User: Sergey.Vasiliev + */ +public class CaptionComponent extends JPanel { + private JPanel myRootPanel; + private JLabel myCaptionLabel; + + private boolean myBordered = true; + + public CaptionComponent() { + updateBorder(); + setLayout(new BorderLayout()); + add(myRootPanel, BorderLayout.CENTER); + } + + private void updateBorder() { + if (myBordered) { + myRootPanel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK)); + } + else { + myRootPanel.setBorder(BorderFactory.createEmptyBorder()); + } + } + + public void setText(final String text) { + myCaptionLabel.setText(text); + } + + public String getText() { + return myCaptionLabel.getText(); + } + + public boolean isBordered() { + return myBordered; + } + + public void setBordered(final boolean bordered) { + myBordered = bordered; + updateBorder(); + } +} -- 2.11.4.GIT