com.opera.widgets.ui.editor.labelprovider.AccessLabelProvider.java Source code

Java tutorial

Introduction

Here is the source code for com.opera.widgets.ui.editor.labelprovider.AccessLabelProvider.java

Source

/*******************************************************************************
 * Copyright (c) 2010-2011 Opera Software.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Opera Software - initial API and implementation
 *******************************************************************************/

package com.opera.widgets.ui.editor.labelprovider;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import com.opera.widgets.core.widget.Access;

/**
 * Label provider for access list.
 * 
 */
public class AccessLabelProvider extends LabelProvider implements ITableLabelProvider {

    @Override
    public Image getColumnImage(Object element, int columnIndex) {
        return null;
    }

    @Override
    public String getColumnText(Object element, int columnIndex) {
        Access f = (Access) element;
        switch (columnIndex) {
        case 0:
            return f.getOrigin();
        case 1:
            return Boolean.toString(f.isSubdomains());
        }
        return null;
    }
}