Skip to main content
summaryrefslogtreecommitdiffstats
blob: 446a23a6f8ec15c4d893efdb69dff7b5b7526e53 (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
/*******************************************************************************
 * Copyright (c) 2010 Boeing.
 * 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:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ote.ui.message.watch.action;

import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.osee.ote.message.enums.DataType;
import org.eclipse.osee.ote.ui.message.tree.WatchedMessageNode;

/**
 * @author Ken J. Aguilar
 */
public class SetDataSourceAction extends Action {

   private final WatchedMessageNode node;
   private final DataType type;

   public SetDataSourceAction(WatchedMessageNode node, DataType type) {
      super(type.name(), IAction.AS_RADIO_BUTTON);
      this.node = node;
      this.type = type;
      setChecked(node.getSubscription().getMemType() == type);
   }

   @Override
   public void run() {
      node.getSubscription().changeMemType(type);
   }

}

Back to the top