Package com.life.audiotageditor.tables

Source Code of com.life.audiotageditor.tables.AudioTagContentProvider

/**
* This file is part of ${project_name}.
*
* ${project_name} is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* ${project_name} is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* ${project_name}. If not, see <http://www.gnu.org/licenses/>.
*
* @see http://www.gnu.org/licenses/lgpl.txt
* @author art <lijianghui2000@gmail.com>
*/
package com.life.audiotageditor.tables;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import com.life.audiotageditor.model.AudioFolder;
import com.life.audiotageditor.model.AudioModel;
import com.life.audiotageditor.model.IAudioModel;

public class AudioTagContentProvider implements IStructuredContentProvider {

  @Override
  public void dispose() {
    // TODO Auto-generated method stub

  }

  @Override
  public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
    // TODO Auto-generated method stub

  }

  @Override
  public Object[] getElements(Object element) {
    if (element instanceof AudioModel) {
      AudioModel audioModel = ((AudioModel) element);
      switch (audioModel.getType()) {
      case IAudioModel.AUDIO_FOLDER:
        return ((AudioFolder) audioModel).members();
      case IAudioModel.AUDIO_FILE:
        return new Object[] { audioModel };
      }
    }
    return new Object[0];
  }

}
TOP

Related Classes of com.life.audiotageditor.tables.AudioTagContentProvider

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.