tesseract
3.03
|
00001 // Copyright 2007 Google Inc. All Rights Reserved. 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); You may not 00004 // use this file except in compliance with the License. You may obtain a copy of 00005 // the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by 00006 // applicable law or agreed to in writing, software distributed under the 00007 // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 00008 // OF ANY KIND, either express or implied. See the License for the specific 00009 // language governing permissions and limitations under the License. 00010 00011 package com.google.scrollview.ui; 00012 00022 import com.google.scrollview.events.SVEventType; 00023 00024 import javax.swing.JMenuItem; 00025 00031 class SVMenuItem extends SVAbstractMenuItem { 00032 public String value = null; 00033 public String desc = null; 00034 00035 SVMenuItem(int id, String name, String v, String d) { 00036 super(id, name, new JMenuItem(name)); 00037 value = v; 00038 desc = d; 00039 } 00040 00046 @Override 00047 public void performAction(SVWindow window, SVEventType eventType) { 00048 if (desc != null) { 00049 window.showInputDialog(desc, value, id, eventType); 00050 } else { 00051 window.showInputDialog(name, value, id, eventType); 00052 } 00053 } 00054 00056 @Override 00057 public String getValue() { 00058 return value; 00059 } 00060 } 00061