use of org.eclipse.jface.util.PropertyChangeEvent in project translationstudio8 by heartsome.
the class WorkingSetActionProvider method init.
public void init(ICommonActionExtensionSite aSite) {
viewer = (CommonViewer) aSite.getStructuredViewer();
contentService = aSite.getContentService();
filterService = (NavigatorFilterService) contentService.getFilterService();
extensionStateModel = contentService.findStateModel(WorkingSetsContentProvider.EXTENSION_ID);
workingSetActionGroup = new WorkingSetFilterActionGroup(aSite.getViewSite().getShell(), filterChangeListener);
workingSetRootModeActionGroup = new WorkingSetRootModeActionGroup(viewer, extensionStateModel);
topLevelModeListener = new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
setWorkingSet(workingSet);
viewer.getFrameList().reset();
}
};
if (contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) {
managerChangeListener.listen();
extensionStateModel.addPropertyChangeListener(topLevelModeListener);
}
contentService.getActivationService().addExtensionActivationListener(activationListener);
}
use of org.eclipse.jface.util.PropertyChangeEvent in project tdi-studio-se by Talend.
the class HL7DragAndDrogDialog method createDialogArea.
/*
* (non-Javadoc) Method declared on Dialog.
*/
protected Control createDialogArea(Composite parent) {
// create composite
Composite composite = (Composite) super.createDialogArea(parent);
// composite.setLayout(new GridLayout());
String[][] namevalues = null;
if (hideAttr) {
namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Add linker to target node", CREATE_AS_TEXT } };
} else {
namevalues = new String[][] { { "Create as sub-element of target node", CREATE_AS_SUBELEMENT }, { "Create as attribute of target node", CREATE_AS_ATTRIBUTE }, { "Add linker to target node", CREATE_AS_TEXT } };
}
RadioGroupFieldEditor rgfe = new RadioGroupFieldEditor("", "Select the operation:", 1, namevalues, composite, true);
GridLayout layout = new GridLayout();
layout.marginWidth = 12;
composite.setLayout(layout);
rgfe.setPropertyChangeListener(new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
value = event.getNewValue().toString();
}
});
applyDialogFont(composite);
return composite;
}
use of org.eclipse.jface.util.PropertyChangeEvent in project tdi-studio-se by Talend.
the class AttributeSelectionDialog method createColorSelector.
/**
* Creates the color selector.
*
* @param parent The parent composite
* @return The color selector
*/
private ColorSelector createColorSelector(Composite parent) {
final ColorSelector selector = new ColorSelector(parent);
selector.addListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
AttributeNode attribute = (AttributeNode) selection.getFirstElement();
if (attribute != null) {
attribute.setRgb(selector.getColorValue());
}
}
});
selector.setEnabled(false);
return selector;
}
use of org.eclipse.jface.util.PropertyChangeEvent in project tdi-studio-se by Talend.
the class ConfigureChartDialog method createColorSelector.
/**
* Creates the color selector.
*
* @param parent The parent composite
* @return The color selector
*/
private ColorSelector createColorSelector(Composite parent) {
final ColorSelector selector = new ColorSelector(parent);
selector.addListener(new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
IStructuredSelection selection = (IStructuredSelection) attributesViewer.getSelection();
MBeanAttribute attribute = (MBeanAttribute) selection.getFirstElement();
if (attribute != null) {
attribute.setRgb(selector.getColorValue());
}
}
});
selector.setEnabled(false);
return selector;
}
use of org.eclipse.jface.util.PropertyChangeEvent in project sling by apache.
the class ServersActionModeFiddlerActionDelegate method selectionChanged.
@Override
public void selectionChanged(IAction action, ISelection selection) {
server = null;
modules = null;
if (selection != null && (selection instanceof IStructuredSelection)) {
IStructuredSelection iss = (IStructuredSelection) selection;
Object first = iss.getFirstElement();
if (first instanceof IServer) {
server = (IServer) first;
modules = null;
if (iss.size() > 1) {
// verify that all selected elements are of type IServer
Iterator<?> it = iss.iterator();
// skip the first, we have that above already
it.next();
while (it.hasNext()) {
Object next = it.next();
if (!(next instanceof IServer)) {
server = null;
modules = null;
break;
}
}
}
} else if (first instanceof IServerModule) {
modules = new LinkedList<>();
IServerModule module = (IServerModule) first;
modules.add(module.getModule());
server = module.getServer();
if (iss.size() > 1) {
// verify that all selected elements are of type IServerModule
// plus add the module[] to the modules list
Iterator<?> it = iss.iterator();
// skip the first, we have that above already
it.next();
while (it.hasNext()) {
Object next = it.next();
if (!(next instanceof IServerModule)) {
server = null;
module = null;
break;
} else {
module = (IServerModule) next;
modules.add(module.getModule());
}
}
}
}
}
if (server != null) {
if (server.getServerState() != IServer.STATE_STARTED) {
server = null;
modules = null;
}
}
cleanAction.setEnabled(server != null);
publishAction.setEnabled(server != null);
action.setEnabled(true);
final IAction serverRunAction = actionBars.getGlobalActionHandler("org.eclipse.wst.server.run");
final IAction serverDebugAction = actionBars.getGlobalActionHandler("org.eclipse.wst.server.debug");
IAction stopRunAction = actionBars.getGlobalActionHandler("org.eclipse.wst.server.stop");
if (serverRunAction == null || stopRunAction == null || serverDebugAction == null) {
return;
}
// serverRunAction.setHoverImageDescriptor(SharedImages.SLING_LOG);
serverRunAction.setHoverImageDescriptor(SharedImages.RUN_CONNECT);
serverDebugAction.setHoverImageDescriptor(SharedImages.DEBUG_CONNECT);
stopRunAction.setHoverImageDescriptor(SharedImages.DISCONNECT);
findWstPublishAction();
for (ActionContributionItem appendedAction : appendedToolbarActionContributionItems) {
if (!contributionAdded(appendedAction)) {
actionBars.getToolBarManager().add(appendedAction);
}
}
if (wstPublishAction != null) {
wstPublishAction.setVisible(false);
publishActionContributionItem.setVisible(true);
} else {
// otherwise hide it, as it is an unexpected situation
publishActionContributionItem.setVisible(false);
}
final String runText = "Connect to server in run mode";
if (runTooltipListener == null) {
runTooltipListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IAction.TOOL_TIP_TEXT)) {
if (!event.getNewValue().equals(runText)) {
serverRunAction.setToolTipText(runText);
}
}
}
};
serverRunAction.addPropertyChangeListener(runTooltipListener);
}
final String debugText = "Connect to server in debug mode";
if (debugTooltipListener == null) {
debugTooltipListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IAction.TOOL_TIP_TEXT)) {
if (!event.getNewValue().equals(debugText)) {
serverDebugAction.setToolTipText(debugText);
}
}
}
};
serverDebugAction.addPropertyChangeListener(debugTooltipListener);
}
final String disconnectText = "Disconnect from server";
if (disconnectTooltipListener == null) {
disconnectTooltipListener = new IPropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IAction.TOOL_TIP_TEXT)) {
if (!event.getNewValue().equals(disconnectText)) {
serverRunAction.setToolTipText(disconnectText);
}
}
}
};
stopRunAction.addPropertyChangeListener(disconnectTooltipListener);
}
serverRunAction.setToolTipText(runText);
serverDebugAction.setToolTipText(debugText);
stopRunAction.setToolTipText(disconnectText);
}
Aggregations