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
|
|
|
|
*******************************************************************************/
|
2015-10-22 00:05:29 +02:00
|
|
|
|
|
|
|
package com.minres.scviewer.e4.application.handlers;
|
|
|
|
|
2021-11-18 14:24:08 +01:00
|
|
|
import org.eclipse.e4.core.di.annotations.CanExecute;
|
2015-10-22 00:05:29 +02:00
|
|
|
import org.eclipse.e4.core.di.annotations.Execute;
|
2020-03-13 22:06:55 +01:00
|
|
|
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;
|
2015-10-22 00:05:29 +02:00
|
|
|
|
|
|
|
public class SelectAllHandler {
|
|
|
|
|
2021-11-18 14:24:08 +01:00
|
|
|
@CanExecute
|
|
|
|
public boolean canExecute(EPartService partService) {
|
|
|
|
MPart part = partService.getActivePart();
|
2023-03-01 12:53:34 +01:00
|
|
|
return part!=null && part.getObject() instanceof WaveformViewer;
|
2021-11-18 14:24:08 +01:00
|
|
|
}
|
|
|
|
|
2015-10-22 00:05:29 +02:00
|
|
|
@Execute
|
2020-03-13 22:06:55 +01:00
|
|
|
public void execute(EPartService partService) {
|
|
|
|
MPart part = partService.getActivePart();
|
2023-03-01 12:53:34 +01:00
|
|
|
if(part!=null && part.getObject() instanceof WaveformViewer)
|
2021-11-18 12:55:23 +01:00
|
|
|
((WaveformViewer) part.getObject()).selectAll();
|
|
|
|
}
|
2020-03-13 22:06:55 +01:00
|
|
|
|
2015-10-22 00:05:29 +02:00
|
|
|
}
|