001 /*
002 *
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements. See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership. The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License. You may obtain a copy of the License at
010 *
011 * http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied. See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 *
020 */
021 package org.apache.qpid.management.ui.views;
022
023 import java.util.ArrayList;
024
025 import org.apache.qpid.management.ui.ManagedBean;
026 import org.apache.qpid.management.ui.model.OperationData;
027 import org.eclipse.swt.widgets.Control;
028 import org.eclipse.swt.widgets.TabFolder;
029
030 /**
031 * Abstract class for all the control classes of tabs.
032 * @author Bhupendra Bhardwaj
033 */
034 public abstract class TabControl
035 {
036 protected ManagedBean _mbean = null;
037 protected TabFolder _tabFolder = null;
038
039 private static java.util.List<String> simpleTypes = new ArrayList<String>();
040
041 static
042 {
043 simpleTypes.add("java.math.BigDecimal");
044 simpleTypes.add("java.math.BigInteger");
045 simpleTypes.add("java.lang.Boolean");
046 simpleTypes.add("java.lang.Byte");
047 simpleTypes.add("java.lang.Character");
048 simpleTypes.add("java.util.Date");
049 simpleTypes.add("java.lang.Double");
050 simpleTypes.add("java.lang.Float");
051 simpleTypes.add("java.lang.Integer");
052 simpleTypes.add("java.lang.Long");
053 simpleTypes.add("javax.management.ObjectName");
054 simpleTypes.add("java.lang.Short");
055 simpleTypes.add("java.lang.String");
056 simpleTypes.add("boolean");
057 }
058
059 public TabControl(TabFolder tabFolder)
060 {
061 _tabFolder = tabFolder;
062 }
063
064 /**
065 * @return controller composite for the tab
066 */
067 public Control getControl()
068 {
069 return null;
070 }
071
072 public void refresh(ManagedBean mbean)
073 {
074 if (mbean == null)
075 {
076 refresh();
077 }
078 }
079
080 public void refresh()
081 {
082
083 }
084
085 public void refresh(ManagedBean mbean, OperationData opData)
086 {
087
088 }
089
090 /**
091 * Sets focus on a widget
092 */
093 public void setFocus()
094 {
095
096 }
097
098 public boolean isSimpleType(Object data)
099 {
100 return simpleTypes.contains(data.getClass().getName());
101 }
102 }
|