View Javadoc

    1   /*
    2    * Licensed to the Apache Software Foundation (ASF) under one or more
    3    * contributor license agreements.  See the NOTICE file distributed with
    4    * this work for additional information regarding copyright ownership.
    5    * The ASF licenses this file to You under the Apache License, Version 2.0
    6    * (the "License"); you may not use this file except in compliance with
    7    * the License.  You may obtain a copy of the License at
    8    *
    9    *      http://www.apache.org/licenses/LICENSE-2.0
    10   *
    11   * Unless required by applicable law or agreed to in writing, software
    12   * distributed under the License is distributed on an "AS IS" BASIS,
    13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14   * See the License for the specific language governing permissions and
    15   * limitations under the License.
    16   */
    17
    18  package org.apache.log4j.chainsaw.plugins;
    19
    20  import org.apache.log4j.plugins.Plugin;
    21  import org.apache.log4j.spi.LoggerRepository;
    22
    23  import javax.swing.*;
    24  import java.awt.*;
    25
    26
    27  /**
    28   */
    29  public abstract class GUIPluginSkeleton extends JPanel implements Plugin {
    30      private LoggerRepository loggerRepository;
    31      private boolean active;
    32
    33      /**
    34       *
    35       */
    36      public GUIPluginSkeleton() {
    37          super();
    38      }
    39
    40      /**
    41       * @param isDoubleBuffered
    42       */
    43      public GUIPluginSkeleton(boolean isDoubleBuffered) {
    44          super(isDoubleBuffered);
    45      }
    46
    47      /**
    48       * @param layout
    49       */
    50      public GUIPluginSkeleton(LayoutManager layout) {
    51          super(layout);
    52      }
    53
    54      /**
    55       * @param layout
    56       * @param isDoubleBuffered
    57       */
    58      public GUIPluginSkeleton(LayoutManager layout, boolean isDoubleBuffered) {
    59          super(layout, isDoubleBuffered);
    60      }
    61
    62      /* (non-Javadoc)
    63       * @see org.apache.log4j.plugins.Plugin#getLoggerRepository()
    64       */
    65      public LoggerRepository getLoggerRepository() {
    66          return this.loggerRepository;
    67      }
    68
    69      /* (non-Javadoc)
    70       * @see org.apache.log4j.plugins.Plugin#setLoggerRepository(org.apache.log4j.spi.LoggerRepository)
    71       */
    72      public void setLoggerRepository(LoggerRepository repository) {
    73          this.loggerRepository = repository;
    74      }
    75
    76      /* (non-Javadoc)
    77       * @see org.apache.log4j.plugins.Plugin#isActive()
    78       */
    79      public boolean isActive() {
    80          return active;
    81      }
    82
    83      /* (non-Javadoc)
    84       * @see org.apache.log4j.plugins.Plugin#isEquivalent(org.apache.log4j.plugins.Plugin)
    85       */
    86      public boolean isEquivalent(Plugin testPlugin) {
    87          // TODO Auto-generated method stub
    88          return false;
    89      }
    90
    91      /**
    92       * @param active The active to set.
    93       */
    94      public final void setActive(boolean active) {
    95          boolean oldValue = this.active;
    96          this.active = active;
    97          firePropertyChange("active", oldValue, this.active);
    98      }
    99  }