001/* 002 Licensed to the Apache Software Foundation (ASF) under one 003 or more contributor license agreements. See the NOTICE file 004 distributed with this work for additional information 005 regarding copyright ownership. The ASF licenses this file 006 to you under the Apache License, Version 2.0 (the 007 "License"); you may not use this file except in compliance 008 with the License. You may obtain a copy of the License at 009 010 http://www.apache.org/licenses/LICENSE-2.0 011 012 Unless required by applicable law or agreed to in writing, 013 software distributed under the License is distributed on an 014 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 KIND, either express or implied. See the License for the 016 specific language governing permissions and limitations 017 under the License. 018 */ 019package org.apache.wiki.ui.progress; 020 021/** 022 * Provides access to an progress item. 023 * 024 * @since 2.6 025 */ 026public abstract class ProgressItem { 027 028 /** Status: The PI is created. */ 029 public static final int CREATED = 0; 030 031 /** Status: The PI is started. */ 032 public static final int STARTED = 1; 033 034 /** Status: The PI is stopped. */ 035 public static final int STOPPED = 2; 036 037 /** Status: The PI is finished. */ 038 public static final int FINISHED = 3; 039 040 protected int m_state = CREATED; 041 042 /** 043 * Get the state of the ProgressItem. 044 * 045 * @return CREATED, STARTED, STOPPED or FINISHED. 046 */ 047 public int getState() { 048 return m_state; 049 } 050 051 /** 052 * Sets the state of the ProgressItem. 053 * 054 * @param state One of the CREATED, STARTED, STOPPED or FINISHED. 055 */ 056 public void setState( final int state ) { 057 m_state = state; 058 } 059 060 /** 061 * Returns the progress in percents. 062 * 063 * @return An integer 0-100. 064 */ 065 public abstract int getProgress(); 066 067}