SCViewer/plugins/com.minres.scviewer.e4.appl.../src/com/minres/scviewer/e4/application/handlers/SelectAllHandler.java

36 lines
1.3 KiB
Java
Raw Normal View History

2015-10-22 00:25:12 +02:00
/*******************************************************************************
2021-01-09 14:26:49 +01:00
* Copyright (c) 2015-2021 MINRES Technologies GmbH and others.
2015-10-22 00:25:12 +02:00
* 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:
* MINRES Technologies GmbH - initial API and implementation
*******************************************************************************/
package com.minres.scviewer.e4.application.handlers;
2021-11-18 14:24:08 +01:00
import org.eclipse.e4.core.di.annotations.CanExecute;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
2021-11-18 12:55:23 +01:00
import com.minres.scviewer.e4.application.parts.WaveformViewer;
public class SelectAllHandler {
2021-11-18 14:24:08 +01:00
@CanExecute
public boolean canExecute(EPartService partService) {
MPart part = partService.getActivePart();
return part!=null && part.getObject() instanceof WaveformViewer;
2021-11-18 14:24:08 +01:00
}
@Execute
public void execute(EPartService partService) {
MPart part = partService.getActivePart();
if(part!=null && part.getObject() instanceof WaveformViewer)
2021-11-18 12:55:23 +01:00
((WaveformViewer) part.getObject()).selectAll();
}
}