This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Label { | |
font: Verdana 8px; | |
color: black; | |
} | |
Composite Label { | |
color: black; | |
} | |
Text { | |
font: Verdana 8px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get IEclipsePreferences to change a value | |
@Execute | |
public void execute | |
(@Preference(nodePath = "com.example.e4.rcp.todo") IEclipsePreferences prefs) { | |
// More stuff... | |
prefs.put("user", "TestUser"); | |
prefs.put("password", "Password"); | |
// Persists | |
try { | |
prefs.flush(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this field | |
// Define listener for the databinding | |
IChangeListener listener = new IChangeListener() { | |
@Override | |
public void handleChange(ChangeEvent event) { | |
if (dirty!=null){ | |
dirty.setDirty(true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.e4.rcp.todo.model; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.function.Consumer; | |
public interface ITodoService { | |
void getTodos(Consumer<List<Todo>> todosConsumer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public boolean deleteTodo(long id) { | |
Todo deleteTodo = null; | |
for (Todo todo : model) { | |
if (id == todo.getId()) { | |
deleteTodo = todo; | |
} | |
} | |
if (deleteTodo!=null) { | |
model.remove(deleteTodo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.e4.rcp.todo.dialogs; | |
import org.eclipse.jface.dialogs.Dialog; | |
import org.eclipse.jface.dialogs.IDialogConstants; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.events.ModifyEvent; | |
import org.eclipse.swt.events.ModifyListener; | |
import org.eclipse.swt.graphics.Point; | |
import org.eclipse.swt.layout.GridData; | |
import org.eclipse.swt.layout.GridLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.e4.rcp.todo.events; | |
public class MyEventConstants { | |
public static final String TOPIC_TODO_DATA_UPDATE = | |
"TOPIC_TODO_DATA_UPDATE"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.e4.rcp.todo.lifecycle; | |
import org.eclipse.e4.core.services.events.IEventBroker; | |
import org.eclipse.e4.ui.workbench.UIEvents; | |
import org.eclipse.e4.ui.workbench.lifecycle.PostContextCreate; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.widgets.Shell; | |
import org.osgi.service.event.Event; | |
import org.osgi.service.event.EventHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.e4.todo.contribute.dialogs; | |
import javax.inject.Inject; | |
import javax.inject.Named; | |
import org.eclipse.e4.ui.services.IServiceConstants; | |
import org.eclipse.jface.dialogs.Dialog; | |
import org.eclipse.swt.SWT; | |
import org.eclipse.swt.widgets.Composite; | |
import org.eclipse.swt.widgets.Control; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.vogella.android.rssfeedlibrary; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Random; | |
public class RssFeedProvider { | |
public static List<RssItem> parse(String rssFeed) { | |
List<RssItem> list = new ArrayList<>(); | |
Random r = new Random(); |
OlderNewer