Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7873646d44e4896298f26c93dd4839ddfb5e06d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (c) 2014 Eike Stepper (Loehne, Germany) and others.
 * 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:
 *    Eike Stepper - initial API and implementation
 */
package @QualifiedPackageName@.provider;

import @QualifiedPackageName@.@TaskName@Task;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.oomph.setup.provider.SetupTaskItemProvider;

/**
 * This is the item provider adapter for a {@link @QualifiedPackageName@.@TaskName@Task} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class @TaskName@TaskItemProvider extends SetupTaskItemProvider
{
  /**
   * This constructs an instance from a factory and a notifier.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public @TaskName@TaskItemProvider(AdapterFactory adapterFactory)
  {
    super(adapterFactory);
  }

  /**
   * This returns the label text for the adapted class.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public String getTextGen(Object object)
  {
    String label = ((@TaskName@Task)object).toString();
    return label == null || label.length() == 0 ? getString("_UI_@TaskName@Task_type") : getString("_UI_@TaskName@Task_type") + " " +label;
  }

  @Override
  public String getText(Object object)
  {
    String label = getTextGen(object);
    
    String type = getString("_UI_@TaskName@Task_type");
    return label.startsWith(type + " ") && !label.equals(type) ? label.substring(type.length()).trim() : label;
  }
  
}

Back to the top